Xenomai  3.1
channel_range.h
Go to the documentation of this file.
1 
22 #ifndef _COBALT_RTDM_ANALOGY_CHANNEL_RANGE_H
23 #define _COBALT_RTDM_ANALOGY_CHANNEL_RANGE_H
24 
25 #include <rtdm/uapi/analogy.h>
26 
123 /* --- Channel section --- */
124 
134 #define A4L_CHAN_AREF_GROUND 0x1
135 
138 #define A4L_CHAN_AREF_COMMON 0x2
139 
142 #define A4L_CHAN_AREF_DIFF 0x4
143 
146 #define A4L_CHAN_AREF_OTHER 0x8
147 
153 #define A4L_CHAN_GLOBAL 0x10
154 
159 struct a4l_channel {
160  unsigned long flags;
161  unsigned long nb_bits;
162 };
163 
175 #define A4L_CHAN_GLOBAL_CHANDESC 0
176 
179 #define A4L_CHAN_PERCHAN_CHANDESC 1
180 
188  unsigned long mode;
189  unsigned long length;
190  struct a4l_channel chans[];
191 };
192 
196 #define A4L_RNG_GLOBAL 0x8
197 
202 struct a4l_range {
203  long min;
204  long max;
205  unsigned long flags;
206 };
207 
211 #define RANGE(x,y) {(x * A4L_RNG_FACTOR), (y * A4L_RNG_FACTOR), \
212  A4L_RNG_NO_UNIT}
213 
216 #define RANGE_V(x,y) {(x * A4L_RNG_FACTOR),(y * A4L_RNG_FACTOR), \
217  A4L_RNG_VOLT_UNIT}
218 
221 #define RANGE_mA(x,y) {(x * A4L_RNG_FACTOR),(y * A4L_RNG_FACTOR), \
222  A4L_RNG_MAMP_UNIT}
223 
226 #define RANGE_ext(x,y) {(x * A4L_RNG_FACTOR),(y * A4L_RNG_FACTOR), \
227  A4L_RNG_EXT_UNIT}
228 
229 
230 /* Ranges tab descriptor */
231 struct a4l_rngtab {
232  unsigned char length;
233  struct a4l_range rngs[];
234 };
235 
239 #define A4L_RNG_GLOBAL_RNGDESC 0
240 
243 #define A4L_RNG_PERCHAN_RNGDESC 1
244 
245 /* Global ranges descriptor */
246 struct a4l_rngdesc {
247  unsigned char mode;
248  unsigned char length;
249  struct a4l_rngtab *rngtabs[];
250 };
251 
255 #define RNG_GLOBAL(x) { \
256  .mode = A4L_RNG_GLOBAL_RNGDESC, \
257  .length = 1, \
258  .rngtabs = {&(x)}, \
259 }
260 
261 extern struct a4l_rngdesc a4l_range_bipolar10;
262 extern struct a4l_rngdesc a4l_range_bipolar5;
263 extern struct a4l_rngdesc a4l_range_unipolar10;
264 extern struct a4l_rngdesc a4l_range_unipolar5;
265 extern struct a4l_rngdesc a4l_range_unknown;
266 extern struct a4l_rngdesc a4l_range_fake;
267 
268 #define range_digital a4l_range_unipolar5
269 
272 #endif /* !_COBALT_RTDM_ANALOGY_CHANNEL_RANGE_H */
Structure describing some channel&#39;s characteristics.
Definition: channel_range.h:159
struct a4l_channel chans[]
Definition: channel_range.h:190
unsigned long flags
Definition: channel_range.h:205
unsigned long flags
Definition: channel_range.h:160
long max
Definition: channel_range.h:204
unsigned long length
Definition: channel_range.h:189
unsigned long mode
Definition: channel_range.h:188
Structure describing a (unique) range.
Definition: channel_range.h:202
long min
Definition: channel_range.h:203
unsigned long nb_bits
Definition: channel_range.h:161
Structure describing a channels set.
Definition: channel_range.h:187
Analogy for Linux, UAPI bits.