COMEDI_DIGITAL_TRIGG(3)

πŸ’– COMEDI_DIGITAL_TRIGG πŸ’– (Comedi reference, bestie)

okay so we're doing a manpage and it's comedi_digital_trigger_enable_levels from the Comedi reference and honestly? it's giving niche-but-iconic. sit down, grab a lil snack πŸ“, and let's get into it.


✨ NAME ✨

comedi_digital_trigger_enable_levels β€” set digital trigger level detection 🌸

πŸŽ€ SYNOPSIS πŸŽ€

#include <comedilib.h>

int comedi_digital_trigger_enable_levels(comedi_t * device,
                                         unsigned int subdevice,
                                         unsigned int trigger_id,
                                         unsigned int base_input,
                                         unsigned int high_level_inputs,
                                         unsigned int low_level_inputs);

πŸ™ˆ STATUS πŸ™ˆ

alpha. yes bestie, that's the actual status in the original. treating it like it's fully cooked is not the move.


πŸ’œ DESCRIPTION πŸ’œ

so what does this thing actually do? it enables level detection for a digital trigger on a subdevice πŸ’…. literally that's the whole job.

if your subdevice supports several digital triggers, the trigger_id picks which one you're talking about. you're welcome.

now the part where people get confused, so listen up 🫢: high_level_inputs and low_level_inputs are bit fields. each bit tells you whether to enable (1) or disable (0) high and low level detection on a set of up to 32 inputs. the least-significant bit lines up with the input named by the base_input parameter, and then, like, each subsequent bit goes with each subsequent input. in order. no cap.

the cumulative behavior is the plot twist here β€” successive calls to this function have a cumulative effect, which is how you can set up digital triggers for more than 32 inputs. it may also stack cumulatively with calls to comedi_digital_trigger_enable_edges, but only if the digital trigger supports a combination of edge and level triggering. and because of all that stacking, it may be necessary to call comedi_digital_trigger_disable to clear the old settings before you reconfigure the digital trigger inputs. so like… clean your room before you redecorate 🧹✨

a digital trigger may support:

  • edge detection
  • level detection
  • both, at different times
  • both, at the same time

and if it supports both but not at the same time? then configuring level triggers will disable any previous edge triggers, or vice versa. it's giving "you can't have both at once, pick a lane." πŸ‘‘

⚠️ important caveat, don't skip this: this function is only useable on subdevices that provide support for the INSN_CONFIG_DIGITAL_TRIG configuration instruction, and only if the digital trigger supports level detection. if it doesn't, you're out of luck, bestie. 😭

πŸ”₯ RETURN VALUE πŸ”₯

  • 0 on success πŸ’–
  • -1 on error πŸ’€

that's it. that's the whole vibe check.


πŸ‘‘ 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 way that six whole people put their names on this… main character ensemble energy fr fr 🌈

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.

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.


okay that's the whole page, we ate, we left no crumbs. πŸ’– this one came out of the Comedi source, dated 03/20/2026, and it lives at the top as COMEDI_DIGITAL_TRIGG(3) β€” so if you see that header up there, yeah, it's us. bye bestie, go enable some levels πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from