21 #ifndef _RTDM_UAPI_ANALOGY_H 22 #define _RTDM_UAPI_ANALOGY_H 25 #define A4L_NAMELEN 20 27 #define A4L_INFINITE 0 28 #define A4L_NONBLOCK (-1) 32 typedef unsigned short sampl_t;
33 typedef unsigned long lsampl_t;
37 unsigned int idx_subd;
41 typedef struct a4l_mmap_arg a4l_mmap_t;
45 #define A4L_BUF_MAXSIZE 0x1000000 46 #define A4L_BUF_DEFSIZE 0x10000 47 #define A4L_BUF_DEFMAGIC 0xffaaff55 50 struct a4l_buffer_config {
58 unsigned int idx_subd;
59 unsigned long buf_size;
61 typedef struct a4l_buffer_config a4l_bufcfg_t;
64 struct a4l_buffer_info {
65 unsigned int idx_subd;
66 unsigned long buf_size;
67 unsigned long rw_count;
69 typedef struct a4l_buffer_info a4l_bufinfo_t;
72 struct a4l_buffer_config2 {
73 unsigned long wake_count;
74 unsigned long reserved[3];
76 typedef struct a4l_buffer_config2 a4l_bufcfg2_t;
80 unsigned int idx_subd;
86 struct a4l_link_desc {
87 unsigned char bname_size;
89 unsigned int opts_size;
92 typedef struct a4l_link_desc a4l_lnkdesc_t;
96 char board_name[A4L_NAMELEN];
97 char driver_name[A4L_NAMELEN];
102 typedef struct a4l_dev_info a4l_dvinfo_t;
105 #define A4L_DEVCFG _IOW(CIO,0,a4l_lnkdesc_t) 106 #define A4L_DEVINFO _IOR(CIO,1,a4l_dvinfo_t) 107 #define A4L_SUBDINFO _IOR(CIO,2,a4l_sbinfo_t) 108 #define A4L_CHANINFO _IOR(CIO,3,a4l_chinfo_arg_t) 109 #define A4L_RNGINFO _IOR(CIO,4,a4l_rnginfo_arg_t) 110 #define A4L_CMD _IOWR(CIO,5,a4l_cmd_t) 111 #define A4L_CANCEL _IOR(CIO,6,unsigned int) 112 #define A4L_INSNLIST _IOR(CIO,7,unsigned int) 113 #define A4L_INSN _IOR(CIO,8,unsigned int) 114 #define A4L_BUFCFG _IOR(CIO,9,a4l_bufcfg_t) 115 #define A4L_BUFINFO _IOWR(CIO,10,a4l_bufinfo_t) 116 #define A4L_POLL _IOR(CIO,11,unsigned int) 117 #define A4L_MMAP _IOWR(CIO,12,unsigned int) 118 #define A4L_NBCHANINFO _IOR(CIO,13,a4l_chinfo_arg_t) 119 #define A4L_NBRNGINFO _IOR(CIO,14,a4l_rnginfo_arg_t) 123 #define A4L_BUFCFG2 _IOR(CIO,15,a4l_bufcfg_t) 124 #define A4L_BUFINFO2 _IOWR(CIO,16,a4l_bufcfg_t) 140 #define A4L_CMD_SIMUL 0x1 144 #define A4L_CMD_BULK 0x2 148 #define A4L_CMD_WRITE 0x4 161 #define TRIG_NONE 0x00000001 165 #define TRIG_NOW 0x00000002 169 #define TRIG_FOLLOW 0x00000004 173 #define TRIG_TIME 0x00000008 177 #define TRIG_TIMER 0x00000010 181 #define TRIG_COUNT 0x00000020 185 #define TRIG_EXT 0x00000040 189 #define TRIG_INT 0x00000080 193 #define TRIG_OTHER 0x00000100 197 #define TRIG_WAKE_EOS 0x0020 201 #define TRIG_ROUND_MASK 0x00030000 205 #define TRIG_ROUND_NEAREST 0x00000000 209 #define TRIG_ROUND_DOWN 0x00010000 213 #define TRIG_ROUND_UP 0x00020000 217 #define TRIG_ROUND_UP_NEXT 0x00030000 231 #define CHAN(a) ((a) & 0xffff) 235 #define RNG(a) (((a) & 0xff) << 16) 239 #define AREF(a) (((a) & 0x03) << 24) 243 #define FLAGS(a) ((a) & CR_FLAGS_MASK) 247 #define PACK(a, b, c) (a | RNG(b) | AREF(c)) 251 #define PACK_FLAGS(a, b, c, d) (PACK(a, b, c) | FLAGS(d)) 256 #define AREF_GROUND 0x00 260 #define AREF_COMMON 0x01 264 #define AREF_DIFF 0x02 268 #define AREF_OTHER 0x03 272 #if !defined(DOXYGEN_CPP) 274 #define CR_FLAGS_MASK 0xfc000000 275 #define CR_ALT_FILTER (1<<26) 276 #define CR_DITHER CR_ALT_FILTER 277 #define CR_DEGLITCH CR_ALT_FILTER 278 #define CR_ALT_SOURCE (1<<27) 279 #define CR_EDGE (1<<30) 280 #define CR_INVERT (1<<31) 324 unsigned int valid_simul_stages;
340 #define A4L_RNG_FACTOR 1000000 345 #define A4L_RNG_VOLT_UNIT 0x0 349 #define A4L_RNG_MAMP_UNIT 0x1 353 #define A4L_RNG_NO_UNIT 0x2 357 #define A4L_RNG_EXT_UNIT 0x4 362 #define A4L_RNG_UNIT(x) (x & (A4L_RNG_VOLT_UNIT | \ 363 A4L_RNG_MAMP_UNIT | \ 373 #define A4L_SUBD_MASK_READ 0x80000000 374 #define A4L_SUBD_MASK_WRITE 0x40000000 375 #define A4L_SUBD_MASK_SPECIAL 0x20000000 391 #define A4L_SUBD_UNUSED (A4L_SUBD_MASK_SPECIAL|0x1) 395 #define A4L_SUBD_AI (A4L_SUBD_MASK_READ|0x2) 399 #define A4L_SUBD_AO (A4L_SUBD_MASK_WRITE|0x4) 403 #define A4L_SUBD_DI (A4L_SUBD_MASK_READ|0x8) 407 #define A4L_SUBD_DO (A4L_SUBD_MASK_WRITE|0x10) 411 #define A4L_SUBD_DIO (A4L_SUBD_MASK_SPECIAL|0x20) 415 #define A4L_SUBD_COUNTER (A4L_SUBD_MASK_SPECIAL|0x40) 419 #define A4L_SUBD_TIMER (A4L_SUBD_MASK_SPECIAL|0x80) 423 #define A4L_SUBD_MEMORY (A4L_SUBD_MASK_SPECIAL|0x100) 427 #define A4L_SUBD_CALIB (A4L_SUBD_MASK_SPECIAL|0x200) 431 #define A4L_SUBD_PROC (A4L_SUBD_MASK_SPECIAL|0x400) 435 #define A4L_SUBD_SERIAL (A4L_SUBD_MASK_SPECIAL|0x800) 439 #define A4L_SUBD_TYPES (A4L_SUBD_UNUSED | \ 465 #define A4L_SUBD_CMD 0x1000 471 #define A4L_SUBD_MMAP 0x8000 486 #define A4L_SUBD_BUSY_NR 0 487 #define A4L_SUBD_BUSY (1 << A4L_SUBD_BUSY_NR) 493 #define A4L_SUBD_CLEAN_NR 1 494 #define A4L_SUBD_CLEAN (1 << A4L_SUBD_CLEAN_NR) 502 struct a4l_subd_info {
504 unsigned long status;
505 unsigned char nb_chan;
507 typedef struct a4l_subd_info a4l_sbinfo_t;
510 struct a4l_chan_info {
511 unsigned long chan_flags;
512 unsigned char nb_rng;
513 unsigned char nb_bits;
515 typedef struct a4l_chan_info a4l_chinfo_t;
517 struct a4l_chinfo_arg {
518 unsigned int idx_subd;
521 typedef struct a4l_chinfo_arg a4l_chinfo_arg_t;
524 struct a4l_rng_info {
529 typedef struct a4l_rng_info a4l_rnginfo_t;
531 struct a4l_rng_info_arg {
532 unsigned int idx_subd;
533 unsigned int idx_chan;
536 typedef struct a4l_rng_info_arg a4l_rnginfo_arg_t;
540 #define A4L_INSN_MASK_READ 0x8000000 541 #define A4L_INSN_MASK_WRITE 0x4000000 542 #define A4L_INSN_MASK_SPECIAL 0x2000000 558 #define A4L_INSN_READ (0 | A4L_INSN_MASK_READ) 562 #define A4L_INSN_WRITE (1 | A4L_INSN_MASK_WRITE) 566 #define A4L_INSN_BITS (2 | A4L_INSN_MASK_READ | \ 571 #define A4L_INSN_CONFIG (3 | A4L_INSN_MASK_READ | \ 576 #define A4L_INSN_GTOD (4 | A4L_INSN_MASK_READ | \ 577 A4L_INSN_MASK_SPECIAL) 581 #define A4L_INSN_WAIT (5 | A4L_INSN_MASK_WRITE | \ 582 A4L_INSN_MASK_SPECIAL) 586 #define A4L_INSN_INTTRIG (6 | A4L_INSN_MASK_WRITE | \ 587 A4L_INSN_MASK_SPECIAL) 594 #define A4L_INSN_WAIT_MAX 100000 602 #define A4L_INSN_CONFIG_DIO_INPUT 0 603 #define A4L_INSN_CONFIG_DIO_OUTPUT 1 604 #define A4L_INSN_CONFIG_DIO_OPENDRAIN 2 605 #define A4L_INSN_CONFIG_ANALOG_TRIG 16 606 #define A4L_INSN_CONFIG_ALT_SOURCE 20 607 #define A4L_INSN_CONFIG_DIGITAL_TRIG 21 608 #define A4L_INSN_CONFIG_BLOCK_SIZE 22 609 #define A4L_INSN_CONFIG_TIMER_1 23 610 #define A4L_INSN_CONFIG_FILTER 24 611 #define A4L_INSN_CONFIG_CHANGE_NOTIFY 25 612 #define A4L_INSN_CONFIG_SERIAL_CLOCK 26 613 #define A4L_INSN_CONFIG_BIDIRECTIONAL_DATA 27 614 #define A4L_INSN_CONFIG_DIO_QUERY 28 615 #define A4L_INSN_CONFIG_PWM_OUTPUT 29 616 #define A4L_INSN_CONFIG_GET_PWM_OUTPUT 30 617 #define A4L_INSN_CONFIG_ARM 31 618 #define A4L_INSN_CONFIG_DISARM 32 619 #define A4L_INSN_CONFIG_GET_COUNTER_STATUS 33 620 #define A4L_INSN_CONFIG_RESET 34 621 #define A4L_INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR 1001 622 #define A4L_INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR 1002 623 #define A4L_INSN_CONFIG_GPCT_QUADRATURE_ENCODER 1003 624 #define A4L_INSN_CONFIG_SET_GATE_SRC 2001 625 #define A4L_INSN_CONFIG_GET_GATE_SRC 2002 626 #define A4L_INSN_CONFIG_SET_CLOCK_SRC 2003 627 #define A4L_INSN_CONFIG_GET_CLOCK_SRC 2004 628 #define A4L_INSN_CONFIG_SET_OTHER_SRC 2005 629 #define A4L_INSN_CONFIG_SET_COUNTER_MODE 4097 630 #define A4L_INSN_CONFIG_SET_ROUTING 4099 631 #define A4L_INSN_CONFIG_GET_ROUTING 4109 641 #define A4L_COUNTER_ARMED 0x1 642 #define A4L_COUNTER_COUNTING 0x2 643 #define A4L_COUNTER_TERMINAL_COUNT 0x4 655 #define A4L_OPENDRAIN 2 667 #define A4L_EV_START 0x00040000 668 #define A4L_EV_SCAN_BEGIN 0x00080000 669 #define A4L_EV_CONVERT 0x00100000 670 #define A4L_EV_SCAN_END 0x00200000 671 #define A4L_EV_STOP 0x00400000 709 struct a4l_calibration_subdev {
716 struct a4l_calibration_subdev_data {
726 struct a4l_calibration_data {
730 struct a4l_calibration_subdev_data *ai;
732 struct a4l_calibration_subdev_data *ao;
735 struct a4l_polynomial {
unsigned int scan_begin_arg
Scan begin trigger argument.
Definition: analogy.h:303
unsigned int idx_subd
Subdevice to which the instruction will be applied.
Definition: analogy.h:683
unsigned int stop_arg
Stop trigger argument.
Definition: analogy.h:315
unsigned int chan_desc
Channel descriptor.
Definition: analogy.h:685
sampl_t * data
Driver specific buffer pointer.
Definition: analogy.h:329
Structure describing the asynchronous instruction.
Definition: analogy.h:289
void * data
Instruction data.
Definition: analogy.h:689
int a4l_poll(a4l_desc_t *dsc, unsigned int idx_subd, unsigned long ms_timeout)
Get the available data count.
Definition: async.c:286
unsigned char idx_subd
Subdevice to which the command will be applied.
Definition: analogy.h:290
a4l_insn_t * insns
Tab containing the instructions pointers.
Definition: analogy.h:702
unsigned long flags
Command flags.
Definition: analogy.h:293
unsigned int scan_begin_src
Scan begin trigger type.
Definition: analogy.h:301
unsigned int convert_src
Convert trigger type.
Definition: analogy.h:305
unsigned int * chan_descs
Tab containing channels descriptors.
Definition: analogy.h:320
unsigned int start_arg
Start trigger argument.
Definition: analogy.h:299
Structure describing the synchronous instruction.
Definition: analogy.h:680
unsigned int data_size
Size of the intruction data.
Definition: analogy.h:687
unsigned int type
Instruction type.
Definition: analogy.h:681
unsigned int scan_end_arg
Scan end trigger argument.
Definition: analogy.h:311
unsigned int scan_end_src
Scan end trigger type.
Definition: analogy.h:309
unsigned int count
Instructions count.
Definition: analogy.h:700
unsigned int start_src
Start trigger type.
Definition: analogy.h:297
unsigned int convert_arg
Convert trigger argument.
Definition: analogy.h:307
unsigned char nb_chan
Count of channels related with the command.
Definition: analogy.h:318
unsigned int data_len
< cmd simulation valid stages (driver dependent)
Definition: analogy.h:327
Structure describing the list of synchronous instructions.
Definition: analogy.h:699
unsigned int stop_src
Stop trigger type.
Definition: analogy.h:313