1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>comedi_get_subdevice_flags</title><link rel="stylesheet" type="text/css" href="comedilib.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Comedi"><link rel="up" href="functionreference.html#idm2224" title="5.4.1. Core Functions"><link rel="prev" href="func-ref-comedi-get-range.html" title="comedi_get_range"><link rel="next" href="func-ref-comedi-get-subdevice-type.html" title="comedi_get_subdevice_type"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">comedi_get_subdevice_flags</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="func-ref-comedi-get-range.html">Prev</a> </td><th width="60%" align="center">5.4.1. Core Functions</th><td width="20%" align="right"> <a accesskey="n" href="func-ref-comedi-get-subdevice-type.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="func-ref-comedi-get-subdevice-flags"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>comedi_get_subdevice_flags — properties of subdevice</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <comedilib.h></pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">comedi_get_subdevice_flags</b>(</code></td><td>comedi_t * <var class="pdparam">device</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">subdevice</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm3014"></a><h2>
Description
</h2><p>
The function <code class="function">comedi_get_subdevice_flags</code>
returns a bitfield describing the capabilities of
the specified subdevice <em class="parameter"><code>subdevice</code></em>
of the Comedi device <em class="parameter"><code>device</code></em>.
If there is an error, <code class="literal">-1</code> is returned,
and the Comedilib error value is set.
</p><p>
</p><div class="informaltable"><table class="informaltable" width="100%" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">Subdevice Flag</th><th align="left">Value (hex)</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><code class="constant">SDF_BUSY</code></td><td align="left"><code class="literal">0x00000001</code></td><td align="left">The subdevice is busy performing an asynchronous command.
A subdevice being <span class="quote">“<span class="quote">busy</span>”</span>
is slightly different from the <span class="quote">“<span class="quote">running</span>”</span> state flagged by
<code class="constant">SDF_RUNNING</code>. A <span class="quote">“<span class="quote">running</span>”</span> subdevice
is always <span class="quote">“<span class="quote">busy</span>”</span>, but a <span class="quote">“<span class="quote">busy</span>”</span> subdevice is
not necessarily <span class="quote">“<span class="quote">running</span>”</span>. 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
<span class="quote">“<span class="quote">running</span>”</span>, but is still <span class="quote">“<span class="quote">busy</span>”</span> until all the
samples are read out or <code class="function"><a class="link" href="func-ref-comedi-cancel.html" title="comedi_cancel">comedi_cancel</a></code> is called.</td></tr><tr><td align="left"><code class="constant">SDF_BUSY_OWNER</code></td><td align="left"><code class="literal">0x00000002</code></td><td align="left">The subdevice is <span class="quote">“<span class="quote">busy</span>”</span>, and the command it is running was started by the current process.</td></tr><tr><td align="left"><code class="constant">SDF_LOCKED</code></td><td align="left"><code class="literal">0x00000004</code></td><td align="left">The subdevice has been locked by <code class="function"><a class="link" href="func-ref-comedi-lock.html" title="comedi_lock">comedi_lock</a></code>.</td></tr><tr><td align="left"><code class="constant">SDF_LOCK_OWNER</code></td><td align="left"><code class="literal">0x00000008</code></td><td align="left">The subdevice is locked, and was locked by the current process.</td></tr><tr><td align="left"><code class="constant">SDF_MAXDATA</code></td><td align="left"><code class="literal">0x00000010</code></td><td align="left">The maximum data value for the subdevice depends on the channel.</td></tr><tr><td align="left"><code class="constant">SDF_FLAGS</code></td><td align="left"><code class="literal">0x00000020</code></td><td align="left">The subdevice flags depend on the channel (unfinished/broken support in library).</td></tr><tr><td align="left"><code class="constant">SDF_RANGETYPE</code></td><td align="left"><code class="literal">0x00000040</code></td><td align="left">The range type depends on the channel.</td></tr><tr><td align="left"><code class="constant">SDF_CMD</code></td><td align="left"><code class="literal">0x00001000</code></td><td align="left">The subdevice supports asynchronous commands.</td></tr><tr><td align="left"><code class="constant">SDF_SOFT_CALIBRATED</code></td><td align="left"><code class="literal">0x00002000</code></td><td align="left">The subdevice relies on the host to do calibration in software.
Software calibration coefficients are determined by the <span class="command"><strong>comedi_soft_calibrate</strong></span>
utility. See the description of the
<code class="function"><a class="link" href="func-ref-comedi-get-softcal-converter.html" title="comedi_get_softcal_converter">comedi_get_softcal_converter</a></code> function
for more information.
</td></tr><tr><td align="left"><code class="constant">SDF_READABLE</code></td><td align="left"><code class="literal">0x00010000</code></td><td align="left">The subdevice can be read (e.g. analog input).</td></tr><tr><td align="left"><code class="constant">SDF_WRITABLE</code></td><td align="left"><code class="literal">0x00020000</code></td><td align="left">The subdevice can be written to (e.g. analog output).</td></tr><tr><td align="left"><code class="constant">SDF_INTERNAL</code></td><td align="left"><code class="literal">0x00040000</code></td><td align="left">The subdevice does not have externally visible lines.</td></tr><tr><td align="left"><code class="constant">SDF_GROUND</code></td><td align="left"><code class="literal">0x00100000</code></td><td align="left">The subdevice supports analog reference <code class="constant">AREF_GROUND</code>.</td></tr><tr><td align="left"><code class="constant">SDF_COMMON</code></td><td align="left"><code class="literal">0x00200000</code></td><td align="left">The subdevice supports analog reference <code class="constant">AREF_COMMON</code>.</td></tr><tr><td align="left"><code class="constant">SDF_DIFF</code></td><td align="left"><code class="literal">0x00400000</code></td><td align="left">The subdevice supports analog reference <code class="constant">AREF_DIFF</code>.</td></tr><tr><td align="left"><code class="constant">SDF_OTHER</code></td><td align="left"><code class="literal">0x00800000</code></td><td align="left">The subdevice supports analog reference <code class="constant">AREF_OTHER</code></td></tr><tr><td align="left"><code class="constant">SDF_DITHER</code></td><td align="left"><code class="literal">0x01000000</code></td><td align="left">The subdevice supports dithering (via the <code class="constant">CR_ALT_FILTER</code> chanspec flag).</td></tr><tr><td align="left"><code class="constant">SDF_DEGLITCH</code></td><td align="left"><code class="literal">0x02000000</code></td><td align="left">The subdevice supports deglitching (via the <code class="constant">CR_ALT_FILTER</code> chanspec flag).</td></tr><tr><td align="left"><code class="constant">SDF_RUNNING</code></td><td align="left"><code class="literal">0x08000000</code></td><td align="left">An asynchronous command is running. You can use this flag to poll for the completion of an
output command.</td></tr><tr><td align="left"><code class="constant">SDF_LSAMPL</code></td><td align="left"><code class="literal">0x10000000</code></td><td align="left">The subdevice uses the 32-bit <span class="type">lsampl_t</span> type instead of
the 16-bit <span class="type">sampl_t</span> for
asynchronous command data.</td></tr><tr><td align="left"><code class="constant">SDF_PACKED</code></td><td align="left"><code class="literal">0x20000000</code></td><td align="left">The subdevice uses bitfield samples for asynchronous command data,
one bit per channel (otherwise it uses
one <span class="type">sampl_t</span> or <span class="type">lsampl_t</span> per channel).
Commonly used for digital subdevices.</td></tr></tbody></table></div><p>
</p><p>
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="func-ref-comedi-get-range.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="functionreference.html#idm2224">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="func-ref-comedi-get-subdevice-type.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">comedi_get_range </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> comedi_get_subdevice_type</td></tr></table></div></body></html>
|