Specifications

Comedi
32 / 148
5.2.2 CR_PACK_FLAGS
CR_PACK_FLAGS(chan, range, aref, flags) is similar to CR_PACK() but can be used to combine one or more flag bits
(bitwise-ORed together in the flags parameter) with the other parameters.
#define CR_PACK_FLAGS(chan, range, aref, flags) \
(CR_PACK(chan, range, aref) | ((flags) & CR_FLAGS_MASK))
Depending on context, the chan parameter might not be a channel; it could be a trigger source, clock source, gate source etc.
(in which case, the range and aref parameters would probably be set to 0), and the flags would modify the source in some
device-dependant way.
The following flag values are defined:
CR_ALT_FILTER, CR_DITHER, CR_DEGLITCH (all the same) specify that some sort of filtering is to be done on the channel,
trigger source, etc.
CR_ALT_SOURCE specifies that some alternate source is to be used for the channel (usually a calibration source).
CR_EDGE is usually combined with a trigger source number to specify that the trigger source is edge-triggered if the hardware
and driver supports both edge-triggering and level-triggering. If both are supported, not asserting this flag specifies level-
triggering.
CR_INVERT specifies that the trigger source, gate source, etc. is to be inverted.
5.2.3 RANGE_LENGTH (deprecated)
Rangetype values are library-internal tokens that represent an array of range information structures. These numbers are primarily
used for communication between the kernel and library.
The RANGE_LENGTH(rangetype) macro returns the length of the array that is specified by the rangetype token.
The RANGE_LENGTH() macro is deprecated, and should not be used in new applications. It is scheduled to be removed from the
header file at version 1.0. Binary compatibility may be broken for version 1.1.
5.2.4 enum comedi_conversion_direction
enum comedi_conversion_direction
{
COMEDI_TO_PHYSICAL,
COMEDI_FROM_PHYSICAL
};
A comedi_conversion_direction is used to choose between converting data from Comedi’s integer sample values to a physical
value (COMEDI_TO_PHYSICAL), and converting from a physical value to Comedi’s integer sample values (COMEDI_FROM-
_PHYSICAL).
5.2.5 enum comedi_io_direction
enum comedi_io_direction
{
COMEDI_INPUT,
COMEDI_OUTPUT
};
A comedi_io_direction is used to select between input or output. For example, comedi_dio_config() uses the COMEDI_-
INPUT and COMEDI_OUTPUT values to specify whether a configurable digital i/o channel should be configured as an input or
output.