Go to the documentation of this file.
8 #ifndef IIO_ADC_AD7793_H_
9 #define IIO_ADC_AD7793_H_
16 #define AD7793_REG_COMM 0
17 #define AD7793_REG_STAT 0
18 #define AD7793_REG_MODE 1
19 #define AD7793_REG_CONF 2
20 #define AD7793_REG_DATA 3
21 #define AD7793_REG_ID 4
22 #define AD7793_REG_IO 5
23 #define AD7793_REG_OFFSET 6
25 #define AD7793_REG_FULLSALE 7
29 #define AD7793_COMM_WEN (1 << 7)
30 #define AD7793_COMM_WRITE (0 << 6)
31 #define AD7793_COMM_READ (1 << 6)
32 #define AD7793_COMM_ADDR(x) (((x) & 0x7) << 3)
33 #define AD7793_COMM_CREAD (1 << 2)
36 #define AD7793_STAT_RDY (1 << 7)
37 #define AD7793_STAT_ERR (1 << 6)
38 #define AD7793_STAT_CH3 (1 << 2)
39 #define AD7793_STAT_CH2 (1 << 1)
40 #define AD7793_STAT_CH1 (1 << 0)
43 #define AD7793_MODE_SEL(x) (((x) & 0x7) << 13)
44 #define AD7793_MODE_SEL_MASK (0x7 << 13)
45 #define AD7793_MODE_CLKSRC(x) (((x) & 0x3) << 6)
46 #define AD7793_MODE_RATE(x) ((x) & 0xF)
48 #define AD7793_MODE_CONT 0
49 #define AD7793_MODE_SINGLE 1
50 #define AD7793_MODE_IDLE 2
51 #define AD7793_MODE_PWRDN 3
52 #define AD7793_MODE_CAL_INT_ZERO 4
53 #define AD7793_MODE_CAL_INT_FULL 5
54 #define AD7793_MODE_CAL_SYS_ZERO 6
55 #define AD7793_MODE_CAL_SYS_FULL 7
57 #define AD7793_CLK_INT 0
59 #define AD7793_CLK_INT_CO 1
61 #define AD7793_CLK_EXT 2
62 #define AD7793_CLK_EXT_DIV2 3
65 #define AD7793_CONF_VBIAS(x) (((x) & 0x3) << 14)
67 #define AD7793_CONF_BO_EN (1 << 13)
68 #define AD7793_CONF_UNIPOLAR (1 << 12)
69 #define AD7793_CONF_BOOST (1 << 11)
70 #define AD7793_CONF_GAIN(x) (((x) & 0x7) << 8)
71 #define AD7793_CONF_REFSEL (1 << 7)
72 #define AD7793_CONF_BUF (1 << 4)
73 #define AD7793_CONF_CHAN(x) ((x) & 0xf)
74 #define AD7793_CONF_CHAN_MASK 0xf
76 #define AD7793_CH_AIN1P_AIN1M 0
77 #define AD7793_CH_AIN2P_AIN2M 1
78 #define AD7793_CH_AIN3P_AIN3M 2
79 #define AD7793_CH_AIN1M_AIN1M 3
80 #define AD7793_CH_TEMP 6
81 #define AD7793_CH_AVDD_MONITOR 7
83 #define AD7795_CH_AIN4P_AIN4M 4
84 #define AD7795_CH_AIN5P_AIN5M 5
85 #define AD7795_CH_AIN6P_AIN6M 6
86 #define AD7795_CH_AIN1M_AIN1M 8
92 #define AD7793_ID_MASK 0xF
95 #define AD7793_IO_IEXC1_IOUT1_IEXC2_IOUT2 0
97 #define AD7793_IO_IEXC1_IOUT2_IEXC2_IOUT1 1
99 #define AD7793_IO_IEXC1_IEXC2_IOUT1 2
101 #define AD7793_IO_IEXC1_IEXC2_IOUT2 3
104 #define AD7793_IO_IXCEN_10uA (1 << 0)
105 #define AD7793_IO_IXCEN_210uA (2 << 0)
106 #define AD7793_IO_IXCEN_1mA (3 << 0)