1COMEDI_DIO_BITFIELD2(3) COMEDI_DIO_BITFIELD2(3)
2
3
4
6 comedi_dio_bitfield2 - read/write multiple digital channels
7
9 #include <comedilib.h>
10
11 int comedi_dio_bitfield2 (comedi_t * device, unsigned int subdevice,
12 unsigned int write_mask, unsigned int * bits, unsigned int base_chan‐
13 nel);
14
16 The function comedi_dio_bitfield2() allows multiple channels to be read
17 or written together on a digital input, output, or configurable digital
18 I/O device. The parameter write_mask and the value pointed to by bits
19 are interpreted as bit fields, with the least significant bit repre‐
20 senting channel base_channel. For each bit in write_mask that is set
21 to 1, the cooresponding bit in *bits is written to the digital output
22 channel. After writing all the output channels, each channel is read,
23 and the result placed in the approprate bits in *bits. The result of
24 reading an output channel is the last value written to the output chan‐
25 nel.
26
27 All the channels may not be read or written at the exact same time.
28 For example, the driver may need to sequentially write to several ports
29 in order to set all the digital channels specified by the write_mask.
30
31 28 October 2007 COMEDI_DIO_BITFIELD2(3)