COMEDI_DIGITAL_TRIGG(3)
π comedi_digital_trigger_enable_edges β bestie's guide to digital trigger edge detection
okay so this is a page from the Comedi reference manual, section 3 β COMEDI_DIGITAL_TRIGG(3) β and it's all about making a digital trigger notice when a signal goes up πΌ or down π½. shelf it under "comedi, digital trigger, edge detection, slay". let's get into it β¨
β¨ NAME β¨
comedi_digital_trigger_enable_edges β set digital trigger edge detection. that's the whole vibe. π
πΈ SYNOPSIS πΈ
#include <comedilib.h>
int comedi_digital_trigger_enable_edges(comedi_t * device,
unsigned int subdevice,
unsigned int trigger_id,
unsigned int base_input,
unsigned int rising_edge_inputs,
unsigned int falling_edge_inputs);
π¦ STATUS π¦
alpha β yes bestie, it's giving "still cooking", not "fully baked". π«Ά
π DESCRIPTION π
okay so what does this actually do? it enables edge detection for a digital trigger sitting on a subdevice. π«
if your subdevice has several digital triggers (iconic, honestly), the trigger_id picks which one you're talking about.
then there's rising_edge_inputs and falling_edge_inputs β these are bit fields, and each bit is basically a lil on/off switch: 1 means "yes, detect this edge", 0 means "no, leave it alone". they cover a set of up to 32 inputs. the least-significant bit corresponds to the input you named in base_input, and the bits after it correspond to the inputs after that. so bit 0 β base_input, bit 1 β the next one, etc. simple, periodt. β¨
now here's the tea β β successive calls to this function have a cumulative effect. that's lowkey the whole point: it lets you set up digital triggers for more than 32 inputs, which is genuinely impressive of it. π
there can also be a cumulative effect if you've been calling comedi_digital_trigger_enable_levels, but only if the digital trigger supports a combo of edge and level triggering. and because of all that accumulation, it may be necessary to call comedi_digital_trigger_disable to clear the old settings before you reconfigure the digital trigger inputs. don't skip that step bestie, or you'll be fighting ghosts of triggers past π
so a digital trigger may support:
- edge detection
- level detection
- both at different times
- both at the same time
if it supports both but not at the same time, then configuring edge triggers will disable any previous level triggers. or vice versa. it's giving "one at a time, we're not doing both". π
β οΈ heads up: this function is only useable on subdevices that provide support for the INSN_CONFIG_DIGITAL_TRIG configuration instruction, and only if the digital trigger actually supports edge detection. no support, no service. π
π₯ RETURN VALUE π₯
0β on success π-1β on error π
π AUTHORS π
- David Schleef
<ds@schleef.org>β Author. - Frank Mori Hess
<fmhess@users.sourceforge.net>β Author. - Herman Bruyninckx
<Herman.Bruyninckx@mech.kuleuven.ac.be>β Author. - Bernd Porr
<tech@linux-usb-daq.co.uk>β Author. - Ian Abbott
<abbotti@mev.co.uk>β Author. - Γric Piel
<piel@delmic.com>β Author.
the whole group chat contributed, we love to see it π«Ά
π COPYRIGHT π
Copyright Β© 1998-2003 David Schleef
Copyright Β© 2001-2003, 2005, 2008 Frank Mori Hess
Copyright Β© 2002-2003 Herman Bruyninckx
Copyright Β© 2012 Bernd Porr
Copyright Β© 2012 Ian Abbott
Copyright Β© 2012, 2015 Γric Piel
This document is part of Comedilib. In the context of this document, the term "source code" as defined by the license is interpreted as the XML source. (iykyk π )
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1 of the License.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
π and that's the page bestie!! this was COMEDI_DIGITAL_TRIGG(3) from the Comedi reference, version dated 03/20/2026 β go forth and detect some edges, you absolute main character ππβ¨
π¦ where this page comes from
- ubuntu resolute: libcomedi-dev 0.11.0+5-1.3build6 Β· LGPL-2.1-only
- ubuntu stonking: libcomedi-dev 0.11.0+5-1.3build6 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms