1 Function: comedi_arm -- arm a subdevice
3 Param: comedi_t * device
4 Param: unsigned int subdevice
5 Param: unsigned int source
8 This function arms a subdevice. It may, for example, arm a counter
9 to begin counting. The <parameter>source</parameter> parameter specifies
10 what source should trigger the subdevice to begin. The possible
11 sources are driver-dependant. This function is only useable
12 on subdevices that provide support for the INSN_CONFIG_ARM configuration
15 0 on success, -1 on error.
17 Function: comedi_get_clock_source -- get master clock for a subdevice
19 Param: comedi_t * device
20 Param: unsigned int subdevice
21 Param: unsigned int channel
22 Param: unsigned int *clock
23 Param: unsigned int *period_ns
26 This function queries the master clock for a subdevice, as
28 <link linkend="func-ref-comedi-set-clock-source">comedi_set_clock_source()</link>.
29 The currently configured master clock
30 will be written to *<parameter>clock</parameter>.
31 The possible values and their corresponding clocks are
33 The frequency of the clock in nanoseconds (or zero if it is unknown)
35 *<parameter>period_ns</parameter>.
36 If the subdevice does not support configuring its master clocks
37 on a per-channel basis, then the <parameter>channel</parameter>
38 parameter will be ignored.
40 It is safe to pass NULL pointers as the <parameter>clock</parameter> or
41 <parameter>period_ns</parameter>
42 parameters. This function is only useable
43 on subdevices that provide support for the INSN_CONFIG_GET_CLOCK_SOURCE
44 configuration instruction.
46 0 on success, -1 on error.
48 Function: comedi_get_gate_source -- get gate for a subdevice
50 Param: comedi_t * device
51 Param: unsigned int subdevice
52 Param: unsigned int channel
53 Param: unsigned int gate_index
54 Param: unsigned int *gate_source
57 This function queries the gate for a subdevice, as
59 <link linkend="func-ref-comedi-set-gate-source">comedi_set_gate_source()</link>.
60 The currently configured gate source
61 will be written to *<parameter>gate_source</parameter>.
62 The possible values and their corresponding gates are
63 driver-dependant. If the subdevice does not
64 support configuring its gates on a per-channel basis, then the
65 <parameter>channel</parameter> parameter will be ignored.
67 This function is only useable
68 on subdevices that provide support for the INSN_CONFIG_GET_GATE_SOURCE
69 configuration instruction.
71 0 on success, -1 on error.
73 Function: comedi_get_hardware_buffer_size -- get size of subdevice's hardware buffer
75 Param: comedi_t *device
76 Param: unsigned int subdevice
77 Param: <link linkend="ref-enum-comedi-io-direction">enum comedi_io_direction</link> direction
79 This functions returns the number of bytes the subdevice can hold in it's hardware buffer.
80 The term "hardware buffer" refers to any fifos, etc. on the acquisition board itself which
81 are used during streaming commands. This does not include the buffer maintained by
82 the comedi kernel module in host memory, whose size may be queried by
83 <link linkend="func-ref-comedi-get-buffer-size"><function>comedi_get_buffer_size</function></link>.
84 The <parameter>direction</parameter> parameter of type
85 <link linkend="ref-enum-comedi-io-direction">enum comedi_io_direction</link>
86 should be set to COMEDI_INPUT to query the input buffer size (e.g., the buffer of an analog
87 input subdevice), or COMEDI_OUTPUT to query the output buffer size (e.g., the buffer of
90 Number of bytes, or -1 on error.
92 Function: comedi_get_routing -- get routing for an output
94 Param: comedi_t * device
95 Param: unsigned int subdevice
96 Param: unsigned int channel
97 Param: unsigned int *routing
100 This function queries the routing for an output, as
102 <link linkend="func-ref-comedi-set-routing">comedi_set_routing()</link>.
103 The currently configured routing
104 will be written to *<parameter>routing</parameter>.
105 The possible values and their corresponding routings are
108 This function is only useable
109 on subdevices that provide support for the INSN_CONFIG_GET_ROUTING
110 configuration instruction.
112 0 on success, -1 on error.
114 Function: comedi_reset -- reset a subdevice
116 Param: comedi_t * device
117 Param: unsigned int subdevice
120 This function resets a subdevice. It is only useable
121 on subdevices that provide support for the INSN_CONFIG_RESET configuration
124 0 on success, -1 on error.
126 Function: comedi_set_clock_source -- set master clock for a subdevice
128 Param: comedi_t * device
129 Param: unsigned int subdevice
130 Param: unsigned int channel
131 Param: unsigned int clock
132 Param: unsigned int period_ns
135 This function selects a master clock for a subdevice. The <parameter>clock</parameter>
136 parameter selects the master clock, and is driver-dependant.
137 If the subdevice does not support configuring its master clocks on a
138 per-channel basis, then the <parameter>channel</parameter> parameter
140 The <parameter>period_ns</parameter>
141 parameter specifies the clock's period in nanoseconds. It may left unspecified by using
142 a value of zero. Drivers will ignore the clock period if they already
143 know what the clock period should be for the specified clock (i.e. for an
144 on-board 20MHz oscillator). Certain boards which use a phase-locked loop to
145 synchronize to external clock sources must be told the frequency of the external
146 clock. Specifying a clock period for an external clock may also allow
147 the driver to support TRIG_TIMER sources in commands while
148 using the external clock.
150 The clock may be queried with the <link linkend="func-ref-comedi-get-clock-source">comedi_get_clock_source()</link>
153 This function is only useable
154 on subdevices that provide support for the INSN_CONFIG_SET_CLOCK_SOURCE
155 configuration instruction.
157 0 on success, -1 on error.
159 Function: comedi_set_counter_mode -- change mode of a counter subdevice
161 Param: comedi_t * device
162 Param: unsigned int subdevice
163 Param: unsigned int channel
164 Param: unsigned int mode
167 This function configures a counter subdevice. The meaning of the
168 <parameter>mode</parameter> parameter is driver-dependent.
169 If the subdevice does not
170 support configuring its mode on a per-channel basis, then the
171 <parameter>channel</parameter>
172 parameter will be ignored.
175 on subdevices that provide support for the INSN_CONFIG_SET_COUNTER_MODE
176 configuration instruction.
178 0 on success, -1 on error.
180 Function: comedi_set_filter -- select a filter for a subdevice
182 Param: comedi_t * device
183 Param: unsigned int subdevice
184 Param: unsigned int channel
185 Param: unsigned int filter
188 This function selects a filter for a subdevice. For instance, a digital
189 input subdevice may provide deglitching filters with varying cutoff frequencies.
190 The filters are used to prevent high-frequency
191 noise from causing unwanted transitions on the digital inputs. This function can
192 tell the hardware which deglitching filter to use, or to use none at all.
194 The <parameter>filter</parameter>
195 parameter selects which of the subdevice's filters to use, and is driver-dependant.
197 This function is only useable
198 on subdevices that provide support for the INSN_CONFIG_FILTER
199 configuration instruction.
201 0 on success, -1 on error.
203 Function: comedi_set_gate_source -- select gate source for a subdevice
205 Param: comedi_t * device
206 Param: unsigned int subdevice
207 Param: unsigned int channel
208 Param: unsigned int gate_index
209 Param: unsigned int gate_source
212 This function selects a gate source for a subdevice. The <parameter>gate_index</parameter>
213 parameter selects which gate is being configured, should the subdevice have
214 multiple gates. It takes a value
215 from 0 to N-1 for a subdevice with N different gates.
216 The <parameter>gate_source</parameter> parameter selects which signal you wish to
218 the gate, and is also driver-dependent. If the subdevice does not
219 support configuring its gates on a per-channel basis, then the
220 <parameter>channel</parameter> parameter will be ignored.
222 You may query the gate source with the <link linkend="func-ref-comedi-get-gate-source">comedi_get_gate_source()</link>
224 This function is only useable
225 on subdevices that provide support for the INSN_CONFIG_SET_GATE_SOURCE
226 configuration instruction.
228 0 on success, -1 on error.
230 Function: comedi_set_other_source -- select source signal for something other than a gate or clock
232 Param: comedi_t * device
233 Param: unsigned int subdevice
234 Param: unsigned int channel
235 Param: unsigned int other
236 Param: unsigned int source
239 This function allows selection of a source signal for something on a subdevice
240 other than a gate (which uses comedi_set_gate_source()) or a clock (which uses
241 comedi_set_clock_source()). The <parameter>other</parameter> parameter selects
242 which "other" we are configuring, and is driver-dependent. The
243 <parameter>source</parameter> selects the source we which to use for the
244 "other". If the subdevice does not
245 support configuring its "other" sources on a per-channel basis, then the
246 <parameter>channel</parameter>
247 parameter will be ignored.
249 As an example, this function is used to select which PFI digital input channels
250 should be used as the A/B/Z signals when running a counter on an NI M-Series board as
251 a quadrature encoder. The <parameter>other</parameter> parameter selects either the A, B,
252 or Z signal, and the <parameter>source</parameter> parameter is used to specify
253 which PFI digital input channel the external A, B, or Z signal is
254 physically connected to.
256 This function is only useable
257 on subdevices that provide support for the INSN_CONFIG_SET_OTHER_SOURCE
258 configuration instruction.
260 0 on success, -1 on error.
262 Function: comedi_set_routing -- select a routing for an output
264 Param: comedi_t * device
265 Param: unsigned int subdevice
266 Param: unsigned int channel
267 Param: unsigned int routing
270 This function configures a mutiplexed output channel which can
271 output a variety of different signals (such as NI's RTSI and PFI lines).
272 The <parameter>routing</parameter>
273 parameter selects which signal should be routed to appear on the
274 selected output channel, and is driver-dependant.
276 The routing may be queried with the
277 <link linkend="func-ref-comedi-get-routing">comedi_get_routing()</link> function.
278 This function is only useable
279 on subdevices that provide support for the INSN_CONFIG_SET_ROUTING
280 configuration instruction.
282 0 on success, -1 on error.