1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>struct iio_chan_spec</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Industrial I/O driver developer's guide"><link rel="up" href="iiosubsys.html#iiochannel" title="IIO device channels"><link rel="prev" href="API-iio-device-unregister.html" title="iio_device_unregister"><link rel="next" href="iiobuffer.html" title="Industrial I/O buffers"></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"><span class="phrase">struct iio_chan_spec</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-iio-device-unregister.html">Prev</a> </td><th width="60%" align="center"> IIO device channels </th><td width="20%" align="right"> <a accesskey="n" href="iiobuffer.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-iio-chan-spec"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct iio_chan_spec — 2 specification of a single channel 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> 4struct iio_chan_spec { 5 enum iio_chan_type type; 6 int channel; 7 int channel2; 8 unsigned long address; 9 int scan_index; 10 struct scan_type; 11 long info_mask_separate; 12 long info_mask_shared_by_type; 13 long info_mask_shared_by_dir; 14 long info_mask_shared_by_all; 15 const struct iio_event_spec * event_spec; 16 unsigned int num_event_specs; 17 const struct iio_chan_spec_ext_info * ext_info; 18 const char * extend_name; 19 const char * datasheet_name; 20 unsigned modified:1; 21 unsigned indexed:1; 22 unsigned output:1; 23 unsigned differential:1; 24}; </pre></div><div class="refsect1"><a name="id-1.4.3.17.2.5"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">type</span></dt><dd><p> 25What type of measurement is the channel making. 26 </p></dd><dt><span class="term">channel</span></dt><dd><p> 27What number do we wish to assign the channel. 28 </p></dd><dt><span class="term">channel2</span></dt><dd><p> 29If there is a second number for a differential 30channel then this is it. If modified is set then the 31value here specifies the modifier. 32 </p></dd><dt><span class="term">address</span></dt><dd><p> 33Driver specific identifier. 34 </p></dd><dt><span class="term">scan_index</span></dt><dd><p> 35Monotonic index to give ordering in scans when read 36from a buffer. 37 </p></dd><dt><span class="term">scan_type</span></dt><dd><p> 38Sign: 's' or 'u' to specify signed or unsigned 39 </p></dd><dt><span class="term">info_mask_separate</span></dt><dd><p> 40What information is to be exported that is specific to 41this channel. 42 </p></dd><dt><span class="term">info_mask_shared_by_type</span></dt><dd><p> 43What information is to be exported that is shared 44by all channels of the same type. 45 </p></dd><dt><span class="term">info_mask_shared_by_dir</span></dt><dd><p> 46What information is to be exported that is shared 47by all channels of the same direction. 48 </p></dd><dt><span class="term">info_mask_shared_by_all</span></dt><dd><p> 49What information is to be exported that is shared 50by all channels. 51 </p></dd><dt><span class="term">event_spec</span></dt><dd><p> 52Array of events which should be registered for this 53channel. 54 </p></dd><dt><span class="term">num_event_specs</span></dt><dd><p> 55Size of the event_spec array. 56 </p></dd><dt><span class="term">ext_info</span></dt><dd><p> 57Array of extended info attributes for this channel. 58The array is NULL terminated, the last element should 59have its name field set to NULL. 60 </p></dd><dt><span class="term">extend_name</span></dt><dd><p> 61Allows labeling of channel attributes with an 62informative name. Note this has no effect codes etc, 63unlike modifiers. 64 </p></dd><dt><span class="term">datasheet_name</span></dt><dd><p> 65A name used in in-kernel mapping of channels. It should 66correspond to the first name that the channel is referred 67to by in the datasheet (e.g. IND), or the nearest 68possible compound name (e.g. IND-INC). 69 </p></dd><dt><span class="term">modified</span></dt><dd><p> 70Does a modifier apply to this channel. What these are 71depends on the channel type. Modifier is set in 72channel2. Examples are IIO_MOD_X for axial sensors about 73the 'x' axis. 74 </p></dd><dt><span class="term">indexed</span></dt><dd><p> 75Specify the channel has a numerical index. If not, 76the channel index number will be suppressed for sysfs 77attributes but not for event codes. 78 </p></dd><dt><span class="term">output</span></dt><dd><p> 79Channel is output. 80 </p></dd><dt><span class="term">differential</span></dt><dd><p> 81Channel is differential. 82 </p></dd></dl></div></div><div class="refsect1"><a name="id-1.4.3.17.2.6"></a><h2>realbits</h2><p> 83 Number of valid bits of data 84</p></div><div class="refsect1"><a name="id-1.4.3.17.2.7"></a><h2>storage_bits</h2><p> 85 Realbits + padding 86</p></div><div class="refsect1"><a name="id-1.4.3.17.2.8"></a><h2>shift</h2><p> 87 Shift right by this before masking out 88 realbits. 89</p></div><div class="refsect1"><a name="id-1.4.3.17.2.9"></a><h2>endianness</h2><p> 90 little or big endian 91</p></div><div class="refsect1"><a name="id-1.4.3.17.2.10"></a><h2>repeat</h2><p> 92 Number of times real/storage bits 93 repeats. When the repeat element is 94 more than 1, then the type element in 95 sysfs will show a repeat value. 96 Otherwise, the number of repetitions is 97 omitted. 98</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-iio-device-unregister.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="iiosubsys.html#iiochannel">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="iiobuffer.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">iio_device_unregister</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Industrial I/O buffers </td></tr></table></div></body></html> 99