1COMEDI_DIGITAL_TRIGG(3) Comedi reference COMEDI_DIGITAL_TRIGG(3)
2
3
4
6 comedi_digital_trigger_enable_edges - set digital trigger edge
7 detection
8
10 #include <comedilib.h>
11
12 int comedi_digital_trigger_enable_edges(comedi_t * device,
13 unsigned int subdevice,
14 unsigned int trigger_id,
15 unsigned int base_input,
16 unsigned int rising_edge_inputs,
17 unsigned int falling_edge_inputs);
18
20 alpha
21
23 This function enables edge detection for a digital trigger on a
24 subdevice. If the subdevice supports several digital triggers, the
25 trigger_id selects one. The rising_edge_inputs and falling_edge_inputs
26 parameters are bit fields that enable (1) or disable (0) rising and
27 falling edge detection on a set of (up to) 32 inputs. The
28 least-significant bit corresponds to the input specified by the
29 base_input parameter, with subsequent bits corresponding to subsequent
30 inputs.
31
32 Successive calls to this function have an cumulative effect, which
33 allows digital triggers to be set up for more than 32 inputs. There may
34 also be a cumulative effect with calls to
35 comedi_digital_trigger_enable_levels if the digital trigger supports a
36 combination of edge and level triggering. Due to the cumulative effect,
37 it may be necessary to call comedi_digital_trigger_disable to clear the
38 old settings before reconfiguring the digital trigger inputs.
39
40 A digital trigger may support edge detection, level detection, both at
41 different times, or both at the same time. If it supports both but not
42 at the same time, configuring edge triggers will disable any previous
43 level triggers, or vice versa.
44
45 This function is only useable on subdevices that provide support for
46 the INSN_CONFIG_DIGITAL_TRIG configuration instruction, and only if the
47 digital trigger supports edge detection.
48
50 0 on success, -1 on error.
51
53 David Schleef <ds@schleef.org>
54 Author.
55
56 Frank Mori Hess <fmhess@users.sourceforge.net>
57 Author.
58
59 Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be>
60 Author.
61
62 Bernd Porr <tech@linux-usb-daq.co.uk>
63 Author.
64
65 Ian Abbott <abbotti@mev.co.uk>
66 Author.
67
68 Éric Piel <piel@delmic.com>
69 Author.
70
72 Copyright © 1998-2003 David Schleef
73 Copyright © 2001-2003, 2005, 2008 Frank Mori Hess
74 Copyright © 2002-2003 Herman Bruyninckx
75 Copyright © 2012 Bernd Porr
76 Copyright © 2012 Ian Abbott
77 Copyright © 2012, 2015 Éric Piel
78
79 This document is part of Comedilib. In the context of this document,
80 the term "source code" as defined by the license is interpreted as the
81 XML source.
82
83 This library is free software; you can redistribute it and/or modify it
84 under the terms of the GNU Lesser General Public License as published
85 by the Free Software Foundation, version 2.1 of the License.
86
87 This library is distributed in the hope that it will be useful, but
88 WITHOUT ANY WARRANTY; without even the implied warranty of
89 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
90 General Public License for more details.
91
92 You should have received a copy of the GNU Lesser General Public
93 License along with this library; if not, write to the Free Software
94 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
95 USA.
96
97
98
99
100Comedi 05/11/2017 COMEDI_DIGITAL_TRIGG(3)