Specifications
Comedi
60 / 148
5.4.3.7 comedi_parse_calibration_file
comedi_parse_calibration_file — load contents of calibration file
Synopsis
#include <comedilib.h>
comedi_calibration_t * comedi_parse_calibration_file(const char * file_path);
Status
alpha
Description
This function parses a calibration file (produced by the comedi_calibrate or comedi_soft_calibrate programs) and returns a
pointer to a comedi_calibration_t which can be passed to the comedi_apply_parsed_calibration() or comedi_ge-
t_softcal_converter() functions. When you are finished using the comedi_calibration_t, you should call comedi_cl-
eanup_calibration() to free the resources associated with the comedi_calibration_t.
The comedi_get_default_calibration_path() function may be useful in conjunction with this function.
Return value
A pointer to parsed calibration information on success, or NULL on failure.
5.4.4 Digital I/O
5.4.4.1 comedi_dio_bitfield2
comedi_dio_bitfield2 — read/write multiple digital channels
Synopsis
#include <comedilib.h>
int comedi_dio_bitfield2(comedi_t * device, unsigned int subdevice, unsigned int write_mask, unsigned int * bits, unsigned int
base_channel);
Description
The function comedi_dio_bitfield2() allows multiple channels to be read or written together on a digital input, output, or
configurable digital I/O device. The parameter write_mask and the value pointed to by bits are interpreted as bit fields, with
the least significant bit representing channel base_channel. For each bit in write_mask that is set to 1, the corresponding bit
in
*
bits 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
*
bits. 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 write_mask and base_channel parameters.
Return value
If successful, 0 is returned, otherwise -1.