Specifications
Comedi
47 / 148
Synopsis
#include <comedilib.h>
int comedi_get_version_code(comedi_t * device);
Description
Returns the Comedi kernel module version code. A valid Comedi device referenced by the parameter device is necessary to
communicate with the kernel module. On error, -1 is returned.
The version code is encoded as a bitfield of three 8-bit numbers. For example, 0x00073d is the version code for version 0.7.61.
This function is of limited usefulness. A typical mis-application of this function is to use it to determine if a certain feature is
supported. If the application needs to know of the existence of a particular feature, an existence test function should be written
and put in the Comedilib source.
5.4.1.24 comedi_internal_trigger
comedi_internal_trigger — generate soft trigger
Synopsis
#include <comedilib.h>
int comedi_internal_trigger(comedi_t * device, unsigned int subdevice, unsigned int trig_num);
Description
This function sends an INSN_INTTRIG instruction to a subdevice, which causes an internal triggering event. This event can,
for example, trigger a subdevice to start an asynchronous command.
The trig_num parameter is reserved for future use, and should be set to 0. It is likely it will be used in the future to support
multiple independent internal triggers. For example, an asynchronous command might be specified for a subdevice with a start-
_src of TRIG_INT, and a start_arg of 5. Then the start event would only be triggered if comedi_internal_trigger()
were called on the subdevice with a trig_num equal to the same value of 5.
Return value
0 on success, -1 on error.
5.4.1.25 comedi_lock
comedi_lock — subdevice reservation
Synopsis
#include <comedilib.h>
int comedi_lock(comedi_t * device, unsigned int subdevice);
Description
The function comedi_lock() reserves a subdevice for use by the current process. While the lock is held, no other process is
allowed to read, write, or configure that subdevice, although other processes can read information about the subdevice. The lock
is released by comedi_unlock(), or when comedi_close() is called on device.