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>source</parameter> parameter specifies
11 what source should trigger the subdevice to begin. The possible
12 sources are driver-dependant. This function is only useable
13 on subdevices that provide support for the INSN_CONFIG_ARM configuration
16 0 on success, -1 on error.
18 Function: comedi_get_clock_source -- get master clock for a subdevice
20 Param: comedi_t * device
21 Param: unsigned int subdevice
22 Param: unsigned int channel
23 Param: unsigned int *clock
24 Param: unsigned int *period_ns
27 This function queries the master clock for a subdevice, as
29 <link linkend="func-ref-comedi-set-clock-source">comedi_set_clock_source()</link>.
30 The currently configured master clock
31 will be written to *<parameter>clock</parameter>.
32 The possible values and their corresponding clocks are
34 The frequency of the clock in nanoseconds (or zero if it is unknown)
36 *<parameter>period_ns</parameter>.
37 If the subdevice does not support configuring its master clocks
38 on a per-channel basis, then the <parameter>channel</parameter>
39 parameter will be ignored.
41 It is safe to pass NULL pointers as the <parameter>clock</parameter> or
42 <parameter>period_ns</parameter>
43 parameters. This function is only useable
44 on subdevices that provide support for the INSN_CONFIG_GET_CLOCK_SOURCE
45 configuration instruction.
47 0 on success, -1 on error.
49 Function: comedi_get_gate_source -- get gate for a subdevice
51 Param: comedi_t * device
52 Param: unsigned int subdevice
53 Param: unsigned int channel
54 Param: unsigned int gate_index
55 Param: unsigned int *gate_source
58 This function queries the gate for a subdevice, as
60 <link linkend="func-ref-comedi-set-gate-source">comedi_set_gate_source()</link>.
61 The currently configured gate source
62 will be written to *<parameter>gate_source</parameter>.
63 The possible values and their corresponding gates are
64 driver-dependant. If the subdevice does not
65 support configuring its gates on a per-channel basis, then the
66 <parameter>channel</parameter> parameter will be ignored.
68 This function is only useable
69 on subdevices that provide support for the INSN_CONFIG_GET_GATE_SOURCE
70 configuration instruction.
72 0 on success, -1 on error.
74 Function: comedi_get_hardware_buffer_size -- get size of subdevice's hardware buffer
76 Param: comedi_t *device
77 Param: unsigned int subdevice
78 Param: <link linkend="ref-enum-comedi-io-direction">enum comedi_io_direction</link> direction
80 This functions returns the number of bytes the subdevice can hold in it's hardware buffer.
81 The term "hardware buffer" refers to any fifos, etc. on the acquisition board itself which
82 are used during streaming commands. This does not include the buffer maintained by
83 the comedi kernel module in host memory, whose size may be queried by
84 <link linkend="func-ref-comedi-get-buffer-size"><function>comedi_get_buffer_size</function></link>.
85 The <parameter>direction</parameter> parameter of type
86 <link linkend="ref-enum-comedi-io-direction">enum comedi_io_direction</link>
87 should be set to COMEDI_INPUT to query the input buffer size (e.g., the buffer of an analog
88 input subdevice), or COMEDI_OUTPUT to query the output buffer size (e.g., the buffer of
91 Number of bytes, or -1 on error.
93 Function: comedi_get_routing -- get routing for an output
95 Param: comedi_t * device
96 Param: unsigned int subdevice
97 Param: unsigned int channel
98 Param: unsigned int *routing
101 This function queries the routing for an output, as
103 <link linkend="func-ref-comedi-set-routing">comedi_set_routing()</link>.
104 The currently configured routing
105 will be written to *<parameter>routing</parameter>.
106 The possible values and their corresponding routings are
109 This function is only useable
110 on subdevices that provide support for the INSN_CONFIG_GET_ROUTING
111 configuration instruction.
113 0 on success, -1 on error.
115 Function: comedi_reset -- reset a subdevice
117 Param: comedi_t * device
118 Param: unsigned int subdevice
121 This function resets a subdevice. It is only useable
122 on subdevices that provide support for the INSN_CONFIG_RESET configuration
125 0 on success, -1 on error.
127 Function: comedi_set_clock_source -- set master clock for a subdevice
129 Param: comedi_t * device
130 Param: unsigned int subdevice
131 Param: unsigned int channel
132 Param: unsigned int clock
133 Param: unsigned int period_ns
136 This function selects a master clock for a subdevice. The <parameter>clock</parameter>
137 parameter selects the master clock, and is driver-dependant.
138 If the subdevice does not support configuring its master clocks on a
139 per-channel basis, then the <parameter>channel</parameter> parameter
141 The <parameter>period_ns</parameter>
142 parameter specifies the clock's period in nanoseconds. It may left unspecified by using
143 a value of zero. Drivers will ignore the clock period if they already
144 know what the clock period should be for the specified clock (i.e. for an
145 on-board 20MHz oscillator). Certain boards which use a phase-locked loop to
146 synchronize to external clock sources must be told the frequency of the external
147 clock. Specifying a clock period for an external clock may also allow
148 the driver to support TRIG_TIMER sources in commands while
149 using the external clock.
151 The clock may be queried with the <link linkend="func-ref-comedi-get-clock-source">comedi_get_clock_source()</link>
154 This function is only useable
155 on subdevices that provide support for the INSN_CONFIG_SET_CLOCK_SOURCE
156 configuration instruction.
158 0 on success, -1 on error.
160 Function: comedi_set_counter_mode -- change mode of a counter subdevice
162 Param: comedi_t * device
163 Param: unsigned int subdevice
164 Param: unsigned int channel
165 Param: unsigned int mode
168 This function configures a counter subdevice. The meaning of the
169 <parameter>mode</parameter> parameter is driver-dependent.
170 If the subdevice does not
171 support configuring its mode on a per-channel basis, then the
172 <parameter>channel</parameter>
173 parameter will be ignored.
176 on subdevices that provide support for the INSN_CONFIG_SET_COUNTER_MODE
177 configuration instruction.
179 0 on success, -1 on error.
181 Function: comedi_set_filter -- select a filter for a subdevice
183 Param: comedi_t * device
184 Param: unsigned int subdevice
185 Param: unsigned int channel
186 Param: unsigned int filter
189 This function selects a filter for a subdevice. For instance, a digital
190 input subdevice may provide deglitching filters with varying cutoff frequencies.
191 The filters are used to prevent high-frequency
192 noise from causing unwanted transitions on the digital inputs. This function can
193 tell the hardware which deglitching filter to use, or to use none at all.
195 The <parameter>filter</parameter>
196 parameter selects which of the subdevice's filters to use, and is driver-dependant.
198 This function is only useable
199 on subdevices that provide support for the INSN_CONFIG_FILTER
200 configuration instruction.
202 0 on success, -1 on error.
204 Function: comedi_set_gate_source -- select gate source for a subdevice
206 Param: comedi_t * device
207 Param: unsigned int subdevice
208 Param: unsigned int channel
209 Param: unsigned int gate_index
210 Param: unsigned int gate_source
213 This function selects a gate source for a subdevice. The <parameter>gate_index</parameter>
214 parameter selects which gate is being configured, should the subdevice have
215 multiple gates. It takes a value
216 from 0 to N-1 for a subdevice with N different gates.
217 The <parameter>gate_source</parameter> parameter selects which signal you wish to
219 the gate, and is also driver-dependent. If the subdevice does not
220 support configuring its gates on a per-channel basis, then the
221 <parameter>channel</parameter> parameter will be ignored.
223 You may query the gate source with the <link linkend="func-ref-comedi-get-gate-source">comedi_get_gate_source()</link>
225 This function is only useable
226 on subdevices that provide support for the INSN_CONFIG_SET_GATE_SOURCE
227 configuration instruction.
229 0 on success, -1 on error.
231 Function: comedi_set_other_source -- select source signal for something other than a gate or clock
233 Param: comedi_t * device
234 Param: unsigned int subdevice
235 Param: unsigned int channel
236 Param: unsigned int other
237 Param: unsigned int source
240 This function allows selection of a source signal for something on a subdevice
241 other than a gate (which uses comedi_set_gate_source()) or a clock (which uses
242 comedi_set_clock_source()). The <parameter>other</parameter> parameter selects
243 which "other" we are configuring, and is driver-dependent. The
244 <parameter>source</parameter> selects the source we which to use for the
245 "other". If the subdevice does not
246 support configuring its "other" sources on a per-channel basis, then the
247 <parameter>channel</parameter>
248 parameter will be ignored.
250 As an example, this function is used to select which PFI digital input channels
251 should be used as the A/B/Z signals when running a counter on an NI M-Series board as
252 a quadrature encoder. The <parameter>other</parameter> parameter selects either the A, B,
253 or Z signal, and the <parameter>source</parameter> parameter is used to specify
254 which PFI digital input channel the external A, B, or Z signal is
255 physically connected to.
257 This function is only useable
258 on subdevices that provide support for the INSN_CONFIG_SET_OTHER_SOURCE
259 configuration instruction.
261 0 on success, -1 on error.
263 Function: comedi_set_routing -- select a routing for an output
265 Param: comedi_t * device
266 Param: unsigned int subdevice
267 Param: unsigned int channel
268 Param: unsigned int routing
271 This function configures a mutiplexed output channel which can
272 output a variety of different signals (such as NI's RTSI and PFI lines).
273 The <parameter>routing</parameter>
274 parameter selects which signal should be routed to appear on the
275 selected output channel, and is driver-dependant.
277 The routing may be queried with the
278 <link linkend="func-ref-comedi-get-routing">comedi_get_routing()</link> function.
279 This function is only useable
280 on subdevices that provide support for the INSN_CONFIG_SET_ROUTING
281 configuration instruction.
283 0 on success, -1 on error.