The comedi module uses the comedi library to interface with various I/O cards (almost 250 as of this writing, from various manufacturers). The library (but not the module) was written by the comedi project.
In comedi, the inputs and outputs on each device (card) are grouped into subdevices. Each input or output is then referred to as a channel. All three of these (devices, subdevices and channels) are numbered, starting from 0. In addition, analogue channels can have multiple ranges and references, if the card supports these, and they can be obtained raw (as an integer) or converted to physical units (volts or milliamps).
In the mapping table, comedi addresses are specified as follows:
I2.3
1:X7.3/2_DIFF
U.2
Each address has the form (some parts optional):
device: type subdevice.channel options
This diagram shows which parts are optional, which are mandatory, and the order in which they may be used. To make a valid address, start in the double circle labelled S, and follow the arrows until you get to E. Boxes denote actual letters and punctuation to use, ovals the various settings, as explained below. The small circles are simply junctions.
:
/dev/comedi
" will be prepended in the latter
case). The device specification may be omitted, including the colon, in
which case 0 will be used.
I
and O
(so they don't get
mistaken for numbers). The floating-point format used by the
X
and Y
types is the same as used by the DSP module.
type | meaning | bits | format |
---|---|---|---|
I | digital input | 1 | on/off |
O or Q | digital output | 1 | on/off |
N | analog input (raw) (mnemonic: iN) | 1-32 | integer |
U | analog output (raw) (mnemonic: oUt) | 1-32 | integer |
X | analog input converted to physical units | 32 | float |
Y | analog output converted from physical units | 32 | float |
1
is the same as 1.0
.1
is the same as 0.1
/
range_
ref0
, GROUND
and
GND
are all equivalent). Default GROUND
.
Mnemonic: the value at the low end; hence underscore.
$Date: 2004/12/28 05:32:10 $