47#define AD7124_MAX_SETUPS 8
49#define AD7124_MAX_CHANNELS 16
52#define AD7124_4_STD_ID 0x04
54#define AD7124_4_B_GRADE_ID 0x06
56#define AD7124_4_NEW_ID 0x07
59#define AD7124_8_STD_ID 0x14
61#define AD7124_8_B_W_GRADE_ID 0x16
63#define AD7124_8_NEW_ID 0x17
66#define AD7124_COMM_REG 0x00
67#define AD7124_STATUS_REG 0x00
68#define AD7124_ADC_CTRL_REG 0x01
69#define AD7124_DATA_REG 0x02
70#define AD7124_IO_CTRL1_REG 0x03
71#define AD7124_IO_CTRL2_REG 0x04
72#define AD7124_ID_REG 0x05
73#define AD7124_ERR_REG 0x06
74#define AD7124_ERREN_REG 0x07
75#define AD7124_CH0_MAP_REG 0x09
76#define AD7124_CH1_MAP_REG 0x0A
77#define AD7124_CH2_MAP_REG 0x0B
78#define AD7124_CH3_MAP_REG 0x0C
79#define AD7124_CH4_MAP_REG 0x0D
80#define AD7124_CH5_MAP_REG 0x0E
81#define AD7124_CH6_MAP_REG 0x0F
82#define AD7124_CH7_MAP_REG 0x10
83#define AD7124_CH8_MAP_REG 0x11
84#define AD7124_CH9_MAP_REG 0x12
85#define AD7124_CH10_MAP_REG 0x13
86#define AD7124_CH11_MAP_REG 0x14
87#define AD7124_CH12_MAP_REG 0x15
88#define AD7124_CH13_MAP_REG 0x16
89#define AD7124_CH14_MAP_REG 0x17
90#define AD7124_CH15_MAP_REG 0x18
91#define AD7124_CFG0_REG 0x19
92#define AD7124_CFG1_REG 0x1A
93#define AD7124_CFG2_REG 0x1B
94#define AD7124_CFG3_REG 0x1C
95#define AD7124_CFG4_REG 0x1D
96#define AD7124_CFG5_REG 0x1E
97#define AD7124_CFG6_REG 0x1F
98#define AD7124_CFG7_REG 0x20
99#define AD7124_FILT0_REG 0x21
100#define AD7124_FILT1_REG 0x22
101#define AD7124_FILT2_REG 0x23
102#define AD7124_FILT3_REG 0x24
103#define AD7124_FILT4_REG 0x25
104#define AD7124_FILT5_REG 0x26
105#define AD7124_FILT6_REG 0x27
106#define AD7124_FILT7_REG 0x28
107#define AD7124_OFFS0_REG 0x29
108#define AD7124_OFFS1_REG 0x2A
109#define AD7124_OFFS2_REG 0x2B
110#define AD7124_OFFS3_REG 0x2C
111#define AD7124_OFFS4_REG 0x2D
112#define AD7124_OFFS5_REG 0x2E
113#define AD7124_OFFS6_REG 0x2F
114#define AD7124_OFFS7_REG 0x30
115#define AD7124_GAIN0_REG 0x31
116#define AD7124_GAIN1_REG 0x32
117#define AD7124_GAIN2_REG 0x33
118#define AD7124_GAIN3_REG 0x34
119#define AD7124_GAIN4_REG 0x35
120#define AD7124_GAIN5_REG 0x36
121#define AD7124_GAIN6_REG 0x37
122#define AD7124_GAIN7_REG 0x38
125#define AD7124_COMM_REG_WEN (0 << 7)
126#define AD7124_COMM_REG_WR (0 << 6)
127#define AD7124_COMM_REG_RD (1 << 6)
128#define AD7124_COMM_REG_RA(x) ((x) & 0x3F)
131#define AD7124_STATUS_REG_RDY (1 << 7)
132#define AD7124_STATUS_REG_ERROR_FLAG (1 << 6)
133#define AD7124_STATUS_REG_POR_FLAG (1 << 4)
134#define AD7124_STATUS_REG_CH_ACTIVE(x) ((x) & 0xF)
137#define AD7124_ADC_CTRL_REG_DOUT_RDY_DEL (1 << 12)
138#define AD7124_ADC_CTRL_REG_CONT_READ (1 << 11)
139#define AD7124_ADC_CTRL_REG_DATA_STATUS (1 << 10)
140#define AD7124_ADC_CTRL_REG_CS_EN (1 << 9)
141#define AD7124_ADC_CTRL_REG_REF_EN (1 << 8)
142#define AD7124_ADC_CTRL_REG_POWER_MODE(x) (((x) & 0x3) << 6)
143#define AD7124_ADC_CTRL_REG_MODE(x) (((x) & 0xF) << 2)
144#define AD7124_ADC_CTRL_REG_CLK_SEL(x) (((x) & 0x3) << 0)
147#define AD7124_IO_CTRL1_REG_GPIO_DAT2 (1 << 23)
148#define AD7124_IO_CTRL1_REG_GPIO_DAT1 (1 << 22)
149#define AD7124_IO_CTRL1_REG_GPIO_CTRL2 (1 << 19)
150#define AD7124_IO_CTRL1_REG_GPIO_CTRL1 (1 << 18)
151#define AD7124_IO_CTRL1_REG_PDSW (1 << 15)
152#define AD7124_IO_CTRL1_REG_IOUT1(x) (((x) & 0x7) << 11)
153#define AD7124_IO_CTRL1_REG_IOUT0(x) (((x) & 0x7) << 8)
154#define AD7124_IO_CTRL1_REG_IOUT_CH1(x) (((x) & 0xF) << 4)
155#define AD7124_IO_CTRL1_REG_IOUT_CH0(x) (((x) & 0xF) << 0)
158#define AD7124_8_IO_CTRL1_REG_GPIO_DAT4 (1 << 23)
159#define AD7124_8_IO_CTRL1_REG_GPIO_DAT3 (1 << 22)
160#define AD7124_8_IO_CTRL1_REG_GPIO_DAT2 (1 << 21)
161#define AD7124_8_IO_CTRL1_REG_GPIO_DAT1 (1 << 20)
162#define AD7124_8_IO_CTRL1_REG_GPIO_CTRL4 (1 << 19)
163#define AD7124_8_IO_CTRL1_REG_GPIO_CTRL3 (1 << 18)
164#define AD7124_8_IO_CTRL1_REG_GPIO_CTRL2 (1 << 17)
165#define AD7124_8_IO_CTRL1_REG_GPIO_CTRL1 (1 << 16)
168#define AD7124_IO_CTRL2_REG_GPIO_VBIAS7 (1 << 15)
169#define AD7124_IO_CTRL2_REG_GPIO_VBIAS6 (1 << 14)
170#define AD7124_IO_CTRL2_REG_GPIO_VBIAS5 (1 << 11)
171#define AD7124_IO_CTRL2_REG_GPIO_VBIAS4 (1 << 10)
172#define AD7124_IO_CTRL2_REG_GPIO_VBIAS3 (1 << 5)
173#define AD7124_IO_CTRL2_REG_GPIO_VBIAS2 (1 << 4)
174#define AD7124_IO_CTRL2_REG_GPIO_VBIAS1 (1 << 1)
175#define AD7124_IO_CTRL2_REG_GPIO_VBIAS0 (1 << 0)
178#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS15 (1 << 15)
179#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS14 (1 << 14)
180#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS13 (1 << 13)
181#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS12 (1 << 12)
182#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS11 (1 << 11)
183#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS10 (1 << 10)
184#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS9 (1 << 9)
185#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS8 (1 << 8)
186#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS7 (1 << 7)
187#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS6 (1 << 6)
188#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS5 (1 << 5)
189#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS4 (1 << 4)
190#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS3 (1 << 3)
191#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS2 (1 << 2)
192#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS1 (1 << 1)
193#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS0 (1 << 0)
196#define AD7124_ID_REG_DEVICE_ID(x) (((x) & 0xF) << 4)
197#define AD7124_ID_REG_SILICON_REV(x) (((x) & 0xF) << 0)
200#define AD7124_ERR_REG_LDO_CAP_ERR (1 << 19)
201#define AD7124_ERR_REG_ADC_CAL_ERR (1 << 18)
202#define AD7124_ERR_REG_ADC_CONV_ERR (1 << 17)
203#define AD7124_ERR_REG_ADC_SAT_ERR (1 << 16)
204#define AD7124_ERR_REG_AINP_OV_ERR (1 << 15)
205#define AD7124_ERR_REG_AINP_UV_ERR (1 << 14)
206#define AD7124_ERR_REG_AINM_OV_ERR (1 << 13)
207#define AD7124_ERR_REG_AINM_UV_ERR (1 << 12)
208#define AD7124_ERR_REG_REF_DET_ERR (1 << 11)
209#define AD7124_ERR_REG_DLDO_PSM_ERR (1 << 9)
210#define AD7124_ERR_REG_ALDO_PSM_ERR (1 << 7)
211#define AD7124_ERR_REG_SPI_IGNORE_ERR (1 << 6)
212#define AD7124_ERR_REG_SPI_SLCK_CNT_ERR (1 << 5)
213#define AD7124_ERR_REG_SPI_READ_ERR (1 << 4)
214#define AD7124_ERR_REG_SPI_WRITE_ERR (1 << 3)
215#define AD7124_ERR_REG_SPI_CRC_ERR (1 << 2)
216#define AD7124_ERR_REG_MM_CRC_ERR (1 << 1)
217#define AD7124_ERR_REG_ROM_CRC_ERR (1 << 0)
220#define AD7124_ERREN_REG_MCLK_CNT_EN (1 << 22)
221#define AD7124_ERREN_REG_LDO_CAP_CHK_TEST_EN (1 << 21)
222#define AD7124_ERREN_REG_LDO_CAP_CHK(x) (((x) & 0x3) << 19)
223#define AD7124_ERREN_REG_ADC_CAL_ERR_EN (1 << 18)
224#define AD7124_ERREN_REG_ADC_CONV_ERR_EN (1 << 17)
225#define AD7124_ERREN_REG_ADC_SAT_ERR_EN (1 << 16)
226#define AD7124_ERREN_REG_AINP_OV_ERR_EN (1 << 15)
227#define AD7124_ERREN_REG_AINP_UV_ERR_EN (1 << 14)
228#define AD7124_ERREN_REG_AINM_OV_ERR_EN (1 << 13)
229#define AD7124_ERREN_REG_AINM_UV_ERR_EN (1 << 12)
230#define AD7124_ERREN_REG_REF_DET_ERR_EN (1 << 11)
231#define AD7124_ERREN_REG_DLDO_PSM_TRIP_TEST_EN (1 << 10)
232#define AD7124_ERREN_REG_DLDO_PSM_ERR_ERR (1 << 9)
233#define AD7124_ERREN_REG_ALDO_PSM_TRIP_TEST_EN (1 << 8)
234#define AD7124_ERREN_REG_ALDO_PSM_ERR_EN (1 << 7)
235#define AD7124_ERREN_REG_SPI_IGNORE_ERR_EN (1 << 6)
236#define AD7124_ERREN_REG_SPI_SCLK_CNT_ERR_EN (1 << 5)
237#define AD7124_ERREN_REG_SPI_READ_ERR_EN (1 << 4)
238#define AD7124_ERREN_REG_SPI_WRITE_ERR_EN (1 << 3)
239#define AD7124_ERREN_REG_SPI_CRC_ERR_EN (1 << 2)
240#define AD7124_ERREN_REG_MM_CRC_ERR_EN (1 << 1)
241#define AD7124_ERREN_REG_ROM_CRC_ERR_EN (1 << 0)
244#define AD7124_CH_MAP_REG_CH_ENABLE (1 << 15)
245#define AD7124_CH_MAP_REG_SETUP(x) (((x) & 0x7) << 12)
246#define AD7124_CH_MAP_REG_AINP(x) (((x) & 0x1F) << 5)
247#define AD7124_CH_MAP_REG_AINM(x) (((x) & 0x1F) << 0)
250#define AD7124_CFG_REG_BIPOLAR (1 << 11)
251#define AD7124_CFG_REG_BURNOUT(x) (((x) & 0x3) << 9)
252#define AD7124_CFG_REG_REF_BUFP (1 << 8)
253#define AD7124_CFG_REG_REF_BUFM (1 << 7)
254#define AD7124_CFG_REG_AIN_BUFP (1 << 6)
255#define AD7124_CFG_REG_AINN_BUFM (1 << 5)
256#define AD7124_CFG_REG_REF_SEL(x) ((x) & 0x3) << 3
257#define AD7124_CFG_REG_PGA(x) (((x) & 0x7) << 0)
260#define AD7124_FILT_REG_FILTER(x) (((x) & 0x7) << 21)
261#define AD7124_FILT_REG_REJ60 (1 << 20)
262#define AD7124_FILT_REG_POST_FILTER(x) (((x) & 0x7) << 17)
263#define AD7124_FILT_REG_SINGLE_CYCLE (1 << 16)
264#define AD7124_FILT_REG_FS(x) (((x) & 0x7FF) << 0)
266#define AD7124_CRC8_POLYNOMIAL_REPRESENTATION 0x07
267#define AD7124_DISABLE_CRC 0
268#define AD7124_USE_CRC 1
269#define AD7124_CHMAP_REG_SETUP_SEL_MSK NO_OS_GENMASK(14,12)
270#define AD7124_CHMAP_REG_AINPOS_MSK NO_OS_GENMASK(9,5)
271#define AD7124_CHMAP_REG_AINNEG_MSK NO_OS_GENMASK(4,0)
272#define AD7124_ADC_CTRL_REG_MODE_MSK NO_OS_GENMASK(5,2)
273#define AD7124_SETUP_CONF_REG_BURNOUT_MSK NO_OS_GENMASK(10,9)
274#define AD7124_SETUP_CONF_REG_REF_SEL_MSK NO_OS_GENMASK(4,3)
275#define AD7124_SETUP_CONF_REG_PGA_MSK NO_OS_GENMASK(2,0)
276#define AD7124_REF_BUF_MSK NO_OS_GENMASK(8,7)
277#define AD7124_AIN_BUF_MSK NO_OS_GENMASK(6,5)
278#define AD7124_POWER_MODE_MSK NO_OS_GENMASK(7,6)
638 bool channel_status);
uint32_t timeout
Definition ad413x.c:46
@ bipolar
Definition ad5446.h:64
float ad7124_get_odr(struct ad7124_dev *dev, int16_t ch_no)
Calculate ODR of the device.
Definition ad7124.c:597
int ad7124_set_polarity(struct ad7124_dev *device, bool bipolar, uint8_t setup_id)
Set Polarity.
Definition ad7124.c:834
ad7124_power_mode
Power modes.
Definition ad7124.h:426
@ AD7124_LOW_POWER
Definition ad7124.h:427
@ AD7124_HIGH_POWER
Definition ad7124.h:429
@ AD7124_MID_POWER
Definition ad7124.h:428
ad7124_device_type
Definition ad7124.h:284
@ ID_AD7124_8
Definition ad7124.h:286
@ ID_AD7124_4
Definition ad7124.h:285
int ad7124_set_reference_source(struct ad7124_dev *device, enum ad7124_reference_source ref_source, uint8_t setup_id, bool ref_en)
Definition ad7124.c:891
int ad7124_set_adc_mode(struct ad7124_dev *device, enum ad7124_mode mode)
Set ADC Mode.
Definition ad7124.c:713
int32_t ad7124_wait_for_spi_ready(struct ad7124_dev *dev, uint32_t timeout)
Waits until the device can accept read and write user actions.
Definition ad7124.c:287
ad7124_registers
Definition ad7124.h:441
@ AD7124_Offset_7
Definition ad7124.h:490
@ AD7124_ADC_Control
Definition ad7124.h:443
@ AD7124_IOCon1
Definition ad7124.h:445
@ AD7124_Offset_4
Definition ad7124.h:487
@ AD7124_Config_5
Definition ad7124.h:472
@ AD7124_Offset_2
Definition ad7124.h:485
@ AD7124_Gain_5
Definition ad7124.h:496
@ AD7124_ID
Definition ad7124.h:447
@ AD7124_Offset_5
Definition ad7124.h:488
@ AD7124_Channel_0
Definition ad7124.h:451
@ AD7124_Channel_1
Definition ad7124.h:452
@ AD7124_Filter_2
Definition ad7124.h:477
@ AD7124_Channel_12
Definition ad7124.h:463
@ AD7124_Channel_13
Definition ad7124.h:464
@ AD7124_Channel_6
Definition ad7124.h:457
@ AD7124_IOCon2
Definition ad7124.h:446
@ AD7124_Error_En
Definition ad7124.h:449
@ AD7124_Data
Definition ad7124.h:444
@ AD7124_Channel_7
Definition ad7124.h:458
@ AD7124_Mclk_Count
Definition ad7124.h:450
@ AD7124_Channel_8
Definition ad7124.h:459
@ AD7124_Filter_5
Definition ad7124.h:480
@ AD7124_Filter_7
Definition ad7124.h:482
@ AD7124_Channel_4
Definition ad7124.h:455
@ AD7124_Config_3
Definition ad7124.h:470
@ AD7124_Channel_11
Definition ad7124.h:462
@ AD7124_Offset_3
Definition ad7124.h:486
@ AD7124_Filter_4
Definition ad7124.h:479
@ AD7124_Channel_9
Definition ad7124.h:460
@ AD7124_Offset_0
Definition ad7124.h:483
@ AD7124_Config_1
Definition ad7124.h:468
@ AD7124_Gain_1
Definition ad7124.h:492
@ AD7124_Channel_14
Definition ad7124.h:465
@ AD7124_Channel_2
Definition ad7124.h:453
@ AD7124_Filter_3
Definition ad7124.h:478
@ AD7124_Error
Definition ad7124.h:448
@ AD7124_Gain_2
Definition ad7124.h:493
@ AD7124_Filter_0
Definition ad7124.h:475
@ AD7124_Gain_3
Definition ad7124.h:494
@ AD7124_Offset_6
Definition ad7124.h:489
@ AD7124_Gain_6
Definition ad7124.h:497
@ AD7124_Gain_4
Definition ad7124.h:495
@ AD7124_Channel_5
Definition ad7124.h:456
@ AD7124_Channel_15
Definition ad7124.h:466
@ AD7124_Gain_7
Definition ad7124.h:498
@ AD7124_Status
Definition ad7124.h:442
@ AD7124_Filter_1
Definition ad7124.h:476
@ AD7124_Filter_6
Definition ad7124.h:481
@ AD7124_Gain_0
Definition ad7124.h:491
@ AD7124_Config_0
Definition ad7124.h:467
@ AD7124_Config_4
Definition ad7124.h:471
@ AD7124_Offset_1
Definition ad7124.h:484
@ AD7124_REG_NO
Definition ad7124.h:499
@ AD7124_Channel_10
Definition ad7124.h:461
@ AD7124_Channel_3
Definition ad7124.h:454
@ AD7124_Config_2
Definition ad7124.h:469
@ AD7124_Config_7
Definition ad7124.h:474
@ AD7124_Config_6
Definition ad7124.h:473
int ad7124_connect_analog_input(struct ad7124_dev *device, uint8_t chn_no, struct ad7124_analog_inputs analog_input)
Set Analog Inputs to channel.
Definition ad7124.c:770
ad7124_analog_input
ADC input sources for each channel.
Definition ad7124.h:310
@ AD7124_AIN5
Definition ad7124.h:316
@ AD7124_AVDD_AVSS_M
Definition ad7124.h:332
@ AD7124_IOVDD_DGND_M
Definition ad7124.h:334
@ AD7124_AIN1
Definition ad7124.h:312
@ AD7124_AIN4
Definition ad7124.h:315
@ AD7124_IOVDD_DGND_P
Definition ad7124.h:333
@ AD7124_AIN3
Definition ad7124.h:314
@ AD7124_AVSS
Definition ad7124.h:328
@ AD7124_V_20MV_M
Definition ad7124.h:340
@ AD7124_AIN15
Definition ad7124.h:326
@ AD7124_AIN8
Definition ad7124.h:319
@ AD7124_TEMP_SENSOR
Definition ad7124.h:327
@ AD7124_AIN0
Definition ad7124.h:311
@ AD7124_DGND
Definition ad7124.h:330
@ AD7124_AIN14
Definition ad7124.h:325
@ AD7124_AIN2
Definition ad7124.h:313
@ AD7124_AIN10
Definition ad7124.h:321
@ AD7124_DLDO_DGND_P
Definition ad7124.h:337
@ AD7124_AIN7
Definition ad7124.h:318
@ AD7124_AIN13
Definition ad7124.h:324
@ AD7124_AVDD_AVSS_P
Definition ad7124.h:331
@ AD7124_DLDO_DGND_M
Definition ad7124.h:338
@ AD7124_AIN9
Definition ad7124.h:320
@ AD7124_ALDO_AVSS_M
Definition ad7124.h:336
@ AD7124_IN_REF
Definition ad7124.h:329
@ AD7124_V_20MV_P
Definition ad7124.h:339
@ AD7124_AIN6
Definition ad7124.h:317
@ AD7124_ALDO_AVSS_P
Definition ad7124.h:335
@ AD7124_AIN12
Definition ad7124.h:323
@ AD7124_AIN11
Definition ad7124.h:322
uint8_t ad7124_compute_crc8(uint8_t *p_buf, uint8_t buf_size)
Computes the CRC checksum for a data buffer.
Definition ad7124.c:439
int32_t ad7124_read_data(struct ad7124_dev *dev, int32_t *p_data)
Reads the conversion result from the device.
Definition ad7124.c:393
int32_t ad7124_wait_to_power_on(struct ad7124_dev *dev, uint32_t timeout)
Waits until the device finishes the power-on reset operation.
Definition ad7124.c:323
int32_t ad7124_read_register(struct ad7124_dev *dev, struct ad7124_st_reg *p_reg)
Reads the value of the specified register only when the device is ready to accept user requests....
Definition ad7124.c:171
int32_t ad7124_fltcoff_get(struct ad7124_dev *dev, int16_t chn_no, uint16_t *flt_coff)
Get the filter coefficient for the sample rate.
Definition ad7124.c:545
int32_t ad7124_set_odr(struct ad7124_dev *dev, float odr, int16_t chn_no)
Set ODR of the device.
Definition ad7124.c:646
int32_t ad7124_no_check_write_register(struct ad7124_dev *dev, struct ad7124_st_reg reg)
Writes the value of the specified register without checking if the device is ready to accept user req...
Definition ad7124.c:126
int32_t ad7124_get_read_chan_id(struct ad7124_dev *dev, uint32_t *status)
Get the ID of the channel of the latest conversion.
Definition ad7124.c:419
int ad7124_set_channel_status(struct ad7124_dev *device, uint8_t chn_no, bool channel_status)
Definition ad7124.c:739
void ad7124_update_crcsetting(struct ad7124_dev *dev)
Updates the CRC settings.
Definition ad7124.c:467
int32_t ad7124_write_register(struct ad7124_dev *dev, struct ad7124_st_reg reg)
Writes the value of the specified register only when the device is ready to accept user requests....
Definition ad7124.c:218
ad7124_pga
PGA gains.
Definition ad7124.h:398
@ AD7124_PGA_128
Definition ad7124.h:406
@ AD7124_PGA_4
Definition ad7124.h:401
@ AD7124_PGA_32
Definition ad7124.h:404
@ AD7124_PGA_64
Definition ad7124.h:405
@ AD7124_PGA_8
Definition ad7124.h:402
@ AD7124_PGA_2
Definition ad7124.h:400
@ AD7124_PGA_1
Definition ad7124.h:399
@ AD7124_PGA_16
Definition ad7124.h:403
int ad7124_set_pga(struct ad7124_dev *device, enum ad7124_pga pga, uint8_t setup_id)
Select the PGA Gain.
Definition ad7124.c:988
void ad7124_update_dev_spi_settings(struct ad7124_dev *dev)
Updates the device SPI interface settings.
Definition ad7124.c:487
int32_t ad7124_fclk_get(struct ad7124_dev *dev, float *f_clk)
Get the AD7124 reference clock.
Definition ad7124.c:508
int ad7124_assign_setup(struct ad7124_dev *device, uint8_t ch_no, uint8_t setup)
Assign Setup to Channel.
Definition ad7124.c:807
#define AD7124_MAX_SETUPS
Definition ad7124.h:47
int ad7124_set_burnout(struct ad7124_dev *device, enum ad7124_burnout burnout, uint8_t setup_id)
Set the Magnitude of the Burnout Detect Current Source.
Definition ad7124.c:865
int32_t ad7124_write_register2(struct ad7124_dev *dev, uint32_t reg, uint32_t writeval)
Wrap the write register function to give it a modern signature.
Definition ad7124.c:241
int32_t ad7124_setup(struct ad7124_dev **device, struct ad7124_init_param *init_param)
Initializes the AD7124.
Definition ad7124.c:1037
int ad7124_set_power_mode(struct ad7124_dev *device, enum ad7124_power_mode mode)
Select the Power Mode.
Definition ad7124.c:1013
ad7124_reference_source
Type of ADC Reference.
Definition ad7124.h:381
@ MAX_REF_SOURCES
Definition ad7124.h:391
@ AVDD_AVSS
Definition ad7124.h:389
@ EXTERNAL_REFIN1
Definition ad7124.h:383
@ EXTERNAL_REFIN2
Definition ad7124.h:385
@ INTERNAL_REF
Definition ad7124.h:387
int32_t ad7124_reset(struct ad7124_dev *dev)
Resets the device.
Definition ad7124.c:255
uint8_t AD7124_ComputeXOR8(uint8_t *p_buf, uint8_t buf_size)
#define AD7124_MAX_CHANNELS
Definition ad7124.h:49
int32_t ad7124_remove(struct ad7124_dev *dev)
Free the resources allocated by ad7124_setup().
Definition ad7124.c:1187
int32_t ad7124_read_register2(struct ad7124_dev *dev, uint32_t reg, uint32_t *readval)
Wrap the read register function to give it a modern signature.
Definition ad7124.c:194
int32_t ad7124_wait_for_conv_ready(struct ad7124_dev *dev, uint32_t timeout)
Waits until a new conversion result is available.
Definition ad7124.c:359
ad7124_burnout
Burnout current values.
Definition ad7124.h:366
@ AD7124_BURNOUT_2U
Definition ad7124.h:372
@ AD7124_BURNOUT_OFF
Definition ad7124.h:368
@ AD7124_BURNOUT_500N
Definition ad7124.h:370
@ AD7124_BURNOUT_4U
Definition ad7124.h:374
int32_t ad7124_no_check_read_register(struct ad7124_dev *dev, struct ad7124_st_reg *p_reg)
Reads the value of the specified register without checking if the device is ready to accept user requ...
Definition ad7124.c:57
int ad7124_reg_write_msk(struct ad7124_dev *dev, uint32_t reg_addr, uint32_t data, uint32_t mask)
SPI internal register write to device using a mask.
Definition ad7124.c:689
int ad7124_enable_buffers(struct ad7124_dev *device, bool ain_buff, bool ref_buff, uint8_t setup_id)
Enable Input Buffer.
Definition ad7124.c:939
ad7124_mode
ADC Modes of Operation.
Definition ad7124.h:293
@ AD7124_SINGLE
Definition ad7124.h:295
@ AD7124_IN_FULL_SCALE_GAIN
Definition ad7124.h:300
@ AD7124_IN_ZERO_SCALE_OFF
Definition ad7124.h:299
@ AD7124_STANDBY
Definition ad7124.h:296
@ ADC_MAX_MODES
Definition ad7124.h:303
@ AD7124_CONTINUOUS
Definition ad7124.h:294
@ AD7124_SYS_ZERO_SCALE_GAIN
Definition ad7124.h:302
@ AD7124_IDLE
Definition ad7124.h:298
@ AD7124_POWER_DOWN
Definition ad7124.h:297
@ AD7124_SYS_ZERO_SCALE_OFF
Definition ad7124.h:301
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Header file of Delay functions.
Header file of SPI Interface.
Header file of utility functions.
Channel mapping.
Definition ad7124.h:356
uint8_t setup_sel
Definition ad7124.h:358
struct ad7124_analog_inputs ain
Definition ad7124.h:359
bool channel_enable
Definition ad7124.h:357
Channel setup.
Definition ad7124.h:413
enum ad7124_pga pga
Definition ad7124.h:419
enum ad7124_burnout burnout
Definition ad7124.h:415
bool ref_buff
Definition ad7124.h:416
bool ain_buff
Definition ad7124.h:417
enum ad7124_reference_source ref_source
Definition ad7124.h:418
bool bi_unipolar
Definition ad7124.h:414
Device Structure.
Definition ad7124.h:506
enum ad7124_mode mode
Definition ad7124.h:514
int16_t check_ready
Definition ad7124.h:512
struct ad7124_channel_setup setups[AD7124_MAX_SETUPS]
Definition ad7124.h:522
struct no_os_spi_desc * spi_desc
Definition ad7124.h:508
int16_t use_crc
Definition ad7124.h:511
enum ad7124_power_mode power_mode
Definition ad7124.h:520
int16_t spi_rdy_poll_cnt
Definition ad7124.h:513
enum ad7124_device_type active_device
Definition ad7124.h:516
struct ad7124_st_reg * regs
Definition ad7124.h:510
struct ad7124_channel_map chan_map[AD7124_MAX_CHANNELS]
Definition ad7124.h:524
bool ref_en
Definition ad7124.h:518
int16_t use_crc
Definition ad7124.h:532
int16_t spi_rdy_poll_cnt
Definition ad7124.h:534
struct no_os_spi_init_param * spi_init
Definition ad7124.h:529
int16_t check_ready
Definition ad7124.h:533
enum ad7124_mode mode
Definition ad7124.h:535
struct ad7124_channel_setup setups[AD7124_MAX_SETUPS]
Definition ad7124.h:543
struct ad7124_channel_map chan_map[AD7124_MAX_CHANNELS]
Definition ad7124.h:545
enum ad7124_power_mode power_mode
Definition ad7124.h:541
bool ref_en
Definition ad7124.h:539
enum ad7124_device_type active_device
Definition ad7124.h:537
struct ad7124_st_reg * regs
Definition ad7124.h:531
int32_t addr
Definition ad7124.h:434
int32_t size
Definition ad7124.h:436
int32_t rw
Definition ad7124.h:437
int32_t value
Definition ad7124.h:435
Definition ad9361_util.h:63
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128