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 theSDF_RUNNINGstate, 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 callscomedi_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 bycomedi_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 thecomedi_soft_calibrateutility. for the full tea, go read the description of thecomedi_get_softcal_converterfunction.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 referenceAREF_GROUND. ๐SDF_COMMON(0x00200000) โ the subdevice supports analog referenceAREF_COMMON.SDF_DIFF(0x00400000) โ the subdevice supports analog referenceAREF_DIFF.SDF_OTHER(0x00800000) โ the subdevice supports analog referenceAREF_OTHER. ๐ฆSDF_DITHERโ0x01000000โ the subdevice supports dithering (via theCR_ALT_FILTERchanspec flag). โจSDF_DEGLITCHโ0x02000000โ the subdevice supports deglitching (via theCR_ALT_FILTERchanspec 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-bitlsampl_ttype instead of the 16-bitsampl_tfor asynchronous command data. ๐งSDF_PACKEDโ0x20000000โ the subdevice uses bitfield samples for asynchronous command data, one bit per channel (otherwise it uses onesampl_torlsampl_tper 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. ๐
๐ธ COPYRIGHT ๐ธ
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
- 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