Param: unsigned int * bits
Param: unsigned int base_channel
Description:
- The function comedi_dio_bitfield2() allows multiple channels to
+ The function <function>comedi_dio_bitfield2</function>
+ allows multiple channels to
be read or written together on a digital input, output,
or configurable digital I/O device.
- The parameter <parameter>write_mask</parameter>
- and the value pointed to by <parameter>bits</parameter>
+ The parameter <parameter class="function">write_mask</parameter>
+ and the value pointed to by <parameter class="function">bits</parameter>
are interpreted as bit fields, with the least significant bit
- representing channel <parameter>base_channel</parameter>.
- For each bit in <parameter>write_mask</parameter> that is
- set to 1, the cooresponding bit in <parameter>*bits</parameter>
+ representing channel <parameter class="function">base_channel</parameter>.
+ For each bit in <parameter class="function">write_mask</parameter> that is
+ set to 1, the corresponding bit in
+ <code language="C">*<parameter class="function">bits</parameter></code>
is written to the digital
output channel. After writing all the output channels, each
channel is read, and the result placed in the approprate bits in
- <parameter>*bits</parameter>. The result of
- reading an output channel is the last
- value written to the output channel.
+ <code language="C">*<parameter class="function">bits</parameter></code>.
+ The result of reading an output channel is the last value written to the
+ output channel.
All the channels might not be read or written at the exact same time.
For example, the driver may need to sequentially write to
several registers in order to set all the digital channels specified
- by the <parameter>write_mask</parameter>.
+ by the <parameter class="function">write_mask</parameter>
+ and <parameter class="function">base_channel</parameter> parameters.
Returns:
- If successful, 0 is returned, otherwise -1.
+ If successful, <literal>0</literal> is returned, otherwise
+ <literal>-1</literal>.
Function: comedi_dio_config -- change input/output properties of channel
Retval: int
Param: unsigned int channel
Param: unsigned int direction
Description:
- The function comedi_dio_config() configures individual channels
+ The function <function>comedi_dio_config</function> configures individual channels
in a digital I/O subdevice to be either input or output, depending
- on the value of <parameter>direction</parameter>. Valid directions are
- COMEDI_INPUT or COMEDI_OUTPUT.
+ on the value of <parameter class="function">direction</parameter>. Valid directions are
+ <constant>COMEDI_INPUT</constant> or <constant>COMEDI_OUTPUT</constant>.
Depending on the characteristics of the hardware device, multiple
channels might be grouped together in hardware when
configuring the input/output direction. In this
- case, a single call to comedi_dio_config() for any channel in the
- group will affect the entire group.
+ case, a single call to <function>comedi_dio_config</function>
+ for any channel in the group will affect the entire group.
Returns:
- If successful, 0 is returned, otherwise -1.
+ If successful, <literal>0</literal> is returned, otherwise
+ <literal>-1</literal>.
Function: comedi_dio_get_config -- query input/output properties of channel
Retval: int
Param: unsigned int channel
Param: unsigned int * direction
Description:
- The function comedi_dio_get_config() querys the input/output configuration of
+ The function <function>comedi_dio_get_config</function> queries the input/output configuration of
an individual channel
in a digital I/O subdevice (see
- <link linkend="func-ref-comedi-dio-config"><function>comedi_dio_config</function></link>).
- On success, *<parameter>direction</parameter> will
- be set to either COMEDI_INPUT or COMEDI_OUTPUT.
+ <function><link linkend="func-ref-comedi-dio-config">comedi_dio_config</link></function>).
+ On success, <code language="C">*<parameter
+ class="function">direction</parameter></code> will
+ be set to either <constant>COMEDI_INPUT</constant> or
+ <constant>COMEDI_OUTPUT</constant>.
Returns:
- If successful, 0 is returned, otherwise -1.
+ If successful, <literal>0</literal> is returned, otherwise
+ <literal>-1</literal>.
Function: comedi_dio_read -- read single bit from digital channel
Retval: int
Param: unsigned int channel
Param: unsigned int * bit
Description:
- The function comedi_dio_read reads the channel <parameter>channel</parameter>
+ The function <function>comedi_dio_read</function> reads the channel
+ <parameter class="function">channel</parameter>
belonging to the
- subdevice <parameter>subdevice</parameter> of device <parameter>device</parameter>.
+ subdevice <parameter class="functioN">subdevice</parameter> of device
+ <parameter class="function">device</parameter>.
The data value that is
- read is stored in the *<parameter>bit</parameter>. This function
- is equivalent to:
+ read is stored in the
+ <code language="C">*<parameter class="function">bit</parameter></code>.
+ This function is equivalent to:
<programlisting>
<link linkend="func-ref-comedi-data-read">comedi_data_read</link>(device, subdevice, channel, 0, 0, bit);
</programlisting>
If you wish to read multiple digital channels at once, it is more efficient to
use
- <link linkend="func-ref-comedi-dio-bitfield2"><function>comedi_dio_bitfield2</function></link>
+ <function><link
+ linkend="func-ref-comedi-dio-bitfield2">comedi_dio_bitfield2</link></function>
than to call this function multiple times.
Returns:
Return values and errors are the same as
- <link linkend="func-ref-comedi-data-read"><function>comedi_data_read</function></link>.
+ <function><link linkend="func-ref-comedi-data-read">comedi_data_read</link></function>.
Function: comedi_dio_write -- write single bit to digital channel
Retval: int
Param: unsigned int channel
Param: unsigned int bit
Description:
- The function writes the value <parameter>bit</parameter> to the channel
- <parameter>channel</parameter> belonging
- to the subdevice <parameter>subdevice</parameter> of device
- <parameter>device</parameter>. This function
+ The function writes the value <parameter class="function">bit</parameter> to the channel
+ <parameter class="function">channel</parameter> belonging
+ to the subdevice <parameter class="function">subdevice</parameter> of device
+ <parameter class="function">device</parameter>. This function
is equivalent to:
<programlisting>
- comedi_data_write(device, subdevice, channel, 0, 0, bit);
+ <link linkend="func-ref-comedi-data-write">comedi_data_write</link>(device, subdevice, channel, 0, 0, bit);
</programlisting>
This function does not require a digital subdevice or a subdevice
with a maximum data value of 1 to work properly.
If you wish to write multiple digital channels at once, it is more efficient to
use
- <link linkend="func-ref-comedi-dio-bitfield2"><function>comedi_dio_bitfield2</function></link>
+ <function><link
+ linkend="func-ref-comedi-dio-bitfield2">comedi_dio_bitfield2</link></function>
than to call this function multiple times.
Returns:
Return values and errors are the same as
- <link linkend="func-ref-comedi-data-write"><function>comedi_data_write</function></link>.
+ <function><link linkend="func-ref-comedi-data-write">comedi_data_write</link></function>.