Go to the documentation of this file.
50 #define AD413X_CMD_WR_COM_REG(x) (0x00 | ((x) & 0x3F)) // Write to Register x
51 #define AD413X_CMD_RD_COM_REG(x) (0x40 | ((x) & 0x3F)) // Read from Register x
54 #define AD413X_R1B (1 << 8)
55 #define AD413X_R2B (2 << 8)
56 #define AD413X_R3B (3 << 8)
57 #define AD413X_TRANSF_LEN(x) (((x) >> 8) & 0xFF)
60 #define AD413X_REG_STATUS (AD413X_R1B | 0x0)
61 #define AD413X_REG_ADC_CTRL (AD413X_R2B | 0x1)
62 #define AD413X_REG_DATA (AD413X_R3B | 0x2)
63 #define AD413X_REG_IO_CTRL (AD413X_R2B | 0x3)
64 #define AD413X_REG_VBIAS_CTRL (AD413X_R2B | 0x4)
65 #define AD413X_REG_ID (AD413X_R1B | 0x5)
66 #define AD413X_REG_ERROR (AD413X_R2B | 0x6)
67 #define AD413X_REG_ERROR_EN (AD413X_R2B | 0x7)
68 #define AD413X_REG_MCLK_CNT (AD413X_R1B | 0x8)
69 #define AD413X_REG_CHN(x) (AD413X_R3B | (0x09U + (x)))
70 #define AD413X_REG_CONFIG(x) (AD413X_R2B | (0x19U + (x)))
71 #define AD413X_REG_FILTER(x) (AD413X_R3B | (0x21U + (x)))
72 #define AD413X_REG_OFFSET(x) (AD413X_R3B | (0x29U + (x)))
73 #define AD413X_REG_GAIN(x) (AD413X_R3B | (0x31U + (x)))
74 #define AD413X_REG_MISC (AD413X_R2B | 0x39)
75 #define AD413X_REG_FIFO_CTRL (AD413X_R3B | 0x3A)
76 #define AD413X_REG_FIFO_STS (AD413X_R1B | 0x3B)
77 #define AD413X_REG_FIFO_THRSHLD (AD413X_R3B | 0x3C)
78 #define AD413X_REG_FIFO_DATA (AD413X_R3B | 0x3D)
82 #define AD413X_ADC_BIPOLAR NO_OS_BIT(14)
83 #define AD413X_ADC_REF_VAL NO_OS_BIT(13)
84 #define AD413X_ADC_DOUT_DIS_DEL NO_OS_BIT(12)
85 #define AD413X_ADC_CONT_READ NO_OS_BIT(11)
86 #define AD413X_ADC_DATA_STATUS NO_OS_BIT(10)
87 #define AD413X_ADC_CSB_EN NO_OS_BIT(9)
88 #define AD413X_ADC_REF_EN NO_OS_BIT(8)
89 #define AD413X_ADC_DUTY_CYC_RATIO NO_OS_BIT(6)
90 #define AD413X_ADC_MODE(x) (((x) & 0xF) << 2)
91 #define AD413X_ADC_CNTRL_MCLK(x) ((x) & 0x3)
94 #define AD413X_SYNCB_CLEAR NO_OS_BIT(10)
95 #define AD413X_INT_PIN_SEL(x) (((x) & 0x3) << 8)
96 #define AD413X_GPO_DATA_P4 NO_OS_BIT(7)
97 #define AD413X_GPO_DATA_P3 NO_OS_BIT(6)
98 #define AD413X_GPO_DATA_P2 NO_OS_BIT(5)
99 #define AD413X_GPO_DATA_P1 NO_OS_BIT(4)
100 #define AD413X_GPO_CTRL_P4 NO_OS_BIT(3)
101 #define AD413X_GPO_CTRL_P3 NO_OS_BIT(2)
102 #define AD413X_GPO_CTRL_P2 NO_OS_BIT(1)
103 #define AD413X_GPO_CTRL_P1 0x01
106 #define AD413X_VBIAS_15 NO_OS_BIT(15)
107 #define AD413X_VBIAS_14 NO_OS_BIT(14)
108 #define AD413X_VBIAS_13 NO_OS_BIT(13)
109 #define AD413X_VBIAS_12 NO_OS_BIT(12)
110 #define AD413X_VBIAS_11 NO_OS_BIT(11)
111 #define AD413X_VBIAS_10 NO_OS_BIT(10)
112 #define AD413X_VBIAS_9 NO_OS_BIT(9)
113 #define AD413X_VBIAS_8 NO_OS_BIT(8)
114 #define AD413X_VBIAS_7 NO_OS_BIT(7)
115 #define AD413X_VBIAS_6 NO_OS_BIT(6)
116 #define AD413X_VBIAS_5 NO_OS_BIT(5)
117 #define AD413X_VBIAS_4 NO_OS_BIT(4)
118 #define AD413X_VBIAS_3 NO_OS_BIT(3)
119 #define AD413X_VBIAS_2 NO_OS_BIT(2)
120 #define AD413X_VBIAS_1 NO_OS_BIT(1)
121 #define AD413X_VBIAS_0 0x01
124 #define AD413X_AINP_OV_UV_ERR NO_OS_BIT(11)
125 #define AD413X_AINM_OV_UV_ERR NO_OS_BIT(10)
126 #define AD413X_REF_OV_UV_ERR NO_OS_BIT(9)
127 #define AD413X_REF_DETECT_ERR NO_OS_BIT(8)
128 #define AD413X_ADC_ERR NO_OS_BIT(7)
129 #define AD413X_SPI_IGNORE_ERR NO_OS_BIT(6)
130 #define AD413X_SPI_SCLK_CNT_ERR NO_OS_BIT(5)
131 #define AD413X_SPI_READ_ERR NO_OS_BIT(4)
132 #define AD413X_SPI_WRITE_ERR NO_OS_BIT(3)
133 #define AD413X_SPI_CRC_ERR NO_OS_BIT(2)
134 #define AD413X_MM_CRC_ERR NO_OS_BIT(1)
135 #define AD413X_ROM_CRC_ERR 0x01
138 #define AD413X_MCLK_CNT_EN NO_OS_BIT(12)
139 #define AD413X_AINP_OV_UV_ERR_EN NO_OS_BIT(11)
140 #define AD413X_AINM_OV_UV_ERR_EN NO_OS_BIT(10)
141 #define AD413X_REF_OV_UV_ERR_EN NO_OS_BIT(9)
142 #define AD413X_REF_DETECT_ERR_EN NO_OS_BIT(8)
143 #define AD413X_ADC_ERR_EN NO_OS_BIT(7)
144 #define AD413X_SPI_IGNORE_ERR_EN NO_OS_BIT(6)
145 #define AD413X_SPI_SCLK_CNT_ERR_EN NO_OS_BIT(5)
146 #define AD413X_SPI_READ_ERR_EN NO_OS_BIT(4)
147 #define AD413X_SPI_WRITE_ERR_EN NO_OS_BIT(3)
148 #define AD413X_SPI_CRC_ERR_EN NO_OS_BIT(2)
149 #define AD413X_MM_CRC_ERR_EN NO_OS_BIT(1)
150 #define AD413X_ROM_CRC_ERR_EN 0x01
153 #define AD413X_ENABLE_M NO_OS_BIT(23)
154 #define AD413X_SETUP_M(x) (((x) & 0x7) << 20)
155 #define AD413X_PDSW_M NO_OS_BIT(19)
156 #define AD413X_THRES_EN_M NO_OS_BIT(18)
157 #define AD413X_AINP_M(x) (((x) & 0x1F) << 13)
158 #define AD413X_AINM_M(x) (((x) & 0x1F) << 8)
159 #define AD413X_I_OUT1_CH_M(x) (((x) & 0xF) << 4)
160 #define AD413X_I_OUT0_CH_M(x) ((x) & 0xF)
161 #define AD413X_I_OUT_CH_MSK NO_OS_GENMASK(7,0)
164 #define AD413X_I_OUT1_N(x) (((x) & 0x7) << 13)
165 #define AD413X_I_OUT0_N(x) (((x) & 0x7) << 10)
166 #define AD413X_I_OUT_MSK NO_OS_GENMASK(15,10)
167 #define AD413X_BURNOUT_N(x) (((x) & 0x3) << 8)
168 #define AD413X_REF_BUF_MSK NO_OS_GENMASK(7,6)
169 #define AD413X_REF_BUFP_N NO_OS_BIT(7)
170 #define AD413X_REF_BUFM_N NO_OS_BIT(6)
171 #define AD413X_REF_SEL_N(x) (((x) & 0x3) << 4)
172 #define AD413X_PGA_N(x) (((x) & 0x7) << 1)
173 #define AD413X_PGA_BYP_N 0x01
176 #define AD413X_SETTLE_N(x) (((x) & 0x7) << 21)
177 #define AD413X_REPEAT_N(x) (((x) & 0x1F) << 16)
178 #define AD413X_FILTER_MODE_N(x) (((x) & 0xF) << 12)
179 #define AD413X_FS_N(x) ((x) & 0x7FF)
182 #define AD413X_OFFSET_N(x) ((x) & 0xFFFFFF)
185 #define AD413X_GAIN_N(x) ((x) & 0xFFFFFF)
188 #define AD413X_BYPASS_OSC NO_OS_BIT(15)
189 #define AD413X_PD_ALDO NO_OS_BIT(14)
190 #define AD413X_CAL_RANGE_X2 NO_OS_BIT(13)
191 #define AD413X_RESERVED(x) (((x) & 0xF) << 9)
192 #define AD413X_STBY_CTRL_MSK NO_OS_GENMASK(8,0)
193 #define AD413X_STBY_OUT_EN NO_OS_BIT(8)
194 #define AD413X_STBY_DIAGNOSTICS_EN NO_OS_BIT(7)
195 #define AD413X_STBY_GPO_EN NO_OS_BIT(6)
196 #define AD413X_STBY_PDSW_EN NO_OS_BIT(5)
197 #define AD413X_STBY_BURNOUT_EN NO_OS_BIT(4)
198 #define AD413X_STBY_VBIAS_EN NO_OS_BIT(3)
199 #define AD413X_STBY_IEXC_EN NO_OS_BIT(2)
200 #define AD413X_STBY_REFHOL_EN NO_OS_BIT(1)
201 #define AD413X_STBY_INTREF_EN 0x01
204 #define AD413X_ADD_FIFO_STATUS NO_OS_BIT(19)
205 #define AD413X_ADD_FIFO_HEADER NO_OS_BIT(18)
206 #define AD413X_FIFO_MODE(x) (((x) & 0x3) << 16)
207 #define AD413X_FIFO_WRITE_ERR_INT_EN NO_OS_BIT(14)
208 #define AD413X_FIFO_READ_ERR_INT_EN NO_OS_BIT(13)
209 #define AD413X_THRES_HIGH_INT_EN NO_OS_BIT(12)
210 #define AD413X_THRES_LOW_INT_EN NO_OS_BIT(11)
211 #define AD413X_OVERRUN_INT_EN NO_OS_BIT(10)
212 #define AD413X_WATERMARK_INT_EN NO_OS_BIT(9)
213 #define AD413X_EMPTY_INT_EN NO_OS_BIT(8)
214 #define AD413X_WATERMARK(x) ((x) & 0xFF)
217 #define AD413X_MASTER_ERR NO_OS_BIT(7)
218 #define AD413X_FIFO_WRITE_ERR NO_OS_BIT(6)
219 #define AD413X_FIFO_READ_ERR NO_OS_BIT(5)
220 #define AD413X_THRES_HIGH_FLAG NO_OS_BIT(4)
221 #define AD413X_THRES_LOW_FLAG NO_OS_BIT(3)
222 #define AD413X_OVERRUN_FLAG NO_OS_BIT(2)
223 #define AD413X_WATERMARK_FLAG NO_OS_BIT(1)
224 #define AD413X_EMPTY_FLAG 0x01
227 #define AD413X_THRES_HIGH_VAL(x) (((x) & 0xFFF) << 12)
228 #define AD413X_THRES_LOW_VAL(x) ((x) & 0xFFF)
231 #define AD413X_CRC8_POLY 0x07 // x^8 + x^2 + x^1 + x^0
610 uint8_t ch_nb, uint32_t sample_nb);
int32_t ad413x_set_v_bias(struct ad413x_dev *dev, uint16_t v_bias_val)
Definition: ad413x.c:535
int32_t ad413x_set_gain(struct ad413x_dev *dev, enum ad413x_gain gain, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:210
enum ad413x_chip_id chip_id
Definition: ad413x.h:500
@ AD413X_STANDBY_MODE
Definition: ad413x.h:309
struct no_os_spi_desc * spi_dev
Definition: ad413x.h:471
#define AD413X_ADC_REF_EN
Definition: ad413x.h:88
#define AD413X_REG_ID
Definition: ad413x.h:65
uint32_t timeout
Definition: ad413x.c:49
int32_t ad413x_set_mclk(struct ad413x_dev *dev, enum ad413x_mclk_sel clk)
Definition: ad413x.c:603
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
int32_t ad413x_set_int_ref(struct ad413x_dev *dev, enum ad413x_int_ref int_ref)
Definition: ad413x.c:121
#define AD413X_REF_BUFM_N
Definition: ad413x.h:170
enum ad413x_preset_nb preset
Definition: ad413x.h:456
#define AD413X_STBY_CTRL_MSK
Definition: ad413x.h:192
#define AD413X_ADC_MODE(x)
Definition: ad413x.h:90
Initial parameter structure.
Definition: ad413x.h:492
enum ad413x_chip_id chip_id
Definition: ad413x.h:477
@ AD413X_AIN12
Definition: ad413x.h:256
@ AD413X_INTREF_DISABLED
Definition: ad413x.h:346
enum ad413x_gain gain
Definition: ad413x.h:443
@ AD413X_DLDO_DGND_6M
Definition: ad413x.h:271
int32_t ad413x_set_ch_preset(struct ad413x_dev *dev, uint8_t ch_nb, enum ad413x_preset_nb preset_nb)
Definition: ad413x.c:405
@ AD413X_EXC_20UA
Definition: ad413x.h:412
@ AD413X_SYNC4_SYNC1
Definition: ad413x.h:357
ad413x_input
ADC input sources for each channel.
Definition: ad413x.h:243
@ AD413X_GAIN_128
Definition: ad413x.h:379
#define AD413X_STBY_PDSW_EN
Definition: ad413x.h:196
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
#define AD413X_ADC_CNTRL_MCLK(x)
Definition: ad413x.h:91
#define AD413X_CRC8_POLY
Definition: ad413x.h:231
int32_t ad413x_ch_en(struct ad413x_dev *dev, uint8_t ch_nb, uint8_t enable)
Definition: ad413x.c:461
#define AD413X_I_OUT1_N(x)
Definition: ad413x.h:164
@ AD413X_SYNC3_SYNC1
Definition: ad413x.h:360
int32_t ad413x_set_filter(struct ad413x_dev *dev, enum ad413x_filter filter, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:306
int32_t ad413x_reg_write_msk(struct ad413x_dev *dev, uint32_t reg_addr, uint32_t data, uint32_t mask)
Definition: ad413x.c:65
@ AD413X_EXC_100UA
Definition: ad413x.h:414
enum ad413x_input iout0_exc_input
Definition: ad413x.h:460
Header file of SPI Interface.
@ AD413X_GAIN_8
Definition: ad413x.h:375
Header file of IRQ interface.
@ AD413X_GAIN_64
Definition: ad413x.h:378
@ AD413X_EXC_150UA
Definition: ad413x.h:415
enum ad413x_filter filter
Definition: ad413x.h:444
struct ad413x_preset preset[8]
Definition: ad413x.h:475
uint32_t * buffer
Definition: ad413x.h:516
bool pdsw_en
Definition: ad413x.h:462
int32_t no_os_gpio_get_value(struct no_os_gpio_desc *desc, uint8_t *value)
Get the value of the specified GPIO.
Definition: no_os_gpio.c:221
int32_t ad413x_set_settle_time(struct ad413x_dev *dev, enum ad413x_settle_time s_time, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:340
int32_t ad413x_data_stat_en(struct ad413x_dev *dev, uint8_t enable)
Definition: ad413x.c:179
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
@ AD413X_CONTINOUS_CONV_MODE
Definition: ad413x.h:307
@ AD413X_PRESET_0
Definition: ad413x.h:281
@ AD413X_PW_DOWN_MODE
Definition: ad413x.h:310
int32_t ad413x_do_soft_reset(struct ad413x_dev *dev)
Definition: ad413x.c:625
#define AD413X_SETTLE_N(x)
Definition: ad413x.h:176
@ AD413X_SINGLE_CONV_MODE
Definition: ad413x.h:308
Header file of Delay functions.
@ AD413X_GAIN_16
Definition: ad413x.h:376
@ AD413X_DLDO_DGND_6P
Definition: ad413x.h:270
enum ad413x_ref_sel ref_sel
Definition: ad413x.h:442
#define AD413X_FILTER_MODE_N(x)
Definition: ad413x.h:178
@ AD413X_2048_MCLK
Definition: ad413x.h:401
int32_t ad413x_adc_bipolar(struct ad413x_dev *dev, uint8_t enable)
Definition: ad413x.c:511
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
int32_t ad413x_set_gain(struct ad413x_dev *dev, enum ad413x_gain gain, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:210
#define AD413X_REG_CHN(x)
Definition: ad413x.h:69
bool standby_vbias_en
Definition: ad413x.h:428
@ AD413X_SINGLE_CONV_SYNC_IDLE_MODE
Definition: ad413x.h:317
int32_t ad413x_ch_exc_input(struct ad413x_dev *dev, uint8_t ch_nb, enum ad413x_input iout0_exc_inp, enum ad413x_input iout1_exc_inp)
Definition: ad413x.c:432
bool standby_burnout_en
Definition: ad413x.h:429
@ AD413X_INT_REF
Definition: ad413x.h:262
@ AD413X_DUTY_CYCLING_SYNC_STBY_MODE
Definition: ad413x.h:318
bool standby_gpio_en
Definition: ad413x.h:431
Definition: ad9361_util.h:69
int32_t ad413x_set_mclk(struct ad413x_dev *dev, enum ad413x_mclk_sel clk)
Definition: ad413x.c:603
#define AD413X_REG_STATUS
Definition: ad413x.h:60
#define AD413X_AINM_M(x)
Definition: ad413x.h:158
int32_t ad413x_preset_store(struct ad413x_dev *dev, struct ad413x_preset preset, enum ad413x_preset_nb preset_nb)
Definition: ad413x.c:870
@ AD413X_INT_76_8_KHZ_OUT_OFF
Definition: ad413x.h:296
@ AD413X_EXC_OFF
Definition: ad413x.h:410
int32_t ad413x_set_filter(struct ad413x_dev *dev, enum ad413x_filter filter, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:306
#define AD413X_REF_BUFP_N
Definition: ad413x.h:169
int32_t ad413x_reg_write_msk(struct ad413x_dev *dev, uint32_t reg_addr, uint32_t data, uint32_t mask)
Definition: ad413x.c:65
ad413x_gain
Gain options.
Definition: ad413x.h:371
@ AD413X_EXC_50UA
Definition: ad413x.h:413
#define AD413X_CMD_WR_COM_REG(x)
Definition: ad413x.h:50
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:124
@ AD413X_SYNC3_PF2
Definition: ad413x.h:362
@ AD413X_EXT_153_6_KHZ_DIV_2
Definition: ad413x.h:299
uint16_t v_bias
Definition: ad413x.h:504
@ AD413X_SYNC3_REJ60
Definition: ad413x.h:359
ADC reference buffer selection.
Definition: ad413x.h:325
int32_t ad413x_set_ref_buf(struct ad413x_dev *dev, struct ad413x_ref_buf ref_buf, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:266
@ AD413X_AVSS
Definition: ad413x.h:261
#define AD413X_I_OUT_MSK
Definition: ad413x.h:166
@ AD413X_AIN3
Definition: ad413x.h:247
@ AD413X_REFOUT_AVSS
Definition: ad413x.h:337
@ AD413X_IOVDD_DGND_6P
Definition: ad413x.h:266
@ AD413X_GAIN_2
Definition: ad413x.h:373
struct no_os_gpio_init_param * rdy_pin_init
Definition: ad413x.h:496
struct no_os_gpio_desc * rdy_pin_desc
Definition: ad413x.h:473
int32_t ad413x_set_adc_mode(struct ad413x_dev *dev, enum ad413x_adc_mode mode)
Definition: ad413x.c:95
Preset setting.
Definition: ad413x.h:440
@ AD413X_PRESET_7
Definition: ad413x.h:288
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ AD413X_GAIN_32
Definition: ad413x.h:377
@ AD413X_PRESET_2
Definition: ad413x.h:283
@ AD413X_AIN15
Definition: ad413x.h:259
int32_t ad413x_data_stat_en(struct ad413x_dev *dev, uint8_t enable)
Definition: ad413x.c:179
int32_t ad413x_single_conv(struct ad413x_dev *dev, uint32_t *buffer, uint8_t ch_nb)
Definition: ad413x.c:766
Header file of AD413X Driver.
@ AD413X_AVDD_AVSS_6M
Definition: ad413x.h:265
#define AD413X_STBY_BURNOUT_EN
Definition: ad413x.h:197
#define AD413X_REG_ERROR_EN
Definition: ad413x.h:67
@ AD413X_512_MCLK
Definition: ad413x.h:399
#define AD413X_ADC_DATA_STATUS
Definition: ad413x.h:86
@ AD413X_AIN6
Definition: ad413x.h:250
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
#define AD413X_STBY_OUT_EN
Definition: ad413x.h:193
enum ad413x_mclk_sel mclk
Definition: ad413x.h:478
#define AD413X_ADC_REF_VAL
Definition: ad413x.h:83
int32_t ad413x_adc_bipolar(struct ad413x_dev *dev, uint8_t enable)
Definition: ad413x.c:511
#define AD413X_REG_VBIAS_CTRL
Definition: ad413x.h:64
@ AD413X_INTREF_1_25V
Definition: ad413x.h:348
struct ad413x_dev * dev
Definition: ad413x.h:515
@ AD413X_128_MCLK
Definition: ad413x.h:397
int32_t ad413x_single_conv(struct ad413x_dev *dev, uint32_t *buffer, uint8_t ch_nb)
Definition: ad413x.c:766
struct ad413x_channel ch[16]
Definition: ad413x.h:476
struct ad413x_channel ch[16]
Definition: ad413x.h:499
bool ref_buf_p_en
Definition: ad413x.h:326
#define AD413X_SETUP_M(x)
Definition: ad413x.h:154
enum ad413x_int_ref int_ref
Definition: ad413x.h:481
int32_t ad413x_continuous_conv(struct ad413x_dev *dev, uint32_t *buffer, uint8_t ch_nb, uint32_t sample_nb)
Definition: ad413x.c:818
bool standby_iexc_en
Definition: ad413x.h:427
#define AD413X_I_OUT1_CH_M(x)
Definition: ad413x.h:159
int32_t ad413x_pdsw_en(struct ad413x_dev *dev, uint8_t ch_nb, bool pdsw_en)
Definition: ad413x.c:486
@ AD413X_ALDO_AVSS_6P
Definition: ad413x.h:268
#define AD413X_REG_MISC
Definition: ad413x.h:74
ad413x_mclk_sel
Master clock options.
Definition: ad413x.h:295
@ AD413X_AIN7
Definition: ad413x.h:251
Channel setting.
Definition: ad413x.h:455
struct ad413x_preset preset[8]
Definition: ad413x.h:498
enum ad413x_input ain_m
Definition: ad413x.h:459
bool standby_ref_holder_en
Definition: ad413x.h:426
int32_t ad413x_set_settle_time(struct ad413x_dev *dev, enum ad413x_settle_time s_time, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:340
uint8_t spi_crc_en
Definition: ad413x.h:485
bool standby_int_ref_en
Definition: ad413x.h:425
@ AD413X_AIN2
Definition: ad413x.h:246
uint8_t bipolar
Definition: ad413x.h:502
enum ad413x_exc_current iout0_exc_current
Definition: ad413x.h:447
enum ad413x_exc_current iout1_exc_current
Definition: ad413x.h:448
@ AD413X_4096_MCLK
Definition: ad413x.h:402
uint8_t data_stat
Definition: ad413x.h:506
#define AD413X_I_OUT0_CH_M(x)
Definition: ad413x.h:160
#define AD413X_CMD_RD_COM_REG(x)
Definition: ad413x.h:51
bool ref_buf_m_en
Definition: ad413x.h:327
#define AD413X_ENABLE_M
Definition: ad413x.h:153
ad413x_exc_current
Excitation current value.
Definition: ad413x.h:409
@ AD413X_INT_GAIN_CAL
Definition: ad413x.h:313
@ AD413X_1024_MCLK
Definition: ad413x.h:400
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
int32_t ad413x_reg_write(struct ad413x_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Definition: ad413x.c:650
int32_t ad413x_set_ref(struct ad413x_dev *dev, enum ad413x_ref_sel ref, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:240
enum ad413x_mclk_sel mclk
Definition: ad413x.h:501
#define AD413X_REG_ADC_CTRL
Definition: ad413x.h:61
int32_t ad413x_reg_read(struct ad413x_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Definition: ad413x.c:695
int32_t ad413x_remove(struct ad413x_dev *dev)
Free the resources allocated by ad413x_init().
Definition: ad413x.c:1073
@ AD413X_REFIN1
Definition: ad413x.h:335
@ AD413X_AIN11
Definition: ad413x.h:255
enum ad4110_gain gain
Definition: ad4110.h:312
#define AD413X_REG_CONFIG(x)
Definition: ad413x.h:70
@ AD413X_PRESET_1
Definition: ad413x.h:282
int32_t ad413x_preset_store(struct ad413x_dev *dev, struct ad413x_preset preset, enum ad413x_preset_nb preset_nb)
Definition: ad413x.c:870
#define AD413X_I_OUT0_N(x)
Definition: ad413x.h:165
@ AD413X_TEMP
Definition: ad413x.h:260
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
bool standby_output_en
Definition: ad413x.h:433
@ AD413X_SYNC3_PF4
Definition: ad413x.h:364
@ AD413X_DUTY_CYCLING_MODE
Definition: ad413x.h:316
ad413x_ref_sel
ADC reference selection.
Definition: ad413x.h:334
#define AD413X_AINP_M(x)
Definition: ad413x.h:157
@ AD413X_GAIN_1
Definition: ad413x.h:372
@ AD413X_EXT_76_8KHZ
Definition: ad413x.h:298
@ AD413X_SYNC3_STANDALONE
Definition: ad413x.h:358
Callback structure.
Definition: ad413x.h:514
@ AD413X_AVDD_AVSS
Definition: ad413x.h:338
@ AD413X_REFIN2
Definition: ad413x.h:336
@ AD413X_PRESET_5
Definition: ad413x.h:286
NO_OS_DECLARE_CRC8_TABLE(ad413x_crc8)
struct ad413x_ref_buf ref_buf
Definition: ad413x.h:441
int32_t ad413x_set_adc_mode(struct ad413x_dev *dev, enum ad413x_adc_mode mode)
Definition: ad413x.c:95
@ AD413X_EXC_10UA
Definition: ad413x.h:411
int32_t ad413x_set_ch_preset(struct ad413x_dev *dev, uint8_t ch_nb, enum ad413x_preset_nb preset_nb)
Definition: ad413x.c:405
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
int32_t ad413x_set_ref_buf(struct ad413x_dev *dev, struct ad413x_ref_buf ref_buf, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:266
uint16_t v_bias
Definition: ad413x.h:482
#define AD413X_STBY_IEXC_EN
Definition: ad413x.h:199
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
enum ad413x_input iout1_exc_input
Definition: ad413x.h:461
int32_t ad413x_init(struct ad413x_dev **device, struct ad413x_init_param init_param)
Definition: ad413x.c:908
enum ad413x_settle_time s_time
Definition: ad413x.h:446
uint8_t data_stat
Definition: ad413x.h:484
int32_t ad413x_set_exc_current(struct ad413x_dev *dev, enum ad413x_exc_current iout0_exc, enum ad413x_exc_current iout1_exc, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:376
#define AD413X_STBY_INTREF_EN
Definition: ad413x.h:201
Standby control flags.
Definition: ad413x.h:424
ad413x_int_ref
Internal reference selection.
Definition: ad413x.h:345
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
@ AD413X_SYS_GAIN_CAL
Definition: ad413x.h:315
#define AD413X_TRANSF_LEN(x)
Definition: ad413x.h:57
@ AD413X_AIN8
Definition: ad413x.h:252
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
#define AD413X_STBY_GPO_EN
Definition: ad413x.h:195
int32_t ad413x_continuous_conv(struct ad413x_dev *dev, uint32_t *buffer, uint8_t ch_nb, uint32_t sample_nb)
Definition: ad413x.c:818
#define AD413X_SPI_CRC_ERR_EN
Definition: ad413x.h:148
int32_t ad413x_set_exc_current(struct ad413x_dev *dev, enum ad413x_exc_current iout0_exc, enum ad413x_exc_current iout1_exc, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:376
enum ad413x_adc_mode op_mode
Definition: ad413x.h:479
int32_t ad413x_ch_en(struct ad413x_dev *dev, uint8_t ch_nb, uint8_t enable)
Definition: ad413x.c:461
int32_t ad413x_pdsw_en(struct ad413x_dev *dev, uint8_t ch_nb, bool pdsw_en)
Definition: ad413x.c:486
struct ad413x_standby_ctrl standby_ctrl
Definition: ad413x.h:483
struct ad413x_standby_ctrl standby_ctrl
Definition: ad413x.h:505
int32_t ad413x_set_int_ref(struct ad413x_dev *dev, enum ad413x_int_ref int_ref)
Definition: ad413x.c:121
@ AD413X_EXC_100NA
Definition: ad413x.h:417
Device structure.
Definition: ad413x.h:469
@ AD4130_8
Definition: ad413x.h:387
ad413x_preset_nb
Preset number.
Definition: ad413x.h:280
enum ad413x_input ain_p
Definition: ad413x.h:458
@ AD413X_SYS_OFFSET_CAL
Definition: ad413x.h:314
@ AD413X_EXC_200UA
Definition: ad413x.h:416
#define AD413X_I_OUT_CH_MSK
Definition: ad413x.h:161
#define AD413X_PGA_N(x)
Definition: ad413x.h:172
#define AD413X_STBY_VBIAS_EN
Definition: ad413x.h:198
bool standby_diagn_en
Definition: ad413x.h:432
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
@ AD413X_AIN1
Definition: ad413x.h:245
int32_t ad413x_set_standby_ctrl(struct ad413x_dev *dev, struct ad413x_standby_ctrl standby_ctrl)
Definition: ad413x.c:558
@ AD413X_AIN5
Definition: ad413x.h:249
uint8_t bipolar
Definition: ad413x.h:480
#define AD413X_STBY_DIAGNOSTICS_EN
Definition: ad413x.h:194
int32_t ad413x_remove(struct ad413x_dev *dev)
Free the resources allocated by ad413x_init().
Definition: ad413x.c:1073
@ AD413X_V_MV_M
Definition: ad413x.h:273
#define AD413X_REG_DATA
Definition: ad413x.h:62
@ AD413X_PRESET_4
Definition: ad413x.h:285
@ AD413X_INTREF_2_5V
Definition: ad413x.h:347
enum ad413x_int_ref int_ref
Definition: ad413x.h:503
@ AD413X_PRESET_3
Definition: ad413x.h:284
@ AD413X_V_MV_P
Definition: ad413x.h:272
@ AD413X_INT_OFFSET_CAL
Definition: ad413x.h:312
@ AD413X_AIN4
Definition: ad413x.h:248
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
@ AD413X_PRESET_6
Definition: ad413x.h:287
@ AD413X_AIN13
Definition: ad413x.h:257
bool standby_pdsw_en
Definition: ad413x.h:430
#define AD413X_ADC_CSB_EN
Definition: ad413x.h:87
@ AD413X_GAIN_4
Definition: ad413x.h:374
#define AD413X_PDSW_M
Definition: ad413x.h:155
Header file of GPIO Interface.
@ AD413X_AIN14
Definition: ad413x.h:258
@ AD413X_32_MCLK
Definition: ad413x.h:395
#define AD413X_ADC_BIPOLAR
Definition: ad413x.h:82
@ AD413X_AIN0
Definition: ad413x.h:244
uint8_t spi_crc_en
Definition: ad413x.h:507
@ AD413X_SYNC4_STANDALONE
Definition: ad413x.h:356
#define AD413X_STBY_REFHOL_EN
Definition: ad413x.h:200
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
struct no_os_spi_init_param * spi_init
Definition: ad413x.h:494
int32_t ad413x_set_standby_ctrl(struct ad413x_dev *dev, struct ad413x_standby_ctrl standby_ctrl)
Definition: ad413x.c:558
int32_t ad413x_ch_exc_input(struct ad413x_dev *dev, uint8_t ch_nb, enum ad413x_input iout0_exc_inp, enum ad413x_input iout1_exc_inp)
Definition: ad413x.c:432
Header file of utility functions.
@ AD413X_AIN9
Definition: ad413x.h:253
uint8_t enable
Definition: ad413x.h:457
@ AD413X_IDLE_MODE
Definition: ad413x.h:311
@ AD413X_SYNC3_PF1
Definition: ad413x.h:361
@ AD413X_256_MCLK
Definition: ad413x.h:398
@ AD413X_AVDD_AVSS_6P
Definition: ad413x.h:264
@ AD413X_ALDO_AVSS_6M
Definition: ad413x.h:269
#define AD413X_REF_BUF_MSK
Definition: ad413x.h:168
@ AD413X_DGND
Definition: ad413x.h:263
ad413x_chip_id
Chip IDs.
Definition: ad413x.h:386
int32_t ad413x_reg_write(struct ad413x_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Definition: ad413x.c:650
ad413x_adc_mode
ADC conversion modes.
Definition: ad413x.h:306
@ AD413X_SYNC3_PF3
Definition: ad413x.h:363
#define AD413X_REG_FILTER(x)
Definition: ad413x.h:71
int32_t ad413x_set_ref(struct ad413x_dev *dev, enum ad413x_ref_sel ref, enum ad413x_preset_nb reg_nb)
Definition: ad413x.c:240
ad413x_filter
Filter types.
Definition: ad413x.h:355
Header file of CRC-8 computation.
ad413x_settle_time
Channel settle time.
Definition: ad413x.h:394
@ AD413X_AIN10
Definition: ad413x.h:254
int32_t ad413x_init(struct ad413x_dev **device, struct ad413x_init_param init_param)
Definition: ad413x.c:908
int32_t ad413x_do_soft_reset(struct ad413x_dev *dev)
Definition: ad413x.c:625
int32_t ad413x_set_v_bias(struct ad413x_dev *dev, uint16_t v_bias_val)
Definition: ad413x.c:535
@ AD413X_INT_76_8_KHZ_OUT_ON
Definition: ad413x.h:297
#define AD413X_REF_SEL_N(x)
Definition: ad413x.h:171
@ AD413X_IOVDD_DGND_6M
Definition: ad413x.h:267
uint32_t buffer_size
Definition: ad413x.h:517
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
@ AD413X_64_MCLK
Definition: ad413x.h:396
int32_t ad413x_reg_read(struct ad413x_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Definition: ad413x.c:695