COMEDI_GET_SUBDEVICE(3) | Comedi reference | COMEDI_GET_SUBDEVICE(3) |
comedi_get_subdevice_flags - properties of subdevice
#include <comedilib.h>
int comedi_get_subdevice_flags(comedi_t * device, unsigned int subdevice);
The function comedi_get_subdevice_flags returns a bitfield describing the capabilities of the specified subdevice subdevice of the Comedi device device. If there is an error, -1 is returned, and the Comedilib error value is set.
Subdevice Flag | Value (hex) | Description |
SDF_BUSY | 0x00000001 | The subdevice is busy performing an asynchronous command. A subdevice being “busy” is slightly different from the “running” state flagged by SDF_RUNNING. A “running” subdevice is always “busy”, but a “busy” subdevice is not necessarily “running”. For example, suppose an analog input command has been completed by the hardware, but there are still samples in Comedi's buffer waiting to be read out. In this case, the subdevice is not “running”, but is still “busy” until all the samples are read out or comedi_cancel is called. |
SDF_BUSY_OWNER | 0x00000002 | The subdevice is “busy”, and the command it is running was started by the current process. |
SDF_LOCKED | 0x00000004 | The subdevice has been locked by comedi_lock. |
SDF_LOCK_OWNER | 0x00000008 | The subdevice is locked, and was locked by the current process. |
SDF_MAXDATA | 0x00000010 | The maximum data value for the subdevice depends on the channel. |
SDF_FLAGS | 0x00000020 | The subdevice flags depend on the channel (unfinished/broken support in library). |
SDF_RANGETYPE | 0x00000040 | The range type depends on the channel. |
SDF_CMD | 0x00001000 | The subdevice supports asynchronous commands. |
SDF_SOFT_CALIBRATED | 0x00002000 | The subdevice relies on the host to do calibration in software. Software calibration coefficients are determined by the comedi_soft_calibrate utility. See the description of the comedi_get_softcal_converter function for more information. |
SDF_READABLE | 0x00010000 | The subdevice can be read (e.g. analog input). |
SDF_WRITABLE | 0x00020000 | The subdevice can be written to (e.g. analog output). |
SDF_INTERNAL | 0x00040000 | The subdevice does not have externally visible lines. |
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. |
David Schleef <ds@schleef.org>
Frank Mori Hess <fmhess@users.sourceforge.net>
Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be>
Bernd Porr <tech@linux-usb-daq.co.uk>
Ian Abbott <abbotti@mev.co.uk>
Éric Piel <piel@delmic.com>
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.
01/31/2023 | Comedi |