Specifications
Comedi
45 / 148
5.4.1.21 comedi_get_subdevice_flags
comedi_get_subdevice_flags — properties of subdevice
Synopsis
#include <comedilib.h>
int comedi_get_subdevice_flags(comedi_t * device, unsigned int subdevice);
Description
The function comedi_get_subdevice_flags() returns a bitfield describing the capabilities of the specified subdevice
subdevice of the Comedi device device. If there is an error, -1 is returned, and the Comedilib error value is set.
Subdevice Flag Value (hex) Description
SDF_BUSY 0x00000001
The subdevice is busy performing an
asynchronous command. A subdevice
being ‘busy’ is slightly different from
the ‘running’ state flagged by
SDF_RUNNING. A ‘running’
subdevice is always ‘busy’, but a
‘busy’ subdevice is not necessarily
‘running’. For example, suppose an
analog input command has been
completed by the hardware, but there
are still samples in Comedi’s buffer
waiting to be read out. In this case, the
subdevice is not ‘running’, but is still
‘busy’ until all the samples are read
out or comedi_cancel() is called.
SDF_BUSY_OWNER 0x00000002
The subdevice is ‘busy’, and the
command it is running was started by
the current process.
SDF_LOCKED 0x00000004
The subdevice has been locked by
comedi_lock().
SDF_LOCK_OWNER 0x00000008
The subdevice is locked, and was
locked by the current process.
SDF_MAXDATA 0x00000010
The maximum data value for the
subdevice depends on the channel.
SDF_FLAGS 0x00000020
The subdevice flags depend on the
channel (unfinished/broken support in
library).
SDF_RANGETYPE 0x00000040
The range type depends on the
channel.
SDF_CMD 0x00001000
The subdevice supports asynchronous
commands.
SDF_SOFT_CALIBRATED 0x00002000
The subdevice relies on the host to do
calibration in software. Software
calibration coefficients are determined
by the comedi_soft_calibrate utility.
See the description of the comedi_-
get_softcal_converter()
function for more information.
SDF_READABLE 0x00010000
The subdevice can be read (e.g.
analog input).