2 Function: comedi_arm -- arm a subdevice
4 Param: comedi_t * device
5 Param: unsigned int subdevice
6 Param: unsigned int source
9 This function arms a subdevice. It may, for example, arm a counter
10 to begin counting. The <parameter class="function">source</parameter>
12 what source should trigger the subdevice to begin. The possible
13 sources are driver-dependant. This function is only useable
14 on subdevices that provide support for the
15 <constant>INSN_CONFIG_ARM</constant> configuration
18 <literal>0</literal> on success, <literal>-1</literal> on error.
20 Function: comedi_get_clock_source -- get master clock for a subdevice
22 Param: comedi_t * device
23 Param: unsigned int subdevice
24 Param: unsigned int channel
25 Param: unsigned int * clock
26 Param: unsigned int * period_ns
29 This function queries the master clock for a subdevice, as
31 <function><link linkend="func-ref-comedi-set-clock-source">comedi_set_clock_source</link></function>.
32 The currently configured master clock
34 <code language="C">*<parameter class="function">clock</parameter></code>.
35 The possible values and their corresponding clocks are
37 The period of the clock in nanoseconds (or zero if it is unknown)
39 <code language="C">*<parameter class="function">period_ns</parameter></code>.
40 If the subdevice does not support configuring its master clocks
41 on a per-channel basis, then the <parameter class="function">channel</parameter>
42 parameter will be ignored.
44 It is safe to pass <constant>NULL</constant> pointers as the
45 <parameter class="function">clock</parameter> or
46 <parameter class="function">period_ns</parameter>
47 parameters. This function is only useable
48 on subdevices that provide support for the
49 <constant>INSN_CONFIG_GET_CLOCK_SOURCE</constant>
50 configuration instruction.
52 <literal>0</literal> on success, <literal>-1</literal> on error.
54 Function: comedi_get_gate_source -- get gate for a subdevice
56 Param: comedi_t * device
57 Param: unsigned int subdevice
58 Param: unsigned int channel
59 Param: unsigned int gate_index
60 Param: unsigned int * gate_source
63 This function queries the gate for a subdevice, as set by
64 <function><link linkend="func-ref-comedi-set-gate-source">comedi_set_gate_source</link></function>.
65 The currently configured gate source
67 <code language="C">*<parameter class="function">gate_source</parameter></code>.
68 The possible values and their corresponding gates are
69 driver-dependant. If the subdevice does not
70 support configuring its gates on a per-channel basis, then the
71 <parameter class="function">channel</parameter> parameter will be ignored.
73 This function is only useable
74 on subdevices that provide support for the
75 <constant>INSN_CONFIG_GET_GATE_SOURCE</constant>
76 configuration instruction.
78 <literal>0</literal> on success, <literal>-1</literal> on error.
80 Function: comedi_get_hardware_buffer_size -- get size of subdevice's hardware buffer
82 Param: comedi_t *device
83 Param: unsigned int subdevice
84 Param: <link linkend="ref-enum-comedi-io-direction">enum comedi_io_direction</link> direction
86 This function returns the number of bytes the subdevice can hold in it's hardware buffer.
87 The term <quote>hardware buffer</quote> refers to any FIFOs, etc. on the acquisition board itself which
88 are used during streaming commands. This does not include the buffer maintained by
89 the comedi kernel module in host memory, whose size may be queried by
91 linkend="func-ref-comedi-get-buffer-size">comedi_get_buffer_size</link></function>.
92 The <parameter class="function">direction</parameter> parameter of type
93 <type><link linkend="ref-enum-comedi-io-direction">enum
94 comedi_io_direction</link></type>
95 should be set to <constant>COMEDI_INPUT</constant> to query the input buffer size (e.g., the buffer of an analog
96 input subdevice), or <constant>COMEDI_OUTPUT</constant> to query the output buffer size (e.g., the buffer of
99 Hardware buffer size in bytes, or <literal>-1</literal> on error.
101 Function: comedi_get_routing -- get routing for an output
103 Param: comedi_t * device
104 Param: unsigned int subdevice
105 Param: unsigned int channel
106 Param: unsigned int * routing
109 This function queries the routing for an output, as
111 <function><link linkend="func-ref-comedi-set-routing">comedi_set_routing</link></function>.
112 The currently configured routing
114 <code language="C">*<parameter class="function">routing</parameter></code>.
115 The possible values and their corresponding routings are
118 This function is only useable
119 on subdevices that provide support for the
120 <constant>INSN_CONFIG_GET_ROUTING</constant>
121 configuration instruction.
123 <literal>0</literal> on success, <literal>-1</literal> on error.
125 Function: comedi_reset -- reset a subdevice
127 Param: comedi_t * device
128 Param: unsigned int subdevice
131 This function resets a subdevice. It is only useable
132 on subdevices that provide support for the
133 <constant>INSN_CONFIG_RESET</constant> configuration
136 <literal>0</literal> on success, <literal>-1</literal> on error.
138 Function: comedi_set_clock_source -- set master clock for a subdevice
140 Param: comedi_t * device
141 Param: unsigned int subdevice
142 Param: unsigned int channel
143 Param: unsigned int clock
144 Param: unsigned int period_ns
147 This function selects a master clock for a subdevice. The <parameter
148 class="function">clock</parameter>
149 parameter selects the master clock, and is driver-dependant.
150 If the subdevice does not support configuring its master clocks on a
151 per-channel basis, then the <parameter class="function">channel</parameter> parameter
153 The <parameter class="function">period_ns</parameter>
154 parameter specifies the clock's period in nanoseconds. It may left unspecified by using
155 a value of zero. Drivers will ignore the clock period if they already
156 know what the clock period should be for the specified clock (e.g. for an
157 on-board 20MHz oscillator). Certain boards which use a phase-locked loop to
158 synchronize to external clock sources must be told the period of the external
159 clock. Specifying a clock period for an external clock may also allow
160 the driver to support <constant>TRIG_TIMER</constant> sources in commands while
161 using the external clock.
163 The clock may be queried with the
164 <function><link linkend="func-ref-comedi-get-clock-source">comedi_get_clock_source</link></function>
167 This function is only useable
168 on subdevices that provide support for the
169 <constant>INSN_CONFIG_SET_CLOCK_SOURCE</constant> configuration instruction.
171 <literal>0</literal> on success, <literal>-1</literal> on error.
173 Function: comedi_set_counter_mode -- change mode of a counter subdevice
175 Param: comedi_t * device
176 Param: unsigned int subdevice
177 Param: unsigned int channel
178 Param: unsigned int mode
181 This function configures a counter subdevice. The meaning of the
182 <parameter class="function">mode</parameter> parameter is driver-dependent.
183 If the subdevice does not
184 support configuring its mode on a per-channel basis, then the
185 <parameter class="function">channel</parameter>
186 parameter will be ignored.
189 on subdevices that provide support for the
190 <constant>INSN_CONFIG_SET_COUNTER_MODE</constant> configuration instruction.
192 <literal>0</literal> on success, <literal>-1</literal> on error.
194 Function: comedi_set_filter -- select a filter for a subdevice
196 Param: comedi_t * device
197 Param: unsigned int subdevice
198 Param: unsigned int channel
199 Param: unsigned int filter
202 This function selects a filter for a subdevice. For instance, a digital
203 input subdevice may provide deglitching filters with varying cutoff frequencies.
204 The filters are used to prevent high-frequency
205 noise from causing unwanted transitions on the digital inputs. This function can
206 tell the hardware which deglitching filter to use, or to use none at all.
208 The <parameter class="function">filter</parameter>
209 parameter selects which of the subdevice's filters to use, and is driver-dependant.
211 This function is only useable
212 on subdevices that provide support for the
213 <constant>INSN_CONFIG_FILTER</constant> configuration instruction.
215 <literal>0</literal> on success, <literal>-1</literal> on error.
217 Function: comedi_set_gate_source -- select gate source for a subdevice
219 Param: comedi_t * device
220 Param: unsigned int subdevice
221 Param: unsigned int channel
222 Param: unsigned int gate_index
223 Param: unsigned int gate_source
226 This function selects a gate source for a subdevice. The
227 <parameter class="function">gate_index</parameter>
228 parameter selects which gate is being configured, should the subdevice have
229 multiple gates. It takes a value
230 from 0 to N-1 for a subdevice with N different gates.
231 The <parameter class="function">gate_source</parameter> parameter selects which signal you wish to
233 the gate, and is also driver-dependent. If the subdevice does not
234 support configuring its gates on a per-channel basis, then the
235 <parameter class="function">channel</parameter> parameter will be ignored.
237 You may query the gate source with the
238 <function><link linkend="func-ref-comedi-get-gate-source">comedi_get_gate_source</link></function>
240 This function is only useable
241 on subdevices that provide support for the
242 <constant>INSN_CONFIG_SET_GATE_SOURCE</constant>
243 configuration instruction.
245 <literal>0</literal> on success, <literal>-1</literal> on error.
247 Function: comedi_set_other_source -- select source signal for something other than a gate or clock
249 Param: comedi_t * device
250 Param: unsigned int subdevice
251 Param: unsigned int channel
252 Param: unsigned int other
253 Param: unsigned int source
256 This function allows selection of a source signal for something on a subdevice
257 other than a gate (which uses
259 linkend="func-ref-comedi-set-gate-source">comedi_set_gate_source</link></function>)
260 or a clock (which uses
262 linkend="func-ref-comedi-set-clock-source">comedi_set_clock_source</link></function>).
263 The <parameter class="function">other</parameter> parameter selects
264 which <quote>other</quote> we are configuring, and is driver-dependent. The
265 <parameter class="function">source</parameter> parameter selects the source
266 we which to use for the <quote>other</quote>. If the subdevice does not
267 support configuring its <quote>other</quote> sources on a per-channel basis,
268 then the <parameter class="function">channel</parameter>
269 parameter will be ignored.
271 As an example, this function is used to select which PFI digital input channels
272 should be used as the A/B/Z signals when running a counter on an NI M-Series board as
273 a quadrature encoder. The <parameter class="function">other</parameter> parameter selects either the A, B,
274 or Z signal, and the <parameter class="function">source</parameter> parameter is used to specify
275 which PFI digital input channel the external A, B, or Z signal is
276 physically connected to.
278 This function is only useable
279 on subdevices that provide support for the
280 <constant>INSN_CONFIG_SET_OTHER_SOURCE</constant>
281 configuration instruction.
283 <literal>0</literal> on success, <literal>-1</literal> on error.
285 Function: comedi_set_routing -- select a routing for an output
287 Param: comedi_t * device
288 Param: unsigned int subdevice
289 Param: unsigned int channel
290 Param: unsigned int routing
293 This function configures a mutiplexed output channel which can
294 output a variety of different signals (such as NI's RTSI and PFI lines).
295 The <parameter class="function">routing</parameter>
296 parameter selects which signal should be routed to appear on the
297 selected output channel, and is driver-dependant.
299 The routing may be queried with the
300 <function><link linkend="func-ref-comedi-get-routing">comedi_get_routing</link></function>
302 This function is only useable
303 on subdevices that provide support for the
304 <constant>INSN_CONFIG_SET_ROUTING</constant>
305 configuration instruction.
307 <literal>0</literal> on success, <literal>-1</literal> on error.