Go to the documentation of this file.
34 #ifndef SRC_AD77681_H_
35 #define SRC_AD77681_H_
42 #define AD77681_REG_CHIP_TYPE 0x3
43 #define AD77681_REG_PROD_ID_L 0x4
44 #define AD77681_REG_PROD_ID_H 0x5
45 #define AD77681_REG_CHIP_GRADE 0x6
46 #define AD77681_REG_SCRATCH_PAD 0x0A
47 #define AD77681_REG_VENDOR_L 0x0C
48 #define AD77681_REG_VENDOR_H 0x0D
49 #define AD77681_REG_INTERFACE_FORMAT 0x14
50 #define AD77681_REG_POWER_CLOCK 0x15
51 #define AD77681_REG_ANALOG 0x16
52 #define AD77681_REG_ANALOG2 0x17
53 #define AD77681_REG_CONVERSION 0x18
54 #define AD77681_REG_DIGITAL_FILTER 0x19
55 #define AD77681_REG_SINC3_DEC_RATE_MSB 0x1A
56 #define AD77681_REG_SINC3_DEC_RATE_LSB 0x1B
57 #define AD77681_REG_DUTY_CYCLE_RATIO 0x1C
58 #define AD77681_REG_SYNC_RESET 0x1D
59 #define AD77681_REG_GPIO_CONTROL 0x1E
60 #define AD77681_REG_GPIO_WRITE 0x1F
61 #define AD77681_REG_GPIO_READ 0x20
62 #define AD77681_REG_OFFSET_HI 0x21
63 #define AD77681_REG_OFFSET_MID 0x22
64 #define AD77681_REG_OFFSET_LO 0x23
65 #define AD77681_REG_GAIN_HI 0x24
66 #define AD77681_REG_GAIN_MID 0x25
67 #define AD77681_REG_GAIN_LO 0x26
68 #define AD77681_REG_SPI_DIAG_ENABLE 0x28
69 #define AD77681_REG_ADC_DIAG_ENABLE 0x29
70 #define AD77681_REG_DIG_DIAG_ENABLE 0x2A
71 #define AD77681_REG_ADC_DATA 0x2C
72 #define AD77681_REG_MASTER_STATUS 0x2D
73 #define AD77681_REG_SPI_DIAG_STATUS 0x2E
74 #define AD77681_REG_ADC_DIAG_STATUS 0x2F
75 #define AD77681_REG_DIG_DIAG_STATUS 0x30
76 #define AD77681_REG_MCLK_COUNTER 0x31
79 #define AD77681_INTERFACE_CRC_EN_MSK (0x1 << 6)
80 #define AD77681_INTERFACE_CRC_EN(x) (((x) & 0x1) << 6)
81 #define AD77681_INTERFACE_CRC_TYPE_MSK (0x1 << 5)
82 #define AD77681_INTERFACE_CRC_TYPE(x) (((x) & 0x1) << 5)
83 #define AD77681_INTERFACE_STATUS_EN_MSK (0x1 << 4)
84 #define AD77681_INTERFACE_STATUS_EN(x) (((x) & 0x1) << 4)
85 #define AD77681_INTERFACE_CONVLEN_MSK (0x1 << 3)
86 #define AD77681_INTERFACE_CONVLEN(x) (((x) & 0x1) << 3)
87 #define AD77681_INTERFACE_RDY_EN_MSK (0x1 << 2)
88 #define AD77681_INTERFACE_RDY_EN(x) (((x) & 0x1) << 3)
89 #define AD77681_INTERFACE_CONT_READ_MSK (0x1 << 0)
90 #define AD77681_INTERFACE_CONT_READ_EN(x) (((x) & 0x1) << 0)
91 #define AD77681_REG_COEFF_CONTROL 0x32
92 #define AD77681_REG_COEFF_DATA 0x33
93 #define AD77681_REG_ACCESS_KEY 0x34
96 #define AD77681_SCRATCHPAD_MSK (0xFF << 0)
97 #define AD77681_SCRATCHPAD(x) (((x) & 0xFF) << 0)
100 #define AD77681_POWER_CLK_PWRMODE_MSK 0x3
101 #define AD77681_POWER_CLK_PWRMODE(x) (((x) & 0x3) << 0)
102 #define AD77681_POWER_CLK_MOD_OUT_MSK (0x1 << 2)
103 #define AD77681_POWER_CLK_MOD_OUT(x) (((x) & 0x1) << 2)
104 #define AD77681_POWER_CLK_POWER_DOWN 0x08
105 #define AD77681_POWER_CLK_MCLK_DIV_MSK (0x3 << 4)
106 #define AD77681_POWER_CLK_MCLK_DIV(x) (((x) & 0x3) << 4)
107 #define AD77681_POWER_CLK_CLOCK_SEL_MSK (0x3 << 6)
108 #define AD77681_POWER_CLK_CLOCK_SEL(x) (((x) & 0x3) << 6)
111 #define AD77681_CONVERSION_DIAG_MUX_MSK (0xF << 4)
112 #define AD77681_CONVERSION_DIAG_MUX_SEL(x) (((x) & 0xF) << 4)
113 #define AD77681_CONVERSION_DIAG_SEL_MSK (0x1 << 3)
114 #define AD77681_CONVERSION_DIAG_SEL(x) (((x) & 0x1) << 3)
115 #define AD77681_CONVERSION_MODE_MSK (0x7 << 0)
116 #define AD77681_CONVERSION_MODE(x) (((x) & 0x7) << 0)
119 #define AD77681_ANALOG_REF_BUF_POS_MSK (0x3 << 6)
120 #define AD77681_ANALOG_REF_BUF_POS(x) (((x) & 0x3) << 6)
121 #define AD77681_ANALOG_REF_BUF_NEG_MSK (0x3 << 4)
122 #define AD77681_ANALOG_REF_BUF_NEG(x) (((x) & 0x3) << 4)
123 #define AD77681_ANALOG_AIN_BUF_POS_OFF_MSK (0x1 << 1)
124 #define AD77681_ANALOG_AIN_BUF_POS_OFF(x) (((x) & 0x1) << 1)
125 #define AD77681_ANALOG_AIN_BUF_NEG_OFF_MSK (0x1 << 0)
126 #define AD77681_ANALOG_AIN_BUF_NEG_OFF(x) (((x) & 0x1) << 0)
129 #define AD77681_ANALOG2_VCM_MSK (0x7 << 0)
130 #define AD77681_ANALOG2_VCM(x) (((x) & 0x7) << 0)
133 #define AD77681_DIGI_FILTER_60HZ_REJ_EN_MSK (0x1 << 7)
134 #define AD77681_DIGI_FILTER_60HZ_REJ_EN(x) (((x) & 0x1) << 7)
135 #define AD77681_DIGI_FILTER_FILTER_MSK (0x7 << 4)
136 #define AD77681_DIGI_FILTER_FILTER(x) (((x) & 0x7) << 4)
137 #define AD77681_DIGI_FILTER_DEC_RATE_MSK (0x7 << 0)
138 #define AD77681_DIGI_FILTER_DEC_RATE(x) (((x) & 0x7) << 0)
141 #define AD77681_SINC3_DEC_RATE_MSB_MSK (0x0F << 0)
142 #define AD77681_SINC3_DEC_RATE_MSB(x) (((x) & 0x0F) << 0)
145 #define AD77681_SINC3_DEC_RATE_LSB_MSK (0xFF << 0)
146 #define AD77681_SINC3_DEC_RATE_LSB(x) (((x) & 0xFF) << 0)
149 #define AD77681_DC_RATIO_IDLE_TIME_MSK (0xFF << 0)
150 #define AD77681_DC_RATIO_IDLE_TIME(x) (((x) & 0xFF) << 0)
153 #define AD77681_SYNC_RST_SPI_STARTB_MSK (0x1 << 7)
154 #define AD77681_SYNC_RST_SPI_STARTB(x) (((x) & 0x1) << 7)
155 #define AD77681_SYNC_RST_SYNCOUT_EDGE_MSK (0x1 << 6)
156 #define AD77681_SYNC_RST_SYNCOUT_EDGE(x) (((x) & 0x1) << 6)
157 #define AD77681_SYNC_RST_GPIO_START_EN_MSK (0x1 << 3)
158 #define AD77681_SYNC_RST_GPIO_START_EN(x) (((x) & 0x1) << 3)
159 #define AD77681_SYNC_RST_SPI_RESET_MSK (0x3 << 0)
160 #define AD77681_SYNC_RST_SPI_RESET(x) (((x) & 0x3) << 0)
163 #define AD77681_GPIO_CNTRL_UGPIO_EN_MSK (0x1 << 7)
164 #define AD77681_GPIO_CNTRL_UGPIO_EN(x) (((x) & 0x1) << 7)
165 #define AD77681_GPIO_CNTRL_GPIO2_OD_EN_MSK (0x1 << 6)
166 #define AD77681_GPIO_CNTRL_GPIO2_OD_EN(x) (((x) & 0x1) << 6)
167 #define AD77681_GPIO_CNTRL_GPIO1_OD_EN_MSK (0x1 << 5)
168 #define AD77681_GPIO_CNTRL_GPIO1_OD_EN(x) (((x) & 0x1) << 5)
169 #define AD77681_GPIO_CNTRL_GPIO0_OD_EN_MSK (0x1 << 4)
170 #define AD77681_GPIO_CNTRL_GPIO0_OD_EN(x) (((x) & 0x1) << 4)
171 #define AD77681_GPIO_CNTRL_ALL_GPIOS_OD_EN_MSK (0x7 << 4)
172 #define AD77681_GPIO_CNTRL_ALL_GPIOS_OD_EN(x) (((x) & 0x7) << 4)
173 #define AD77681_GPIO_CNTRL_GPIO3_OP_EN_MSK (0x1 << 3)
174 #define AD77681_GPIO_CNTRL_GPIO3_OP_EN(x) (((x) & 0x1) << 3)
175 #define AD77681_GPIO_CNTRL_GPIO2_OP_EN_MSK (0x1 << 2)
176 #define AD77681_GPIO_CNTRL_GPIO2_OP_EN(x) (((x) & 0x1) << 2)
177 #define AD77681_GPIO_CNTRL_GPIO1_OP_EN_MSK (0x1 << 1)
178 #define AD77681_GPIO_CNTRL_GPIO1_OP_EN(x) (((x) & 0x1) << 1)
179 #define AD77681_GPIO_CNTRL_GPIO0_OP_EN_MSK (0x1 << 0)
180 #define AD77681_GPIO_CNTRL_GPIO0_OP_EN(x) (((x) & 0x1) << 0)
181 #define AD77681_GPIO_CNTRL_ALL_GPIOS_OP_EN_MSK (0xF << 0)
182 #define AD77681_GPIO_CNTRL_ALL_GPIOS_OP_EN(x) (((x) & 0xF) << 0)
185 #define AD77681_GPIO_WRITE_3_MSK (0x1 << 3)
186 #define AD77681_GPIO_WRITE_3(x) (((x) & 0x1) << 3)
187 #define AD77681_GPIO_WRITE_2_MSK (0x1 << 2)
188 #define AD77681_GPIO_WRITE_2(x) (((x) & 0x1) << 2)
189 #define AD77681_GPIO_WRITE_1_MSK (0x1 << 1)
190 #define AD77681_GPIO_WRITE_1(x) (((x) & 0x1) << 1)
191 #define AD77681_GPIO_WRITE_0_MSK (0x1 << 0)
192 #define AD77681_GPIO_WRITE_0(x) (((x) & 0x1) << 0)
193 #define AD77681_GPIO_WRITE_ALL_MSK (0xF << 0)
194 #define AD77681_GPIO_WRITE_ALL(x) (((x) & 0xF))
197 #define AD77681_GPIO_READ_3_MSK (0x1 << 3)
198 #define AD77681_GPIO_READ_2_MSK (0x1 << 2)
199 #define AD77681_GPIO_READ_1_MSK (0x1 << 1)
200 #define AD77681_GPIO_READ_0_MSK (0x1 << 0)
201 #define AD77681_GPIO_READ_ALL_MSK (0xF << 0)
204 #define AD77681_OFFSET_HI_MSK (0xFF << 0)
205 #define AD77681_OFFSET_HI(x) (((x) & 0xFF) << 0)
208 #define AD77681_OFFSET_MID_MSK (0xFF << 0)
209 #define AD77681_OFFSET_MID(x) (((x) & 0xFF) << 0)
212 #define AD77681_OFFSET_LO_MSK (0xFF << 0)
213 #define AD77681_OFFSET_LO(x) (((x) & 0xFF) << 0)
216 #define AD77681_GAIN_HI_MSK (0xFF << 0)
217 #define AD77681_GAIN_HI(x) (((x) & 0xFF) << 0)
220 #define AD77681_GAIN_MID_MSK (0xFF << 0)
221 #define AD77681_GAIN_MID(x) (((x) & 0xFF) << 0)
224 #define AD77681_GAIN_LOW_MSK (0xFF << 0)
225 #define AD77681_GAIN_LOW(x) (((x) & 0xFF) << 0)
228 #define AD77681_SPI_DIAG_ERR_SPI_IGNORE_MSK (0x1 << 4)
229 #define AD77681_SPI_DIAG_ERR_SPI_IGNORE(x) (((x) & 0x1) << 4)
230 #define AD77681_SPI_DIAG_ERR_SPI_CLK_CNT_MSK (0x1 << 3)
231 #define AD77681_SPI_DIAG_ERR_SPI_CLK_CNT(x) (((x) & 0x1) << 3)
232 #define AD77681_SPI_DIAG_ERR_SPI_RD_MSK (0x1 << 2)
233 #define AD77681_SPI_DIAG_ERR_SPI_RD(x) (((x) & 0x1) << 2)
234 #define AD77681_SPI_DIAG_ERR_SPI_WR_MSK (0x1 << 1)
235 #define AD77681_SPI_DIAG_ERR_SPI_WR(x) (((x) & 0x1) << 1)
238 #define AD77681_ADC_DIAG_ERR_DLDO_PSM_MSK (0x1 << 5)
239 #define AD77681_ADC_DIAG_ERR_DLDO_PSM(x) (((x) & 0x1) << 5)
240 #define AD77681_ADC_DIAG_ERR_ALDO_PSM_MSK (0x1 << 4)
241 #define AD77681_ADC_DIAG_ERR_ALDO_PSM(x) (((x) & 0x1) << 4)
242 #define AD77681_ADC_DIAG_ERR_FILT_SAT_MSK (0x1 << 2)
243 #define AD77681_ADC_DIAG_ERR_FILT_SAT(x) (((x) & 0x1) << 2)
244 #define AD77681_ADC_DIAG_ERR_FILT_NOT_SET_MSK (0x1 << 1)
245 #define AD77681_ADC_DIAG_ERR_FILT_NOT_SET(x) (((x) & 0x1) << 1)
246 #define AD77681_ADC_DIAG_ERR_EXT_CLK_QUAL_MSK (0x1 << 0)
247 #define AD77681_ADC_DIAG_ERR_EXT_CLK_QUAL(x) (((x) & 0x1) << 0)
250 #define AD77681_DIG_DIAG_ERR_MEMMAP_CRC_MSK (0x1 << 4)
251 #define AD77681_DIG_DIAG_ERR_MEMMAP_CRC(x) (((x) & 0x1) << 4)
252 #define AD77681_DIG_DIAG_ERR_RAM_CRC_MSK (0x1 << 3)
253 #define AD77681_DIG_DIAG_ERR_RAM_CRC(x) (((x) & 0x1) << 3)
254 #define AD77681_DIG_DIAG_ERR_FUSE_CRC_MSK (0x1 << 2)
255 #define AD77681_DIG_DIAG_ERR_FUSE_CRC(x) (((x) & 0x1) << 2)
256 #define AD77681_DIG_DIAG_FREQ_COUNT_EN_MSK (0x1 << 0)
257 #define AD77681_DIG_DIAG_FREQ_COUNT_EN(x) (((x) & 0x1) << 0)
260 #define AD77681_MASTER_ERROR_MSK (0x1 << 7)
261 #define AD77681_MASTER_ADC_ERROR_MSK (0x1 << 6)
262 #define AD77681_MASTER_DIG_ERROR_MSK (0x1 << 5)
263 #define AD77681_MASTER_DIG_ERR_EXT_CLK_MSK (0x1 << 4)
264 #define AD77681_MASTER_FILT_SAT_MSK (0x1 << 3)
265 #define AD77681_MASTER_FILT_NOT_SET_MSK (0x1 << 2)
266 #define AD77681_MASTER_SPI_ERROR_MSK (0x1 << 1)
267 #define AD77681_MASTER_POR_FLAG_MSK (0x1 << 0)
270 #define AD77681_SPI_IGNORE_ERROR_MSK (0x1 << 4)
271 #define AD77681_SPI_IGNORE_ERROR_CLR(x) (((x) & 0x1) << 4)
272 #define AD77681_SPI_CLK_CNT_ERROR_MSK (0x1 << 3)
273 #define AD77681_SPI_READ_ERROR_MSK (0x1 << 2)
274 #define AD77681_SPI_READ_ERROR_CLR(x) (((x) & 0x1) << 2)
275 #define AD77681_SPI_WRITE_ERROR_MSK (0x1 << 1)
276 #define AD77681_SPI_WRITE_ERROR_CLR(x) (((x) & 0x1) << 1)
277 #define AD77681_SPI_CRC_ERROR_MSK (0x1 << 0)
278 #define AD77681_SPI_CRC_ERROR_CLR(x) (((x) & 0x1) << 0)
281 #define AD77681_ADC_DLDO_PSM_ERROR_MSK (0x1 << 5)
282 #define AD77681_ADC_ALDO_PSM_ERROR_MSK (0x1 << 4)
283 #define AD77681_ADC_REF_DET_ERROR_MSK (0x1 << 3)
284 #define AD77681_ADC_FILT_SAT_MSK (0x1 << 2)
285 #define AD77681_ADC_FILT_NOT_SET_MSK (0x1 << 1)
286 #define AD77681_ADC_DIG_ERR_EXT_CLK_MSK (0x1 << 0)
289 #define AD77681_DIG_MEMMAP_CRC_ERROR_MSK (0x1 << 4)
290 #define AD77681_DIG_RAM_CRC_ERROR_MSK (0x1 << 3)
291 #define AD77681_DIG_FUS_CRC_ERROR_MSK (0x1 << 2)
294 #define AD77681_MCLK_COUNTER_MSK (0xFF << 0)
295 #define AD77681_MCLK_COUNTER(x) (((x) & 0xFF) << 0)
298 #define AD77681_COEF_CONTROL_COEFFACCESSEN_MSK (0x1 << 7)
299 #define AD77681_COEF_CONTROL_COEFFACCESSEN(x) (((x) & 0x1) << 7)
300 #define AD77681_COEF_CONTROL_COEFFWRITEEN_MSK (0x1 << 6)
301 #define AD77681_COEF_CONTROL_COEFFWRITEEN(x) (((x) & 0x1) << 6)
302 #define AD77681_COEF_CONTROL_COEFFADDR_MSK (0x3F << 5)
303 #define AD77681_COEF_CONTROL_COEFFADDR(x) (((x) & 0x3F) << 5)
306 #define AD77681_COEFF_DATA_USERCOEFFEN_MSK (0x1 << 23)
307 #define AD77681_COEFF_DATA_USERCOEFFEN(x) (((x) & 0x1) << 23)
308 #define AD77681_COEFF_DATA_COEFFDATA_MSK (0x7FFFFF << 22)
309 #define AD77681_COEFF_DATA_COEFFDATA(x) (((x) & 0x7FFFFF) << 22)
312 #define AD77681_ACCESS_KEY_MSK (0xFF << 0)
313 #define AD77681_ACCESS_KEY(x) (((x) & 0xFF) << 0)
314 #define AD77681_ACCESS_KEY_CHECK_MSK (0x1 << 0)
316 #define AD77681_REG_READ(x) ( (1 << 6) | (x & 0xFF) ) // Read from register x
317 #define AD77681_REG_WRITE(x) ( (~(1 << 6)) & (x & 0xFF) ) // Write to register x
320 #define AD77681_CRC8_POLY 0x07 // x^8 + x^2 + x^1 + x^0
323 #define INITIAL_CRC_CRC8 0x03
324 #define INITIAL_CRC_XOR 0x6C
325 #define INITIAL_CRC 0x00
331 #define EXIT_CONT_READ 0x6C
333 #define AD7768_N_BITS 24
335 #define AD7768_FULL_SCALE (1 << AD7768_N_BITS)
337 #define AD7768_HALF_SCALE (1 << (AD7768_N_BITS - 1))
637 uint16_t *data_buffer);
671 uint16_t *sinc3_dec_reg,
#define AD77681_SCRATCHPAD_MSK
Definition: ad77681.h:96
@ AD77681_FIR
Definition: ad77681.h:395
int32_t ad77681_data_to_voltage(struct ad77681_dev *dev, uint32_t *raw_code, double *voltage)
Definition: ad77681.c:406
int32_t ad77681_clear_error_flags(struct ad77681_dev *dev)
Definition: ad77681.c:1581
#define AD77681_DIG_DIAG_ERR_MEMMAP_CRC_MSK
Definition: ad77681.h:250
Definition: ad77681.h:490
#define AD77681_GAIN_MID(x)
Definition: ad77681.h:221
Definition: ad77681.h:522
bool adc_filt_not_settled
Definition: ad77681.h:503
#define AD77681_GPIO_WRITE_ALL_MSK
Definition: ad77681.h:193
#define AD77681_ANALOG_REF_BUF_NEG_MSK
Definition: ad77681.h:121
@ AD77681_GLOBAL_GPIO_DISABLE
Definition: ad77681.h:460
#define AD7768_FULL_SCALE
Definition: ad77681.h:335
#define AD77681_REG_COEFF_DATA
Definition: ad77681.h:92
#define AD77681_GPIO_WRITE_2_MSK
Definition: ad77681.h:187
#define AD77681_DIG_DIAG_FREQ_COUNT_EN_MSK
Definition: ad77681.h:256
#define AD77681_REG_DIG_DIAG_STATUS
Definition: ad77681.h:75
int32_t ad77681_initiate_sync(struct ad77681_dev *dev)
Definition: ad77681.c:1057
int32_t ad77681_gpio_write(struct ad77681_dev *dev, uint8_t value, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1371
int32_t ad77681_error_flags_enabe(struct ad77681_dev *dev)
Definition: ad77681.c:1614
int32_t ad77681_setup(struct ad77681_dev **device, struct ad77681_init_param init_param, struct ad77681_status_registers **status)
Definition: ad77681.c:1746
@ AD77681_SOFT_RESET
Definition: ad77681.h:416
#define AD77681_GPIO_CNTRL_GPIO2_OP_EN(x)
Definition: ad77681.h:176
#define AD77681_MASTER_FILT_NOT_SET_MSK
Definition: ad77681.h:265
bool fuse_crc_error
Definition: ad77681.h:519
int32_t ad77681_power_down(struct ad77681_dev *dev, enum ad77681_sleep_wake sleep_wake)
Definition: ad77681.c:866
#define AD77681_MASTER_ERROR_MSK
Definition: ad77681.h:260
int32_t ad77681_spi_reg_write(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: ad77681.c:157
#define AD77681_MASTER_POR_FLAG_MSK
Definition: ad77681.h:267
#define AD77681_ACCESS_KEY_CHECK_MSK
Definition: ad77681.h:314
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 AD77681_CONVERSION_DIAG_SEL(x)
Definition: ad77681.h:114
int32_t ad77681_initiate_sync(struct ad77681_dev *dev)
Definition: ad77681.c:1057
#define AD77681_SYNC_RST_SPI_STARTB(x)
Definition: ad77681.h:154
bool spi_ignore
Definition: ad77681.h:506
#define AD77681_GPIO_CNTRL_ALL_GPIOS_OP_EN_MSK
Definition: ad77681.h:181
#define AD77681_OFFSET_MID_MSK
Definition: ad77681.h:208
Definition: ad77681.h:497
int32_t ad77681_setup(struct ad77681_dev **device, struct ad77681_init_param init_param, struct ad77681_status_registers **status)
Definition: ad77681.c:1746
int32_t ad77681_set_crc_sel(struct ad77681_dev *dev, enum ad77681_crc_sel crc_sel)
Definition: ad77681.c:972
int32_t ad77681_spi_read_adc_data(struct ad77681_dev *dev, uint8_t *adc_data, enum ad77681_data_read_mode mode)
Definition: ad77681.c:274
@ AD77681_BUFn_FULL_BUFFER_ON
Definition: ad77681.h:435
#define AD77681_GPIO_CNTRL_GPIO2_OP_EN_MSK
Definition: ad77681.h:175
Header file of SPI Interface.
#define AD77681_OFFSET_LO_MSK
Definition: ad77681.h:212
@ AD77681_TEMP_SENSOR
Definition: ad77681.h:377
#define AD77681_GAIN_LOW_MSK
Definition: ad77681.h:224
ad77681_filter_type
Definition: ad77681.h:390
@ AD77681_AINn_DISABLED
Definition: ad77681.h:422
int32_t ad77681_data_to_voltage(struct ad77681_dev *dev, uint32_t *raw_code, double *voltage)
Definition: ad77681.c:406
#define AD77681_DIG_DIAG_ERR_MEMMAP_CRC(x)
Definition: ad77681.h:251
#define AD77681_GPIO_READ_0_MSK
Definition: ad77681.h:200
#define AD77681_REG_ADC_DIAG_STATUS
Definition: ad77681.h:74
#define AD77681_GPIO_WRITE_1(x)
Definition: ad77681.h:190
int32_t ad77681_scratchpad(struct ad77681_dev *dev, uint8_t *sequence)
Definition: ad77681.c:1500
#define AD77681_REG_GAIN_LO
Definition: ad77681.h:67
@ AD77681_CONTINUOUS_READ_DISABLE
Definition: ad77681.h:480
#define AD77681_REG_GAIN_MID
Definition: ad77681.h:66
@ AD77681_SINC3
Definition: ad77681.h:394
#define AD77681_SPI_DIAG_ERR_SPI_IGNORE(x)
Definition: ad77681.h:229
@ AD77681_SINC5_FIR_DECx512
Definition: ad77681.h:404
#define AD77681_GPIO_CNTRL_GPIO0_OD_EN(x)
Definition: ad77681.h:170
#define AD77681_DIG_DIAG_FREQ_COUNT_EN(x)
Definition: ad77681.h:257
@ AD77681_BUFp_DISABLED
Definition: ad77681.h:441
#define AD77681_REG_GPIO_WRITE
Definition: ad77681.h:60
#define AD77681_ADC_DIAG_ERR_EXT_CLK_QUAL(x)
Definition: ad77681.h:247
#define AD77681_SPI_DIAG_ERR_SPI_IGNORE_MSK
Definition: ad77681.h:228
int32_t ad77681_set_REFn_buffer(struct ad77681_dev *dev, enum ad77681_REFn_buffer REFn)
Definition: ad77681.c:686
#define AD77681_ADC_DIAG_ERR_EXT_CLK_QUAL_MSK
Definition: ad77681.h:246
@ AD77681_FAST
Definition: ad77681.h:348
enum ad77681_crc_sel crc_sel
Definition: ad77681.h:532
#define AD77681_DIGI_FILTER_FILTER_MSK
Definition: ad77681.h:135
#define AD77681_GPIO_WRITE_3(x)
Definition: ad77681.h:186
int32_t ad77681_spi_reg_read(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: ad77681.c:107
int32_t ad77681_set_REFp_buffer(struct ad77681_dev *dev, enum ad77681_REFp_buffer REFp)
Definition: ad77681.c:711
ad77681_sinc5_fir_decimate
Definition: ad77681.h:399
Header file of Delay functions.
int32_t ad77681_CRC_status_handling(struct ad77681_dev *dev, uint16_t *data_buffer)
Definition: ad77681.c:332
#define AD77681_MASTER_DIG_ERROR_MSK
Definition: ad77681.h:262
ad77681_AINp_precharge
Definition: ad77681.h:426
enum ad77681_conv_mode conv_mode
Definition: ad77681.h:554
@ AD77681_BUFn_ENABLED
Definition: ad77681.h:433
int32_t ad77681_error_flags_enabe(struct ad77681_dev *dev)
Definition: ad77681.c:1614
#define AD77681_REG_COEFF_CONTROL
Definition: ad77681.h:91
#define AD77681_ANALOG_REF_BUF_NEG(x)
Definition: ad77681.h:122
#define AD77681_CONVERSION_MODE(x)
Definition: ad77681.h:116
#define AD77681_OFFSET_HI_MSK
Definition: ad77681.h:204
#define AD77681_DIGI_FILTER_60HZ_REJ_EN(x)
Definition: ad77681.h:134
bool adc_err_ext_clk_qual
Definition: ad77681.h:501
@ AD77681_AINp_DISABLED
Definition: ad77681.h:428
#define AD77681_ADC_DIAG_ERR_DLDO_PSM_MSK
Definition: ad77681.h:238
int32_t ad77681_set_REFn_buffer(struct ad77681_dev *dev, enum ad77681_REFn_buffer REFn)
Definition: ad77681.c:686
@ AD77681_GPIO1
Definition: ad77681.h:466
#define AD77681_DIG_DIAG_ERR_FUSE_CRC_MSK
Definition: ad77681.h:254
#define AD77681_SYNC_RST_SPI_RESET_MSK
Definition: ad77681.h:159
enum no_os_spi_mode mode
Definition: no_os_spi.h:148
enum ad77681_filter_type filter
Definition: ad77681.h:565
#define ENABLE
Definition: ad77681.h:339
#define AD77681_REG_SPI_DIAG_ENABLE
Definition: ad77681.h:68
#define AD77681_COEF_CONTROL_COEFFWRITEEN(x)
Definition: ad77681.h:301
@ AD77681_VCM_1_9V
Definition: ad77681.h:450
Definition: ad9361_util.h:69
int32_t ad77681_gpio_open_drain(struct ad77681_dev *dev, enum ad77681_gpios gpio_number, enum ad77681_gpio_output_type output_type)
Definition: ad77681.c:1538
int32_t ad77681_gpio_inout(struct ad77681_dev *dev, uint8_t direction, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1430
enum ad77681_AINn_precharge AINn
Definition: ad77681.h:561
#define AD77681_SPI_DIAG_ERR_SPI_RD_MSK
Definition: ad77681.h:232
#define AD77681_GPIO_CNTRL_GPIO2_OD_EN_MSK
Definition: ad77681.h:165
#define AD77681_GPIO_CNTRL_GPIO0_OD_EN_MSK
Definition: ad77681.h:169
#define AD77681_REG_WRITE(x)
Definition: ad77681.h:317
int32_t ad77681_status(struct ad77681_dev *dev, struct ad77681_status_registers *status)
Definition: ad77681.c:1698
@ AD77681_WAKE
Definition: ad77681.h:411
int32_t ad77681_set_50HZ_rejection(struct ad77681_dev *dev, uint8_t enable)
Definition: ad77681.c:817
int32_t ad77681_set_crc_sel(struct ad77681_dev *dev, enum ad77681_crc_sel crc_sel)
Definition: ad77681.c:972
#define AD77681_REG_DIGITAL_FILTER
Definition: ad77681.h:54
enum ad77681_AINn_precharge AINn
Definition: ad77681.h:535
#define AD77681_REG_CONVERSION
Definition: ad77681.h:53
@ AD77681_POSITIVE_FS
Definition: ad77681.h:379
ad77681_power_mode
Definition: ad77681.h:345
enum ad77681_AINp_precharge AINp
Definition: ad77681.h:562
@ AD77681_SINC5_FIR_DECx128
Definition: ad77681.h:402
@ AD77681_ECO
Definition: ad77681.h:346
int32_t ad77681_set_AINn_buffer(struct ad77681_dev *dev, enum ad77681_AINn_precharge AINn)
Definition: ad77681.c:637
#define AD77681_REG_POWER_CLOCK
Definition: ad77681.h:50
#define AD77681_REG_SPI_DIAG_STATUS
Definition: ad77681.h:73
@ AD77681_CONTINUOUS_DATA_READ
Definition: ad77681.h:486
#define AD77681_GPIO_WRITE_1_MSK
Definition: ad77681.h:189
#define AD77681_MASTER_FILT_SAT_MSK
Definition: ad77681.h:264
uint8_t ad77681_compute_xor(uint8_t *data, uint8_t data_size, uint8_t init_val)
Definition: ad77681.c:84
int32_t ad77681_gpio_open_drain(struct ad77681_dev *dev, enum ad77681_gpios gpio_number, enum ad77681_gpio_output_type output_type)
Definition: ad77681.c:1538
#define AD77681_REG_ANALOG
Definition: ad77681.h:51
int32_t ad77681_gpio_inout(struct ad77681_dev *dev, uint8_t direction, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1430
@ AD77681_CONV_CONTINUOUS
Definition: ad77681.h:359
@ AD77681_NEGATIVE_FS
Definition: ad77681.h:380
#define AD77681_POWER_CLK_POWER_DOWN
Definition: ad77681.h:104
int32_t ad77681_set_filter_type(struct ad77681_dev *dev, enum ad77681_sinc5_fir_decimate decimate, enum ad77681_filter_type filter, uint16_t sinc3_osr)
Definition: ad77681.c:750
@ AD77681_VCM_2_05V
Definition: ad77681.h:449
#define AD77681_REG_ADC_DIAG_ENABLE
Definition: ad77681.h:69
#define AD77681_GPIO_WRITE_3_MSK
Definition: ad77681.h:185
@ AD77681_AIN_SHORT
Definition: ad77681.h:378
ad77681_rdy_dout
Definition: ad77681.h:371
@ AD77681_SINC5_FIR_DECx64
Definition: ad77681.h:401
#define AD77681_GPIO_WRITE_0_MSK
Definition: ad77681.h:191
int32_t ad77681_set_convlen(struct ad77681_dev *dev, enum ad77681_conv_len conv_len)
Definition: ad77681.c:944
#define AD77681_INTERFACE_CONT_READ_MSK
Definition: ad77681.h:89
int32_t ad77681_set_REFp_buffer(struct ad77681_dev *dev, enum ad77681_REFp_buffer REFp)
Definition: ad77681.c:711
int32_t ad77681_set_AINp_buffer(struct ad77681_dev *dev, enum ad77681_AINp_precharge AINp)
Definition: ad77681.c:661
bool ref_det_error
Definition: ad77681.h:513
#define AD77681_REG_MASTER_STATUS
Definition: ad77681.h:72
@ AD77681_GLOBAL_GPIO_ENABLE
Definition: ad77681.h:459
int32_t ad77681_CRC_status_handling(struct ad77681_dev *dev, uint16_t *data_buffer)
Definition: ad77681.c:332
enum ad77681_REFp_buffer REFp
Definition: ad77681.h:564
#define AD77681_REG_INTERFACE_FORMAT
Definition: ad77681.h:49
#define AD77681_REG_OFFSET_LO
Definition: ad77681.h:64
int32_t ad77681_spi_read_mask(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t *data)
Definition: ad77681.c:183
#define AD77681_ADC_DIAG_ERR_FILT_NOT_SET_MSK
Definition: ad77681.h:244
int32_t ad77681_set_mclk_div(struct ad77681_dev *dev, enum ad77681_mclk_div clk_div)
Definition: ad77681.c:583
bool conv_diag_sel
Definition: ad77681.h:530
int32_t ad77681_programmable_filter(struct ad77681_dev *dev, const float *coeffs, uint8_t num_coeffs)
Definition: ad77681.c:1140
int32_t ad77681_set_status_bit(struct ad77681_dev *dev, bool status_bit)
Definition: ad77681.c:1010
int32_t ad77681_set_convlen(struct ad77681_dev *dev, enum ad77681_conv_len conv_len)
Definition: ad77681.c:944
#define AD77681_GPIO_CNTRL_UGPIO_EN_MSK
Definition: ad77681.h:163
int32_t ad77681_set_continuos_read(struct ad77681_dev *dev, enum ad77681_continuous_read continuous_enable)
Definition: ad77681.c:838
int32_t ad77681_set_AINp_buffer(struct ad77681_dev *dev, enum ad77681_AINp_precharge AINp)
Definition: ad77681.c:661
enum ad77681_mclk_div mclk_div
Definition: ad77681.h:527
#define AD77681_REG_OFFSET_HI
Definition: ad77681.h:62
#define AD77681_INTERFACE_STATUS_EN_MSK
Definition: ad77681.h:83
#define AD77681_ANALOG_AIN_BUF_POS_OFF_MSK
Definition: ad77681.h:123
@ AD77681_SINC5_DECx16
Definition: ad77681.h:393
#define AD77681_REG_SINC3_DEC_RATE_LSB
Definition: ad77681.h:56
ad77681_conv_mode
Definition: ad77681.h:358
#define AD77681_POWER_CLK_PWRMODE(x)
Definition: ad77681.h:101
uint16_t vref
Definition: ad77681.h:568
#define AD77681_SPI_DIAG_ERR_SPI_WR(x)
Definition: ad77681.h:235
int32_t ad77681_set_50HZ_rejection(struct ad77681_dev *dev, uint8_t enable)
Definition: ad77681.c:817
enum ad77681_conv_diag_mux diag_mux_sel
Definition: ad77681.h:529
enum ad77681_mclk_div mclk_div
Definition: ad77681.h:553
int32_t ad77681_spi_read_mask(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t *data)
Definition: ad77681.c:183
enum ad77681_conv_len conv_len
Definition: ad77681.h:531
#define AD77681_GPIO_WRITE_ALL(x)
Definition: ad77681.h:194
@ AD77681_AINn_ENABLED
Definition: ad77681.h:421
int32_t ad77681_set_mclk_div(struct ad77681_dev *dev, enum ad77681_mclk_div clk_div)
Definition: ad77681.c:583
enum ad77681_AINp_precharge AINp
Definition: ad77681.h:536
#define AD77681_REG_GAIN_HI
Definition: ad77681.h:65
#define AD77681_OFFSET_LO(x)
Definition: ad77681.h:213
enum ad77681_VCM_out VCM_out
Definition: ad77681.h:560
Header file of the AD7768-1 Driver.
#define AD77681_REG_GPIO_CONTROL
Definition: ad77681.h:59
@ AD77681_VCM_1_1V
Definition: ad77681.h:452
ad77681_gobal_gpio_enable
Definition: ad77681.h:458
enum ad77681_crc_sel crc_sel
Definition: ad77681.h:558
#define AD77681_DIGI_FILTER_DEC_RATE(x)
Definition: ad77681.h:138
bool spi_crc_error
Definition: ad77681.h:510
@ AD77681_RDY_DOUT_DIS
Definition: ad77681.h:373
#define AD77681_REG_ACCESS_KEY
Definition: ad77681.h:93
int32_t ad77681_gpio_read(struct ad77681_dev *dev, uint8_t *value, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1312
bool memoy_map_crc_error
Definition: ad77681.h:517
@ AD77681_VCM_0_9V
Definition: ad77681.h:453
#define AD77681_ACCESS_KEY_MSK
Definition: ad77681.h:312
#define AD77681_INTERFACE_CRC_EN_MSK
Definition: ad77681.h:79
enum ad77681_conv_mode conv_mode
Definition: ad77681.h:528
@ AD77681_BUFp_ENABLED
Definition: ad77681.h:440
#define AD77681_GPIO_CNTRL_GPIO0_OP_EN(x)
Definition: ad77681.h:180
@ AD77681_CONTINUOUS_READ_ENABLE
Definition: ad77681.h:479
uint32_t raw_data[4096]
Definition: ad77681.h:494
@ AD77681_SINC5_FIR_DECx256
Definition: ad77681.h:403
int32_t ad77681_apply_offset(struct ad77681_dev *dev, uint32_t value)
Definition: ad77681.c:1071
uint16_t count
Definition: ad77681.h:492
@ AD77681_GPIO3
Definition: ad77681.h:468
#define AD77681_POWER_CLK_PWRMODE_MSK
Definition: ad77681.h:100
enum ad77681_power_mode power_mode
Definition: ad77681.h:526
int32_t ad77681_set_VCM_output(struct ad77681_dev *dev, enum ad77681_VCM_out VCM_out)
Definition: ad77681.c:613
@ AD77681_GPIO_OPEN_DRAIN
Definition: ad77681.h:474
int32_t ad77681_set_power_mode(struct ad77681_dev *dev, enum ad77681_power_mode mode)
Definition: ad77681.c:557
@ AD77681_VCM_HALF_VCC
Definition: ad77681.h:447
#define AD77681_MASTER_ADC_ERROR_MSK
Definition: ad77681.h:261
ad77681_conv_diag_mux
Definition: ad77681.h:376
@ AD77681_CONV_24BIT
Definition: ad77681.h:367
@ AD77681_HARD_RESET
Definition: ad77681.h:417
@ AD77681_RDY_DOUT_EN
Definition: ad77681.h:372
Definition: ad77681.h:548
ad77681_crc_sel
Definition: ad77681.h:383
int32_t ad77681_apply_gain(struct ad77681_dev *dev, uint32_t value)
Definition: ad77681.c:1105
#define AD77681_REG_SINC3_DEC_RATE_MSB
Definition: ad77681.h:55
enum ad77681_filter_type filter
Definition: ad77681.h:539
#define AD77681_REG_OFFSET_MID
Definition: ad77681.h:63
#define AD77681_GPIO_CNTRL_GPIO0_OP_EN_MSK
Definition: ad77681.h:179
#define AD77681_GPIO_CNTRL_GPIO1_OP_EN(x)
Definition: ad77681.h:178
enum ad77681_sinc5_fir_decimate decimate
Definition: ad77681.h:566
bool conv_diag_sel
Definition: ad77681.h:556
bool spi_read_error
Definition: ad77681.h:508
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
int32_t ad77681_set_conv_mode(struct ad77681_dev *dev, enum ad77681_conv_mode conv_mode, enum ad77681_conv_diag_mux diag_mux_sel, bool conv_diag_sel)
Definition: ad77681.c:905
#define AD77681_SYNC_RST_SPI_STARTB_MSK
Definition: ad77681.h:153
bool spi_error
Definition: ad77681.h:504
#define AD77681_ADC_DIAG_ERR_FILT_NOT_SET(x)
Definition: ad77681.h:245
uint32_t sample_rate
Definition: ad77681.h:570
int32_t ad77681_gpio_write(struct ad77681_dev *dev, uint8_t value, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1371
#define AD77681_COEF_CONTROL_COEFFACCESSEN(x)
Definition: ad77681.h:299
@ AD77681_MCLK_DIV_2
Definition: ad77681.h:355
bool dldo_psm_error
Definition: ad77681.h:511
bool por_flag
Definition: ad77681.h:505
enum ad77681_REFp_buffer REFp
Definition: ad77681.h:538
#define AD77681_DIG_MEMMAP_CRC_ERROR_MSK
Definition: ad77681.h:289
@ AD77681_SLEEP
Definition: ad77681.h:410
#define AD77681_SPI_READ_ERROR_CLR(x)
Definition: ad77681.h:274
#define AD77681_ADC_FILT_NOT_SET_MSK
Definition: ad77681.h:285
#define AD77681_ANALOG_AIN_BUF_POS_OFF(x)
Definition: ad77681.h:124
bool ext_clk_qual_error
Definition: ad77681.h:516
#define AD77681_ANALOG_REF_BUF_POS_MSK
Definition: ad77681.h:119
int32_t ad77681_apply_gain(struct ad77681_dev *dev, uint32_t value)
Definition: ad77681.c:1105
int32_t ad77681_power_down(struct ad77681_dev *dev, enum ad77681_sleep_wake sleep_wake)
Definition: ad77681.c:866
int32_t ad77681_spi_reg_write(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: ad77681.c:157
#define AD77681_SPI_CLK_CNT_ERROR_MSK
Definition: ad77681.h:272
#define AD77681_COEF_CONTROL_COEFFWRITEEN_MSK
Definition: ad77681.h:300
#define AD77681_MASTER_DIG_ERR_EXT_CLK_MSK
Definition: ad77681.h:263
#define AD77681_DIGI_FILTER_FILTER(x)
Definition: ad77681.h:136
#define AD77681_SPI_WRITE_ERROR_CLR(x)
Definition: ad77681.h:276
@ AD77681_CONV_PERIODIC
Definition: ad77681.h:362
ad77681_gpios
Definition: ad77681.h:464
#define AD77681_POWER_CLK_MCLK_DIV(x)
Definition: ad77681.h:106
ad77681_gpio_output_type
Definition: ad77681.h:472
enum ad77681_power_mode power_mode
Definition: ad77681.h:552
@ AD77681_VCM_OFF
Definition: ad77681.h:454
@ AD77681_GPIO0
Definition: ad77681.h:465
ad77681_VCM_out
Definition: ad77681.h:446
#define AD77681_SINC3_DEC_RATE_LSB_MSK
Definition: ad77681.h:145
int32_t ad77681_set_filter_type(struct ad77681_dev *dev, enum ad77681_sinc5_fir_decimate decimate, enum ad77681_filter_type filter, uint16_t sinc3_osr)
Definition: ad77681.c:750
#define AD77681_ANALOG_AIN_BUF_NEG_OFF_MSK
Definition: ad77681.h:125
uint16_t mclk
Definition: ad77681.h:543
#define INITIAL_CRC
Definition: ad77681.h:325
#define AD77681_GPIO_CNTRL_GPIO3_OP_EN(x)
Definition: ad77681.h:174
@ AD77681_BUFp_FULL_BUFFER_ON
Definition: ad77681.h:442
int32_t ad77681_set_power_mode(struct ad77681_dev *dev, enum ad77681_power_mode mode)
Definition: ad77681.c:557
uint16_t mclk
Definition: ad77681.h:569
#define AD77681_SINC3_DEC_RATE_LSB(x)
Definition: ad77681.h:146
#define AD77681_SPI_READ_ERROR_MSK
Definition: ad77681.h:273
ad7761_reset_option
Definition: ad77681.h:415
#define AD77681_REG_READ(x)
Definition: ad77681.h:316
#define AD77681_SINC3_DEC_RATE_MSB_MSK
Definition: ad77681.h:141
#define AD77681_GPIO_WRITE_2(x)
Definition: ad77681.h:188
#define AD77681_INTERFACE_CRC_TYPE_MSK
Definition: ad77681.h:81
#define AD77681_GPIO_READ_3_MSK
Definition: ad77681.h:197
#define AD77681_GPIO_READ_1_MSK
Definition: ad77681.h:199
int32_t ad77681_scratchpad(struct ad77681_dev *dev, uint8_t *sequence)
Definition: ad77681.c:1500
#define AD77681_DIG_DIAG_ERR_FUSE_CRC(x)
Definition: ad77681.h:255
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
#define AD77681_ADC_DIG_ERR_EXT_CLK_MSK
Definition: ad77681.h:286
@ AD77681_MEDIAN
Definition: ad77681.h:347
@ AD77681_REGISTER_DATA_READ
Definition: ad77681.h:485
int32_t ad77681_soft_reset(struct ad77681_dev *dev)
Definition: ad77681.c:1034
uint8_t ad77681_get_frame_byte(struct ad77681_dev *dev)
Definition: ad77681.c:247
#define AD77681_DIG_RAM_CRC_ERROR_MSK
Definition: ad77681.h:290
#define INITIAL_CRC_CRC8
Definition: ad77681.h:323
#define AD77681_POWER_CLK_MCLK_DIV_MSK
Definition: ad77681.h:105
#define AD77681_ANALOG2_VCM(x)
Definition: ad77681.h:130
#define AD77681_INTERFACE_CONT_READ_EN(x)
Definition: ad77681.h:90
int32_t ad77681_spi_reg_read(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: ad77681.c:107
ad77681_AINn_precharge
Definition: ad77681.h:420
uint16_t sinc3_osr
Definition: ad77681.h:567
@ AD77681_CRC
Definition: ad77681.h:384
#define AD77681_SPI_DIAG_ERR_SPI_CLK_CNT(x)
Definition: ad77681.h:231
int32_t ad77681_set_conv_mode(struct ad77681_dev *dev, enum ad77681_conv_mode conv_mode, enum ad77681_conv_diag_mux diag_mux_sel, bool conv_diag_sel)
Definition: ad77681.c:905
bool master_error
Definition: ad77681.h:498
#define AD77681_ADC_DIAG_ERR_FILT_SAT_MSK
Definition: ad77681.h:242
#define AD77681_ADC_FILT_SAT_MSK
Definition: ad77681.h:284
@ AD77681_MCLK_DIV_16
Definition: ad77681.h:352
#define AD77681_GPIO_CNTRL_GPIO1_OD_EN(x)
Definition: ad77681.h:168
@ AD77681_ALL_GPIOS
Definition: ad77681.h:469
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 AD77681_ADC_DIAG_ERR_ALDO_PSM(x)
Definition: ad77681.h:241
#define AD77681_GPIO_CNTRL_ALL_GPIOS_OP_EN(x)
Definition: ad77681.h:182
#define AD77681_GPIO_READ_ALL_MSK
Definition: ad77681.h:201
ad77681_sleep_wake
Definition: ad77681.h:409
enum ad77681_REFn_buffer REFn
Definition: ad77681.h:537
#define AD77681_ADC_ALDO_PSM_ERROR_MSK
Definition: ad77681.h:282
@ AD77681_VCM_1_65V
Definition: ad77681.h:451
#define AD77681_DIG_DIAG_ERR_RAM_CRC(x)
Definition: ad77681.h:253
#define AD77681_REG_SCRATCH_PAD
Definition: ad77681.h:46
#define AD77681_CONVERSION_DIAG_SEL_MSK
Definition: ad77681.h:113
#define AD77681_OFFSET_HI(x)
Definition: ad77681.h:205
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
uint8_t ad77681_get_rx_buf_len(struct ad77681_dev *dev)
Definition: ad77681.c:226
#define AD77681_SPI_CRC_ERROR_CLR(x)
Definition: ad77681.h:278
#define AD77681_ADC_REF_DET_ERROR_MSK
Definition: ad77681.h:283
#define AD77681_COEF_CONTROL_COEFFACCESSEN_MSK
Definition: ad77681.h:298
#define AD77681_CONVERSION_DIAG_MUX_SEL(x)
Definition: ad77681.h:112
@ AD77681_NO_CRC
Definition: ad77681.h:386
#define AD77681_SPI_DIAG_ERR_SPI_CLK_CNT_MSK
Definition: ad77681.h:230
ad77681_REFn_buffer
Definition: ad77681.h:432
#define AD77681_SYNC_RST_SPI_RESET(x)
Definition: ad77681.h:160
#define AD77681_DIGI_FILTER_60HZ_REJ_EN_MSK
Definition: ad77681.h:133
#define AD77681_GPIO_CNTRL_ALL_GPIOS_OD_EN_MSK
Definition: ad77681.h:171
@ AD77681_SINC5_DECx8
Definition: ad77681.h:392
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
#define AD77681_GPIO_CNTRL_GPIO1_OD_EN_MSK
Definition: ad77681.h:167
#define AD77681_ADC_DIAG_ERR_ALDO_PSM_MSK
Definition: ad77681.h:240
#define AD77681_REG_GPIO_READ
Definition: ad77681.h:61
@ AD77681_VCM_2_5V
Definition: ad77681.h:448
bool dig_error
Definition: ad77681.h:500
enum ad77681_conv_len conv_len
Definition: ad77681.h:557
#define AD77681_CRC8_POLY
Definition: ad77681.h:320
#define AD77681_DIG_FUS_CRC_ERROR_MSK
Definition: ad77681.h:291
enum ad77681_sinc5_fir_decimate decimate
Definition: ad77681.h:540
@ AD77681_CONV_ONE_SHOT
Definition: ad77681.h:360
#define AD77681_DIGI_FILTER_DEC_RATE_MSK
Definition: ad77681.h:137
#define AD77681_GPIO_READ_2_MSK
Definition: ad77681.h:198
bool ram_crc_error
Definition: ad77681.h:518
@ AD77681_SINC5_FIR_DECx1024
Definition: ad77681.h:405
int32_t ad77681_update_sample_rate(struct ad77681_dev *dev)
Definition: ad77681.c:429
@ AD77681_MCLK_DIV_4
Definition: ad77681.h:354
int32_t ad77681_global_gpio(struct ad77681_dev *dev, enum ad77681_gobal_gpio_enable gpio_enable)
Definition: ad77681.c:1483
@ AD77681_SINC5_FIR_DECx32
Definition: ad77681.h:400
#define AD77681_SPI_IGNORE_ERROR_CLR(x)
Definition: ad77681.h:271
@ AD77681_CONV_SINGLE
Definition: ad77681.h:361
int32_t ad77681_spi_read_adc_data(struct ad77681_dev *dev, uint8_t *adc_data, enum ad77681_data_read_mode mode)
Definition: ad77681.c:274
#define AD77681_ANALOG_AIN_BUF_NEG_OFF(x)
Definition: ad77681.h:126
#define AD77681_ANALOG_REF_BUF_POS(x)
Definition: ad77681.h:120
uint8_t data_frame_byte
Definition: ad77681.h:545
#define AD77681_GPIO_WRITE_0(x)
Definition: ad77681.h:192
#define AD77681_ADC_DIAG_ERR_FILT_SAT(x)
Definition: ad77681.h:243
uint8_t ad77681_compute_crc8(uint8_t *data, uint8_t data_size, uint8_t init_val)
Definition: ad77681.c:56
#define AD77681_SPI_CRC_ERROR_MSK
Definition: ad77681.h:277
#define AD77681_GAIN_LOW(x)
Definition: ad77681.h:225
#define AD77681_SINC3_DEC_RATE_MSB(x)
Definition: ad77681.h:142
#define AD77681_ANALOG2_VCM_MSK
Definition: ad77681.h:129
#define AD77681_GPIO_CNTRL_ALL_GPIOS_OD_EN(x)
Definition: ad77681.h:172
uint16_t samples
Definition: ad77681.h:493
uint8_t data_frame_byte
Definition: ad77681.h:571
#define AD77681_SPI_DIAG_ERR_SPI_WR_MSK
Definition: ad77681.h:234
#define AD77681_SPI_WRITE_ERROR_MSK
Definition: ad77681.h:275
int32_t ad77681_SINC3_ODR(struct ad77681_dev *dev, uint16_t *sinc3_dec_reg, float sinc3_odr)
Definition: ad77681.c:510
struct no_os_spi_desc * spi_desc
Definition: ad77681.h:524
#define AD77681_GAIN_MID_MSK
Definition: ad77681.h:220
#define AD77681_ADC_DIAG_ERR_DLDO_PSM(x)
Definition: ad77681.h:239
enum ad77681_REFn_buffer REFn
Definition: ad77681.h:563
#define AD77681_GPIO_CNTRL_GPIO1_OP_EN_MSK
Definition: ad77681.h:177
@ AD77681_CONV_16BIT
Definition: ad77681.h:368
#define AD77681_REG_ADC_DATA
Definition: ad77681.h:71
int32_t ad77681_spi_write_mask(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Definition: ad77681.c:205
int32_t ad77681_programmable_filter(struct ad77681_dev *dev, const float *coeffs, uint8_t num_coeffs)
Definition: ad77681.c:1140
#define AD77681_ACCESS_KEY(x)
Definition: ad77681.h:313
@ AD77681_CONV_STANDBY
Definition: ad77681.h:363
int32_t ad77681_set_status_bit(struct ad77681_dev *dev, bool status_bit)
Definition: ad77681.c:1010
uint8_t ad77681_compute_crc8(uint8_t *data, uint8_t data_size, uint8_t init_val)
Definition: ad77681.c:56
#define AD77681_CONVERSION_MODE_MSK
Definition: ad77681.h:115
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
int32_t ad77681_set_continuos_read(struct ad77681_dev *dev, enum ad77681_continuous_read continuous_enable)
Definition: ad77681.c:838
ad77681_conv_len
Definition: ad77681.h:366
bool filt_not_set_error
Definition: ad77681.h:515
@ AD77681_SINC5
Definition: ad77681.h:391
@ AD77681_GPIO_STRONG_DRIVER
Definition: ad77681.h:473
ad77681_continuous_read
Definition: ad77681.h:478
#define AD77681_MASTER_SPI_ERROR_MSK
Definition: ad77681.h:266
uint8_t status_bit
Definition: ad77681.h:533
#define AD77681_INTERFACE_CRC_EN(x)
Definition: ad77681.h:80
#define AD77681_ADC_DLDO_PSM_ERROR_MSK
Definition: ad77681.h:281
@ AD77681_XOR
Definition: ad77681.h:385
#define AD77681_GAIN_HI_MSK
Definition: ad77681.h:216
bool adc_error
Definition: ad77681.h:499
enum ad77681_conv_diag_mux diag_mux_sel
Definition: ad77681.h:555
uint16_t sinc3_osr
Definition: ad77681.h:541
#define AD77681_REG_SYNC_RESET
Definition: ad77681.h:58
#define AD77681_INTERFACE_CONVLEN_MSK
Definition: ad77681.h:85
int32_t ad77681_spi_write_mask(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Definition: ad77681.c:205
#define AD77681_GPIO_CNTRL_GPIO2_OD_EN(x)
Definition: ad77681.h:166
int32_t ad77681_global_gpio(struct ad77681_dev *devices, enum ad77681_gobal_gpio_enable gpio_enable)
Definition: ad77681.c:1483
@ AD77681_GPIO2
Definition: ad77681.h:467
#define AD77681_GAIN_HI(x)
Definition: ad77681.h:217
enum no_os_spi_mode mode
Definition: no_os_spi.h:202
#define AD77681_GPIO_CNTRL_UGPIO_EN(x)
Definition: ad77681.h:164
bool finish
Definition: ad77681.h:491
int32_t ad77681_update_sample_rate(struct ad77681_dev *dev)
Definition: ad77681.c:429
#define AD77681_SCRATCHPAD(x)
Definition: ad77681.h:97
bool adc_filt_saturated
Definition: ad77681.h:502
int32_t ad77681_status(struct ad77681_dev *dev, struct ad77681_status_registers *status)
Definition: ad77681.c:1698
enum ad77681_VCM_out VCM_out
Definition: ad77681.h:534
uint32_t sample_rate
Definition: ad77681.h:544
#define INITIAL_CRC_XOR
Definition: ad77681.h:324
bool aldo_psm_error
Definition: ad77681.h:512
#define AD77681_SPI_DIAG_ERR_SPI_RD(x)
Definition: ad77681.h:233
#define AD77681_SPI_IGNORE_ERROR_MSK
Definition: ad77681.h:270
#define EXIT_CONT_READ
Definition: ad77681.h:331
@ AD77681_MCLK_DIV_8
Definition: ad77681.h:353
#define AD77681_INTERFACE_STATUS_EN(x)
Definition: ad77681.h:84
bool spi_clock_count
Definition: ad77681.h:507
int32_t ad77681_gpio_read(struct ad77681_dev *dev, uint8_t *value, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1312
#define AD77681_OFFSET_MID(x)
Definition: ad77681.h:209
bool spi_write_error
Definition: ad77681.h:509
#define AD77681_INTERFACE_CONVLEN(x)
Definition: ad77681.h:86
int32_t ad77681_set_AINn_buffer(struct ad77681_dev *dev, enum ad77681_AINn_precharge AINn)
Definition: ad77681.c:637
struct no_os_spi_init_param spi_eng_dev_init
Definition: ad77681.h:550
int32_t ad77681_clear_error_flags(struct ad77681_dev *dev)
Definition: ad77681.c:1581
uint8_t ad77681_compute_xor(uint8_t *data, uint8_t data_size, uint8_t init_val)
Definition: ad77681.c:84
#define AD77681_CONVERSION_DIAG_MUX_MSK
Definition: ad77681.h:111
@ AD77681_AINp_ENABLED
Definition: ad77681.h:427
uint16_t vref
Definition: ad77681.h:542
#define AD77681_DIG_DIAG_ERR_RAM_CRC_MSK
Definition: ad77681.h:252
ad77681_REFp_buffer
Definition: ad77681.h:439
@ AD77681_BUFn_DISABLED
Definition: ad77681.h:434
ad77681_data_read_mode
Definition: ad77681.h:484
int32_t ad77681_soft_reset(struct ad77681_dev *dev)
Definition: ad77681.c:1034
bool filt_sat_error
Definition: ad77681.h:514
#define AD77681_REG_DIG_DIAG_ENABLE
Definition: ad77681.h:70
int32_t ad77681_apply_offset(struct ad77681_dev *dev, uint32_t value)
Definition: ad77681.c:1071
int32_t ad77681_SINC3_ODR(struct ad77681_dev *dev, uint16_t *sinc3_dec_reg, float sinc3_odr)
Definition: ad77681.c:510
ad77681_mclk_div
Definition: ad77681.h:351
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
#define AD77681_INTERFACE_CRC_TYPE(x)
Definition: ad77681.h:82
#define AD77681_GPIO_CNTRL_GPIO3_OP_EN_MSK
Definition: ad77681.h:173
int32_t ad77681_set_VCM_output(struct ad77681_dev *dev, enum ad77681_VCM_out VCM_out)
Definition: ad77681.c:613
#define AD77681_REG_ANALOG2
Definition: ad77681.h:52
uint8_t status_bit
Definition: ad77681.h:559