Add `chanlist_len` to `comedi_get_cmd_generic_timed()` calls in Python demos.
[comedilib.git] / doc / extensions_funcref.txt
1 Function: comedi_arm -- arm a subdevice
2 Retval: int
3 Param: comedi_t * device
4 Param: unsigned int subdevice
5 Param: unsigned int source
6 Status: alpha
7 Description:
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
13  instruction.
14 Returns:
15  0 on success, -1 on error.
16
17 Function: comedi_get_clock_source -- get master clock for a subdevice
18 Retval: int
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
24 Status: alpha
25 Description:
26  This function queries the master clock for a subdevice, as
27  set by
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
32  driver-dependant.
33  The frequency of the clock in nanoseconds (or zero if it is unknown)
34  will be written to
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.
39
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.
45 Returns:
46  0 on success, -1 on error.
47
48 Function: comedi_get_gate_source -- get gate for a subdevice
49 Retval: int
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
55 Status: alpha
56 Description:
57  This function queries the gate for a subdevice, as
58  set by
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.
66
67  This function is only useable
68  on subdevices that provide support for the INSN_CONFIG_GET_GATE_SOURCE
69  configuration instruction.
70 Returns:
71  0 on success, -1 on error.
72
73 Function: comedi_get_hardware_buffer_size -- get size of subdevice's hardware buffer
74 Retval: int
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
78 Description:
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
88         an analog output).
89 Returns:
90         Number of bytes, or -1 on error.
91
92 Function: comedi_get_routing -- get routing for an output
93 Retval: int
94 Param: comedi_t * device
95 Param: unsigned int subdevice
96 Param: unsigned int channel
97 Param: unsigned int *routing
98 Status: alpha
99 Description:
100  This function queries the routing for an output, as
101  set by
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
106  driver-dependant.
107
108  This function is only useable
109  on subdevices that provide support for the INSN_CONFIG_GET_ROUTING
110  configuration instruction.
111 Returns:
112  0 on success, -1 on error.
113
114 Function: comedi_reset -- reset a subdevice
115 Retval: int
116 Param: comedi_t * device
117 Param: unsigned int subdevice
118 Status: alpha
119 Description:
120  This function resets a subdevice.  It is only useable
121  on subdevices that provide support for the INSN_CONFIG_RESET configuration
122  instruction.
123 Returns:
124  0 on success, -1 on error.
125
126 Function: comedi_set_clock_source -- set master clock for a subdevice
127 Retval: int
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
133 Status: alpha
134 Description:
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
139  will be ignored.
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.
149
150  The clock may be queried with the <link linkend="func-ref-comedi-get-clock-source">comedi_get_clock_source()</link>
151  function.
152
153  This function is only useable
154  on subdevices that provide support for the INSN_CONFIG_SET_CLOCK_SOURCE
155  configuration instruction.
156 Returns:
157  0 on success, -1 on error.
158
159 Function: comedi_set_counter_mode -- change mode of a counter subdevice
160 Retval: int
161 Param: comedi_t * device
162 Param: unsigned int subdevice
163 Param: unsigned int channel
164 Param: unsigned int mode
165 Status: alpha
166 Description:
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.
173
174  It is only useable
175  on subdevices that provide support for the INSN_CONFIG_SET_COUNTER_MODE
176  configuration instruction.
177 Returns:
178  0 on success, -1 on error.
179
180 Function: comedi_set_filter -- select a filter for a subdevice
181 Retval: int
182 Param: comedi_t * device
183 Param: unsigned int subdevice
184 Param: unsigned int channel
185 Param: unsigned int filter
186 Status: alpha
187 Description:
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.
193
194  The <parameter>filter</parameter>
195  parameter selects which of the subdevice's filters to use, and is driver-dependant.
196
197  This function is only useable
198  on subdevices that provide support for the INSN_CONFIG_FILTER
199  configuration instruction.
200 Returns:
201  0 on success, -1 on error.
202
203 Function: comedi_set_gate_source -- select gate source for a subdevice
204 Retval: int
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
210 Status: alpha
211 Description:
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
217  use as
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.
221
222  You may query the gate source with the <link linkend="func-ref-comedi-get-gate-source">comedi_get_gate_source()</link>
223  function.
224  This function is only useable
225  on subdevices that provide support for the INSN_CONFIG_SET_GATE_SOURCE
226  configuration instruction.
227 Returns:
228  0 on success, -1 on error.
229
230 Function: comedi_set_other_source -- select source signal for something other than a gate or clock
231 Retval: int
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
237 Status: alpha
238 Description:
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.
248
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.
255
256  This function is only useable
257  on subdevices that provide support for the INSN_CONFIG_SET_OTHER_SOURCE
258  configuration instruction.
259 Returns:
260  0 on success, -1 on error.
261
262 Function: comedi_set_routing -- select a routing for an output
263 Retval: int
264 Param: comedi_t * device
265 Param: unsigned int subdevice
266 Param: unsigned int channel
267 Param: unsigned int routing
268 Status: alpha
269 Description:
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.
275
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.
281 Returns:
282  0 on success, -1 on error.