From b3627840ac53e2f018bca13742b8b71e50d528e4 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 17 Jan 2008 17:03:01 +0000 Subject: [PATCH] Added reference entries for new configuration instruction wrappers. --- doc/Makefile.am | 19 +++--- doc/comedilib.sgml | 5 ++ doc/extensions_funcref.txt | 115 +++++++++++++++++++++++++++++++++++++ doc/funcref | 16 ++++++ include/comedilib.h | 2 +- 5 files changed, 149 insertions(+), 8 deletions(-) create mode 100644 doc/extensions_funcref.txt diff --git a/doc/Makefile.am b/doc/Makefile.am index 6fed4b7..b596bc6 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,21 +1,23 @@ SGML = calibration_funcref.sgml command_funcref.sgml dio_funcref.sgml \ - deprecated_funcref.sgml error_funcref.sgml \ + deprecated_funcref.sgml error_funcref.sgml extensions_funcref.sgml \ drivers.sgml funcref.sgml glossary.sgml \ install.sgml intro.sgml other.sgml reference.sgml tutorial.sgml \ driverwriting.sgml comedilib.sgml EXTRA_DIST = $(SGML) calibration_funcref.txt command_funcref.txt dio_funcref.txt \ - deprecated_funcref.txt error_funcref.txt funcref mkref drivers.txt mkdr FAQ \ - comedilib.pdf acq-seq.gif doc_html man + deprecated_funcref.txt error_funcref.txt extensions_funcref.txt \ + funcref mkref drivers.txt mkdr FAQ \ + acq-seq.gif doc_html man BUILT_SOURCES = calibration_funcref.sgml command_funcref.sgml dio_funcref.sgml \ - deprecated_funcref.sgml error_funcref.sgml funcref.sgml drivers.sgml + deprecated_funcref.sgml error_funcref.sgml extensions_funcref.sgml \ + funcref.sgml drivers.sgml if HAVE_DOCBOOK2PDF -pdf_DATA = $(srcdir)/comedilib.pdf +dist_pdf_DATA = comedilib.pdf else -pdf_DATA = +dist_pdf_DATA = endif if HAVE_DOCBOOK2HTML @@ -70,7 +72,7 @@ install_man: uninstall_man: for each in `find $(srcdir)/man/ -name '*.3'`; do $(RM) $(DESTDIR)$(mandir)/man3/`basename $$each` ; done -$(srcdir)/comedilib.pdf: $(SGML) +comedilib.pdf: $(SGML) $(DOCBOOK2PDF) -o $(srcdir) $(srcdir)/comedilib.sgml funcref.sgml: funcref mkref @@ -91,6 +93,9 @@ deprecated_funcref.sgml: deprecated_funcref.txt mkref error_funcref.sgml: error_funcref.txt mkref $(srcdir)/mkref $(srcdir)/error_funcref.txt >$(srcdir)/error_funcref.sgml +extensions_funcref.sgml: extensions_funcref.txt mkref + $(srcdir)/mkref $(srcdir)/extensions_funcref.txt >$(srcdir)/extensions_funcref.sgml + drivers.sgml: drivers.txt mkdr $(srcdir)/mkdr $(srcdir)/drivers.txt >$(srcdir)/drivers.sgml diff --git a/doc/comedilib.sgml b/doc/comedilib.sgml index 70b9258..206a181 100644 --- a/doc/comedilib.sgml +++ b/doc/comedilib.sgml @@ -12,6 +12,7 @@ + Comedi"> @@ -160,6 +161,10 @@ USA. Error Reporting &error-funcref; +
+ Extensions + &extensions-funcref; +
Deprecated &deprecated-funcref; diff --git a/doc/extensions_funcref.txt b/doc/extensions_funcref.txt new file mode 100644 index 0000000..acc3801 --- /dev/null +++ b/doc/extensions_funcref.txt @@ -0,0 +1,115 @@ +Function: comedi_arm -- arm a subdevice +Retval: int +Param: comedi_t * device +Param: unsigned int subdevice +Param: unsigned int source +Status: alpha +Description: + This function arms a subdevice. It may, for example, arm a counter + to begin counting. The source parameter specifies + what source should trigger the subdevice to begin. The possible + sources are driver-dependant. This function is only useable + on subdevices that provide support for the INSN_CONFIG_ARM configuration + instruction. +Returns: + 0 on success, -1 on error. + +Function: comedi_reset -- reset a subdevice +Retval: int +Param: comedi_t * device +Param: unsigned int subdevice +Status: alpha +Description: + This function resets a subdevice. It is only useable + on subdevices that provide support for the INSN_CONFIG_RESET configuration + instruction. +Returns: + 0 on success, -1 on error. + +Function: comedi_set_clock_source -- set master clock for a subdevice +Retval: int +Param: comedi_t * device +Param: unsigned int subdevice +Param: unsigned int clock +Param: unsigned int period_ns +Status: alpha +Description: + This function selects a master clock for a subdevice. The clock + parameter selects the master clock, and is driver-dependant. The period_ns + parameter specifies the clock's period in nanoseconds. It may left unspecified by using + a value of zero. Drivers will ignore the clock period if they already + know what the clock period should be for the specified clock (i.e. for an + on-board 20MHz oscillator). Certain boards which use a phase-locked loop to + synchronize to external clock sources must be told the frequency of the external + clock. Specifying a clock period for an external clock may also allow + the driver to support TRIG_TIMER sources in commands while + using the external clock. + + This function is only useable + on subdevices that provide support for the INSN_CONFIG_SET_CLOCK_SOURCE + configuration instruction. +Returns: + 0 on success, -1 on error. + +Function: comedi_set_counter_mode -- change mode of a counter subdevice +Retval: int +Param: comedi_t * device +Param: unsigned int subdevice +Param: unsigned int mode +Status: alpha +Description: + This function configures a counter subdevice. The meaning of the + mode parameter is driver-dependent. It is only useable + on subdevices that provide support for the INSN_CONFIG_SET_COUNTER_MODE + configuration instruction. +Returns: + 0 on success, -1 on error. + +Function: comedi_set_gate_source -- select gate source for a subdevice +Retval: int +Param: comedi_t * device +Param: unsigned int gate_index +Param: unsigned int gate_source +Status: alpha +Description: + This function selects a gate source for a subdevice. The gate_index + parameter selects which gate is being configured, should the subdevice have + multiple gates. It takes a value + from 0 to N-1 for a subdevice with N different gates. + The gate_source parameter selects which signal you wish to + use as + the gate, and is also driver-dependent. + + This function is only useable + on subdevices that provide support for the INSN_CONFIG_SET_GATE_SOURCE + configuration instruction. +Returns: + 0 on success, -1 on error. + +Function: comedi_set_other_source -- select source signal for something other than a gate or clock +Retval: int +Param: comedi_t * device +Param: unsigned int subdevice +Param: unsigned int other +Param: unsigned int source +Status: alpha +Description: + This function allows selection of a source signal for something on a subdevice + other than a gate (which uses comedi_set_gate_source()) or a clock (which uses + comedi_set_clock_source()). The other parameter selects + which "other" we are configuring, and is driver-dependent. The + source selects the source we which to use for the + "other". + + As an example, this function is used to select which PFI digital input channels + should be used as the A/B/Z signals when running a counter on an NI M-Series board as + a quadrature encoder. The other parameter selects either the A, B, + or Z signal, and the source parameter is used to specify + which PFI digital input channel the external A, B, or Z signal is + physically connected to. + + This function is only useable + on subdevices that provide support for the INSN_CONFIG_SET_OTHER_SOURCE + configuration instruction. +Returns: + 0 on success, -1 on error. diff --git a/doc/funcref b/doc/funcref index b4358fc..2402b96 100644 --- a/doc/funcref +++ b/doc/funcref @@ -459,6 +459,22 @@ Description: to know of the existence of a particular feature, an existence test function should be written and put in the Comedilib source. +Function: comedi_internal_trigger -- generate soft trigger +Retval: int +Param: comedi_t * device +Param: unsigned int subdevice +Param: unsigned int trig_num +Description: + This function sends an INSN_INTTRIG instruction to a subdevice, which causes an internal triggering event. + This event can, for example, trigger a subdevice to start an asynchronous command. + + The trig_num parameter is reserved for future use, and should be set to 0. + It is likely it will be used in the future to support multiple independent internal triggers. + For example, an asynchronous command might be specified for a subdevice + with a start_src of TRIG_INT, and + a start_arg of 5. Then the start event would only be triggered if comedi_internal_trigger() were + called on the subdevice with a trig_num equal to the same value of 5. + Function: comedi_lock -- subdevice reservation Retval: int Param: comedi_t * device diff --git a/include/comedilib.h b/include/comedilib.h index c228532..64241c2 100644 --- a/include/comedilib.h +++ b/include/comedilib.h @@ -273,7 +273,7 @@ lsampl_t comedi_from_physical(double data, /* INSN_CONFIG wrappers */ int comedi_reset(comedi_t *device, unsigned subdevice); -int comedi_arm(comedi_t *device, unsigned subdevice, unsigned target); +int comedi_arm(comedi_t *device, unsigned subdevice, unsigned source); int comedi_set_counter_mode(comedi_t *device, unsigned subdevice, unsigned mode_bits); int comedi_set_clock_source(comedi_t *device, unsigned subdevice, unsigned clock, unsigned period_ns); int comedi_set_gate_source(comedi_t *device, unsigned subdevice, unsigned gate_index, unsigned gate_source); -- 2.26.2