COMEDI_DIO_READ(3)

✨ COMEDI_DIO_READ(3) ✨ β€” it's giving one single bit πŸŽ€

okay bestie, sit DOWN πŸ’… this one lives in the Comedi reference manual, section 3 β€” the one where we read hardware, but make it tiny.


🌸 NAME 🌸

comedi_dio_read β€” read a single bit from a digital channel πŸ¦‹

like, one (1) bit. the smallest lil guy. πŸ“


✨ SYNOPSIS ✨

#include <comedilib.h>

int comedi_dio_read(comedi_t * device, unsigned int subdevice,
                    unsigned int channel, unsigned int * bit);

πŸ’– DESCRIPTION πŸ’–

ok so real talk β€” comedi_dio_read goes and reads the channel called channel, which belongs to the subdevice subdevice, on the device device. 🫢

the data value it pulls back gets stored in *bit. that's it, that's the whole plot. πŸ™ˆ

and guess what β€” this function is literally equivalent to this:

comedi_data_read(device, subdevice, channel, 0, 0, bit);

no cap. same thing.

now for the plot twist that makes her so iconic: she does not require a digital subdevice, and she does not require a subdevice whose max data value is 1 β€” she just works anyway. πŸ’…βœ¨

and if you're out here wanting to read a bunch of digital channels at once? bestie, be more efficient and use comedi_dio_bitfield2 instead of calling this function over and over and over. πŸ”₯ your CPU will thank you.

πŸ‘‘ RETURN VALUE πŸ‘‘

return values and errors?? same as comedi_data_read, periodt. ⭐ (so go read that one, iykyk)


πŸ’œ AUTHORS πŸ’œ

the legends who made this happen, no cap 🌈

  • 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 legal lore, bestie, read it carefully πŸ’€

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. 😭 (yes, the caps are required, that's just how licenses scream.)

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. πŸ“¬


ok that's the whole vibe check, bestie πŸ§šπŸ’– this was Comedi, dated 03/20/2026, and you have absolutely ate this manpage. slay, go read your bits. πŸŒŸπŸ’…

πŸ“¦ where this page comes from