COMEDI_GET_SUBDEVICE(3)

COMEDI_GET_SUBDEVICE ๐Ÿ’…โœจ

okay so bestie, welcome to Comedi reference, section 3 of the manual pages ๐ŸŽ€ this one is all about comedi_get_subdevice_flags, and honestly? she's a baddie. let's get into it ๐Ÿฆ‹


โœจ NAME โœจ

comedi_get_subdevice_flags โ€” properties of subdevice ๐Ÿ‘‘


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <comedilib.h>

int comedi_get_subdevice_flags(comedi_t * device,
                               unsigned int subdevice);

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so like, the function comedi_get_subdevice_flags returns a bitfield that describes the capabilities of the subdevice you asked about โ€” and yes, that's the one you passed in as subdevice, belonging to the Comedi device device ๐Ÿ’ซ it's literally telling you what your subdevice can and can't do, no cap.

and if something goes wrong? the function returns -1, and the Comedilib error value gets set ๐Ÿ˜ญ so like. always check, bestie. stress. ๐Ÿซถ


more parts coming, don't go anywhere ๐ŸŒˆ

  • SDF_BUSY (0x00000001) โ€” bestie the subdevice is busy rn, like it's out here mid-asynchronous-command and can't talk. โš ๏ธ and here's the thing: being "busy" is not the same as being "running" (that's the SDF_RUNNING state, iykyk). A "running" subdevice is always "busy", but a "busy" one is not necessarily "running". Picture it: an analog input command already got finished by the hardware, but there are still samples sitting in Comedi's buffer waiting to be read out. So in that moment the subdevice is not "running" โ€” but it's 100% still "busy" until either all those samples get read out, or somebody calls comedi_cancel. periodt.
  • SDF_BUSY_OWNER (0x00000002) โ€” the subdevice is "busy" and the command it's running was started by the current process. it's giving main character energy: you did this, bestie ๐Ÿ’…
  • SDF_LOCKED (0x00000004) โ€” this subdevice has been locked by comedi_lock. no cap.
  • SDF_LOCK_OWNER (0x00000008) โ€” the subdevice is locked, and the current process is the one who locked it. ๐Ÿ‘‘
  • SDF_MAXDATA (0x00000010) โ€” the maximum data value for this subdevice depends on the channel.
  • SDF_FLAGS (0x00000020) โ€” the subdevice flags depend on the channel. (note: this is unfinished/broken support in the library ๐Ÿ™ˆ fair warning.)
  • SDF_RANGETYPE (0x00000040) โ€” the range type depends on the channel.
  • SDF_CMD (0x00001000) โ€” slay, this subdevice supports asynchronous commands โœจ
  • SDF_SOFT_CALIBRATED (0x00002000) โ€” this subdevice relies on the host to do the calibration in software. ๐Ÿงฎ the software calibration coefficients are determined by the comedi_soft_calibrate utility. for the full tea, go read the description of the comedi_get_softcal_converter function.
  • SDF_READABLE (0x00010000) โ€” the subdevice can be read (e.g. analog input).
  • SDF_WRITABLE (0x00020000) โ€” you can write to this subdevice (e.g. analog output).
  • SDF_INTERNAL (0x00040000) โ€” this subdevice does not have externally visible lines. it's shy. ๐Ÿซฃ
  • SDF_GROUND (0x00100000) โ€” the subdevice supports analog reference AREF_GROUND. ๐ŸŒˆ
  • SDF_COMMON (0x00200000) โ€” the subdevice supports analog reference AREF_COMMON.
  • SDF_DIFF (0x00400000) โ€” the subdevice supports analog reference AREF_DIFF.
  • SDF_OTHER (0x00800000) โ€” the subdevice supports analog reference AREF_OTHER. ๐Ÿฆ‹
  • SDF_DITHER โ€” 0x01000000 โ€” the subdevice supports dithering (via the CR_ALT_FILTER chanspec flag). โœจ
  • SDF_DEGLITCH โ€” 0x02000000 โ€” the subdevice supports deglitching (via the CR_ALT_FILTER chanspec flag). ๐Ÿ’…
  • SDF_RUNNING โ€” 0x08000000 โ€” an asynchronous command is running. You can use this flag to poll for the completion of an output command. ๐Ÿ”ฅ
  • SDF_LSAMPL โ€” 0x10000000 โ€” the subdevice uses the 32-bit lsampl_t type instead of the 16-bit sampl_t for asynchronous command data. ๐Ÿงš
  • SDF_PACKED โ€” 0x20000000 โ€” the subdevice uses bitfield samples for asynchronous command data, one bit per channel (otherwise it uses one sampl_t or lsampl_t per channel). Commonly used for digital subdevices. ๐Ÿ‘‘

โœจ AUTHORS โœจ

Giving credit where itโ€™s due, because these icons built the thing:

  • 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. ๐Ÿ’–

Legal moment, bestie, but make it cute:

  • 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 bestie, that's the whole COMEDI_GET_SUBDEVICE(3) page. Source/version: Comedi, date: 03/20/2026. Stay iconic, mwah ๐Ÿ’‹โœจ

๐Ÿ“ฆ where this page comes from