Specifications

Comedi
33 / 148
5.2.6 enum comedi_subdevice_type
enum comedi_subdevice_type {
COMEDI_SUBD_UNUSED, /
*
subdevice is unused by driver
*
/
COMEDI_SUBD_AI, /
*
analog input
*
/
COMEDI_SUBD_AO, /
*
analog output
*
/
COMEDI_SUBD_DI, /
*
digital input
*
/
COMEDI_SUBD_DO, /
*
digital output
*
/
COMEDI_SUBD_DIO, /
*
digital input/output
*
/
COMEDI_SUBD_COUNTER, /
*
counter
*
/
COMEDI_SUBD_TIMER, /
*
timer
*
/
COMEDI_SUBD_MEMORY, /
*
memory, EEPROM, DPRAM
*
/
COMEDI_SUBD_CALIB, /
*
calibration DACs and pots
*
/
COMEDI_SUBD_PROC, /
*
processor, DSP
*
/
COMEDI_SUBD_SERIAL, /
*
serial IO
*
/
COMEDI_SUBD_PWM /
*
pulse width modulation
*
/
};
The comedi_subdevice_type enumeration specifies the possible values for a subdevice type. These values are used by the func-
tions comedi_get_subdevice_type() and comedi_find_subdevice_by_type().
5.3 Data types and structures
This Section explains the data structures that users of the Comedi API are confronted with:
typedef struct comedi_devinfo_struct comedi_devinfo;
typedef struct comedi_t_struct comedi_t;
typedef struct sampl_t_struct sampl_t;
typedef struct lsampl_t_struct lsampl_t;
typedef struct comedi_sv_t_struct comedi_sv_t;
typedef struct comedi_cmd_struct comedi_cmd;
typedef struct comedi_insn_struct comedi_insn;
typedef struct comedi_range_struct comedi_range;
typedef struct comedi_krange_struct comedi_krange;
typedef struct comedi_insnlist_struct comedi_insnlist;
The data structures used in the implementation of the Comedi drivers are described in Section 6.2.1.
5.3.1 comedi_devinfo
The data type comedi_devinfo is used to store information about a device. This structure is usually filled in automatically when
the driver is loaded (‘attached’), so programmers need not access this data structure directly.
typedef struct comedi_devinfo_struct comedi_devinfo;
struct comedi_devinfo_struct{
unsigned int version_code; // version number of the Comedi code
unsigned int n_subdevs; // number of subdevices on this device
char driver_name[COMEDI_NAMELEN];
char board_name[COMEDI_NAMELEN];
int read_subdevice; // index of subdevice whose buffer is read by read(), etc. -
on file descriptor from comedi_fileno() (negative means none)
int write_subdevice; // index of subdevice whose buffer is written by write(), -
etc. on file descriptor from comedi_fileno() (negatove means none).
int unused[30];
};