Xenomai API  2.5.6.1
include/analogy/command.h
Go to the documentation of this file.
00001 
00023 #ifndef __ANALOGY_CMD__
00024 #define __ANALOGY_CMD__
00025 
00026 #include <analogy/context.h>
00027 
00042 #define A4L_CMD_SIMUL 0x1
00043 
00046 #define A4L_CMD_BULK 0x2
00047 
00050 #define A4L_CMD_WRITE 0x4
00051 
00063 #define TRIG_NONE       0x00000001
00064 
00067 #define TRIG_NOW        0x00000002
00068 
00071 #define TRIG_FOLLOW     0x00000004
00072 
00075 #define TRIG_TIME       0x00000008
00076 
00079 #define TRIG_TIMER      0x00000010
00080 
00083 #define TRIG_COUNT      0x00000020
00084 
00087 #define TRIG_EXT        0x00000040
00088 
00091 #define TRIG_INT        0x00000080
00092 
00095 #define TRIG_OTHER      0x00000100
00096 
00099 #define TRIG_WAKE_EOS   0x0020
00100 
00103 #define TRIG_ROUND_MASK 0x00030000
00104 
00107 #define TRIG_ROUND_NEAREST 0x00000000
00108 
00111 #define TRIG_ROUND_DOWN 0x00010000
00112 
00115 #define TRIG_ROUND_UP 0x00020000
00116 
00119 #define TRIG_ROUND_UP_NEXT 0x00030000
00120 
00133 #define CHAN(a) ((a) & 0xffff)
00134 
00137 #define RNG(a) (((a) & 0xff) << 16)
00138 
00141 #define AREF(a) (((a) & 0xf) << 24)
00142 
00145 #define FLAGS(a) ((a) & CR_FLAGS_MASK)
00146 
00149 #define PACK(a, b, c) (CHAN(a) | RNG(b) | AREF(c))
00150 
00153 #define PACK_FLAGS(a, b, c, d) (CHAN(a) | RNG(b) | AREF(c) | FLAGS(d))
00154 
00158 #define AREF_GROUND 0x00
00159 
00162 #define AREF_COMMON 0x01
00163 
00166 #define AREF_DIFF 0x02
00167 
00170 #define AREF_OTHER 0x03
00171 
00174 #if !defined(DOXYGEN_CPP)
00175 
00176 #define CR_FLAGS_MASK 0xfc000000
00177 #define CR_ALT_FILTER (1<<26)
00178 #define CR_DITHER CR_ALT_FILTER
00179 #define CR_DEGLITCH CR_ALT_FILTER
00180 #define CR_ALT_SOURCE (1<<27)
00181 #define CR_EDGE (1<<28)
00182 #define CR_INVERT (1<<29)
00183 
00184 #if defined(__KERNEL__)
00185 /* Channels macros only useful for the kernel side */
00186 #define CR_CHAN(a) CHAN(a)
00187 #define CR_RNG(a) (((a)>>16)&0xff)
00188 #define CR_AREF(a) (((a)>>24)&0xf)
00189 #endif /* __KERNEL__ */
00190 
00191 #endif /* !DOXYGEN_CPP */
00192 
00198 struct a4l_cmd_desc {
00199         unsigned char idx_subd;
00202         unsigned long flags;
00205         /* Command trigger characteristics */
00206         unsigned int start_src;
00208         unsigned int start_arg;
00210         unsigned int scan_begin_src;
00212         unsigned int scan_begin_arg;
00214         unsigned int convert_src;
00216         unsigned int convert_arg;
00218         unsigned int scan_end_src;
00220         unsigned int scan_end_arg;
00222         unsigned int stop_src;
00224         unsigned int stop_arg;
00227         unsigned char nb_chan;
00229         unsigned int *chan_descs;
00232         /* Driver specific fields */
00233         unsigned int data_len;
00235         sampl_t *data;
00237 };
00238 typedef struct a4l_cmd_desc a4l_cmd_t;
00239 
00242 #if defined(__KERNEL__) && !defined(DOXYGEN_CPP)
00243 
00244 /* --- Command related function --- */
00245 void a4l_free_cmddesc(a4l_cmd_t * desc);
00246 
00247 /* --- Upper layer functions --- */
00248 int a4l_check_cmddesc(a4l_cxt_t * cxt, a4l_cmd_t * desc);
00249 int a4l_ioctl_cmd(a4l_cxt_t * cxt, void *arg);
00250 
00251 #endif /* __KERNEL__ && !DOXYGEN_CPP */
00252 
00253 #endif /* __ANALOGY_CMD__ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines