Specifications

Comedi
25 / 148
Extended trigger configuration should be designed in such a way that the user can probe for valid parameters, similar to how
command testing works. An extended trigger configuration instruction should not configure the hardware directly, rather, the
configuration should be saved until the subsequent command is issued. This allows more flexibility for future interface changes.
It has not been decided whether the configuration stage should return a token that is then used as the trigger argument in the
command. Using tokens is one method to satisfy the problem that extended trigger configurations may have subtle compatiblity
issues with other trigger sources/arguments that can only be determined at command test time. Passing all stages of a command
test should only be allowed with a properly configured extended trigger.
Extended triggers must use data[1] as flags. The upper 16 bits are reserved and used only for flags that are common to all
extended triggers. The lower 16 bits may be defined by the particular type of extended trigger.
Various types of extended triggers must use data[1] to know which event the extended trigger will be assigned to in the command
structure. The possible values are an OR’d mask of the following:
COMEDI_EV_START
COMEDI_EV_SCAN_BEGIN
COMEDI_EV_CONVERT
COMEDI_EV_SCAN_END
COMEDI_EV_STOP
4.7.5 Analog Triggering
(Status: alpha. The ni_mio_common.c driver implements this feature.)
The insn field of the instruction data structure has not been assigned yet.
The chanspec field of the instruction data structure is ignored.
The data field of the instruction data structure is used as follows:
data[1] trigger and combining machine configuration.
data[2] analog triggering signal chanspec.
data[3] primary analog level.
data[4] secondary analog level.
Analog triggering is described by a digital combining machine that has two sensitive digital inputs. The sensitive digital inputs
are generated by configurable analog comparators. The analog comparators generate a digital 1 when the analog triggering signal
is greater than the comparator level. The digital inputs are not modifier inputs. Note, however, there is an effective modifier due
to the restriction that the primary analog comparator level must be less than the secondary analog comparator level.
If only one analog comparator signal is used, the combining machine for the secondary input should be set to ignored, and the
secondary analog level should be set to 0.
The interpretation of the chanspec and voltage levels is device dependent, but should correspond to similar values of the analog
input subdevice, if possible.
Notes: Reading range information is not addressed. This makes it difficult to convert comparator voltages to data values.
Possible extensions: A parameter that specifies the necessary time that the set condition has to be true before the trigger is
generated. A parameter that specifies the necessary time that the reset condition has to be true before the state machine is reset.