Merge branch 'vendor/TCPDUMP' (early part)
[dragonfly.git] / share / man / man4 / man4.i386 / labpc.4
1 .\"
2 .\" Copyright (c) 1995 HD Associates, Inc.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\"    must display the following acknowledgement:
15 .\"      This product includes software developed by Christopher G. Demetriou.
16 .\" 3. The name of the author may not be used to endorse or promote products
17 .\"    derived from this software withough specific prior written permission
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .\" $FreeBSD: src/share/man/man4/man4.i386/labpc.4,v 1.8.2.2 2001/08/17 13:08:45 ru Exp $
31 .\" $DragonFly: src/share/man/man4/man4.i386/labpc.4,v 1.4 2007/03/22 23:02:31 swildner Exp $
32 .\"
33 .Dd April 26, 1995
34 .Dt LABPC 4 i386
35 .Os
36 .Sh NAME
37 .Nm labpc
38 .Nd National Instruments LABPC and LABPC+ driver
39 .Sh SYNOPSIS
40 .Cd "device labpc0 at isa? port 260 irq 5"
41 .Sh DESCRIPTION
42 This supports the National Instruments LABPC and LABPC+ \fILow-Cost
43 Multifunction I/O Board\fP.
44 .Pp
45 This board provides 8 12 bit A-D input channels, 2 12 bit D-A output
46 channels, and 3 8 bit digital I/O ports.  It also supports setting
47 up the National Instruments SCXI bus off the digital I/O ports,
48 although that software is currently present in an external program
49 and not as part of the driver.
50 .Pp
51 The selection of the input or output device, mode, and channel is
52 through the minor number:
53 .Bd -literal -offset indent
54 The 8 bit minor number format is UUSIDCCC, with
55  UU: Board unit.
56   S: SCAN bit for scan enable.
57   I: INTERVAL for interval support
58   D: 1: Digital I/O, 0: Analog I/O
59 CCC: The channel selector:
60      ANALOG:
61      input:  channel must be 0 to 7 for AD0 ... AD7
62      output: channel must be 0 to 2
63              0: D-A 0
64              1: D-A 1
65              2: Alternate channel 0 then 1
66
67      DIGITAL:
68      input:  Channel must be 0 to 2.
69      output: Channel must be 0 to 2.
70 .Ed
71 .Pp
72 The /dev/MAKEDEV script will make the basic analog and digital
73 devices if you do "sh MAKEDEV labpcaio" and "sh MAKEDEV labpcdio",
74 however, it won't make device entries for INTERVAL and SCAN devices.
75 SCAN devices automatically scan over all channels from the channel
76 number down to 0 (for example, a SCAN for /dev/ad7 will read channels
77 AD7 ...  AD0) while the INTERVAL device will wait for an external
78 signal and then read all the channels from the selected channel
79 number down to 0 as fast as it can.  This is done by the hardware
80 and not the driver (other than turning it on); See the \fILabPC+
81 User's Manual\fP and the source code if this doesn't make sense to
82 you.
83 .Pp
84 The driver supports several general analog I/O ioctl calls.  These
85 are defined in
86 .In sys/dataacq.h
87 and are intended to be implemented in
88 other data acquisition board device drivers.
89 .Pp
90 .Dv AD_MICRO_PERIOD_SET
91 takes a pointer to a long argument specifying
92 the number of microseconds between samples.
93 .Pp
94 .Dv AD_MICRO_PERIOD_GET
95 takes a pointer to a long argument and returns
96 the current number of microseconds between samples.
97 .Pp
98 .Dv AD_NGAINS_GET
99 takes a pointer to an integer and returns the number
100 of different gain settings the board supports.  This is 8 for the
101 LabPC board.
102 .Pp
103 .Dv AD_NCHANS_GET
104 takes a pointer to an integer and returns the number
105 of channels the board supports.  This is 8 for the LabPC board.
106 .Pp
107 .Dv AD_SUPPORTED_GAINS
108 returns an array of NGAINS (the number obtained
109 by
110 .Dv AD_NGAINS_GET )
111 doubles.  These are the gains the board supports.
112 .Pp
113 .Dv AD_GAINS_SET
114 takes an array of NCHANS (the number obtained by
115 .Dv AD_NCHANS_GET )
116 integers and sets the board gains.  These are indices
117 into the supported gain array, with one gain for each channel.
118 .Pp
119 .Dv AD_GAINS_GET
120 takes an array of NCHANS (returned by
121 .Dv AD_NCHANS_GET )
122 integers and returns the current board gains.
123 .Sh BUGS
124 In general, only those capabilities that I needed are present.  In
125 particular the following notable restrictions are present.
126 .Pp
127 The analog input is only supported in a clocked conversion mode.
128 .Pp
129 You can only set the sample clock down to 15 Hz.  Anything slower
130 needs a modification to the driver to support TCINTEN in order to
131 chain together the counters to get a lower clock rate.
132 .Pp
133 There is no support for clocked D-A output.
134 .Pp
135 The 8255 providing the digital I/O ports  is supported only in mode
136 0 (three 8 bit ports).
137 .Pp
138 There is support for the SCXI bus off the LABPC board.  It is not
139 in the driver but is a separate user process that accesses the
140 digital I/O devices.  Ask dufault@hda.com for it.
141 .Pp
142 MAKEDEV only makes the "basic" devices.  You must make the INTERVAL
143 or SCAN devices by hand.
144 .Pp
145 The INTERVAL device sets the clock rate as high as possible so that
146 it samples all the channels as quickly as it can after the external
147 signal.  This is a silly restriction; it should simply use the
148 clock setting.
149 .Sh CAVEATS
150 National Instrument's (like most other laboratory grade board
151 vendors) definition of Low-Cost differs dramatically from many on
152 the net.