no-OS
ad77681.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef SRC_AD77681_H_
35 #define SRC_AD77681_H_
36 
37 #include "no_os_spi.h"
38 
39 /******************************************************************************/
40 /********************** Macros and Constants Definitions **********************/
41 /******************************************************************************/
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
77 
78 /* AD77681_REG_INTERFACE_FORMAT */
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
94 
95 /* AD77681_REG_SCRATCH_PAD*/
96 #define AD77681_SCRATCHPAD_MSK (0xFF << 0)
97 #define AD77681_SCRATCHPAD(x) (((x) & 0xFF) << 0)
98 
99 /* AD77681_REG_POWER_CLOCK */
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)
109 
110 /* AD77681_CONVERSION_REG */
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)
117 
118 /* AD77681_REG_ANALOG */
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)
127 
128 /* AD77681_REG_ANALOG2 */
129 #define AD77681_ANALOG2_VCM_MSK (0x7 << 0)
130 #define AD77681_ANALOG2_VCM(x) (((x) & 0x7) << 0)
131 
132 /* AD77681_REG_DIGITAL_FILTER */
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)
139 
140 /* AD77681_REG_SINC3_DEC_RATE_MSB */
141 #define AD77681_SINC3_DEC_RATE_MSB_MSK (0x0F << 0)
142 #define AD77681_SINC3_DEC_RATE_MSB(x) (((x) & 0x0F) << 0)
143 
144 /* AD77681_REG_SINC3_DEC_RATE_LSB */
145 #define AD77681_SINC3_DEC_RATE_LSB_MSK (0xFF << 0)
146 #define AD77681_SINC3_DEC_RATE_LSB(x) (((x) & 0xFF) << 0)
147 
148 /* AD77681_REG_DUTY_CYCLE_RATIO */
149 #define AD77681_DC_RATIO_IDLE_TIME_MSK (0xFF << 0)
150 #define AD77681_DC_RATIO_IDLE_TIME(x) (((x) & 0xFF) << 0)
151 
152 /* AD77681_REG_SYNC_RESET */
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)
161 
162 /* AD77681_REG_GPIO_CONTROL */
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)
183 
184 /* AD77681_REG_GPIO_WRITE */
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))
195 
196 /* AD77681_REG_GPIO_READ */
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)
202 
203 /* AD77681_REG_OFFSET_HI */
204 #define AD77681_OFFSET_HI_MSK (0xFF << 0)
205 #define AD77681_OFFSET_HI(x) (((x) & 0xFF) << 0)
206 
207 /* AD77681_REG_OFFSET_MID */
208 #define AD77681_OFFSET_MID_MSK (0xFF << 0)
209 #define AD77681_OFFSET_MID(x) (((x) & 0xFF) << 0)
210 
211 /* AD77681_REG_OFFSET_LO */
212 #define AD77681_OFFSET_LO_MSK (0xFF << 0)
213 #define AD77681_OFFSET_LO(x) (((x) & 0xFF) << 0)
214 
215 /* AD77681_REG_GAIN_HI */
216 #define AD77681_GAIN_HI_MSK (0xFF << 0)
217 #define AD77681_GAIN_HI(x) (((x) & 0xFF) << 0)
218 
219 /* AD77681_REG_GAIN_MID */
220 #define AD77681_GAIN_MID_MSK (0xFF << 0)
221 #define AD77681_GAIN_MID(x) (((x) & 0xFF) << 0)
222 
223 /* AD77681_REG_GAIN_HI */
224 #define AD77681_GAIN_LOW_MSK (0xFF << 0)
225 #define AD77681_GAIN_LOW(x) (((x) & 0xFF) << 0)
226 
227 /* AD77681_REG_SPI_DIAG_ENABLE */
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)
236 
237 /* AD77681_REG_ADC_DIAG_ENABLE */
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)
248 
249 /* AD77681_REG_DIG_DIAG_ENABLE */
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)
258 
259 /* AD77681_REG_MASTER_STATUS */
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)
268 
269 /* AD77681_REG_SPI_DIAG_STATUS */
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)
279 
280 /* AD77681_REG_ADC_DIAG_STATUS */
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)
287 
288 /* AD77681_REG_DIG_DIAG_STATUS */
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)
292 
293 /* AD77681_REG_MCLK_COUNTER */
294 #define AD77681_MCLK_COUNTER_MSK (0xFF << 0)
295 #define AD77681_MCLK_COUNTER(x) (((x) & 0xFF) << 0)
296 
297 /* AD77681_REG_COEFF_CONTROL */
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)
304 
305 /* AD77681_REG_COEFF_DATA */
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)
310 
311 /* AD77681_REG_ACCESS_KEY */
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)
315 
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
318 
319 /* 8-bits wide checksum generated using the polynomial */
320 #define AD77681_CRC8_POLY 0x07 // x^8 + x^2 + x^1 + x^0
321 
322 /* Initial CRC for continuous read mode */
323 #define INITIAL_CRC_CRC8 0x03
324 #define INITIAL_CRC_XOR 0x6C
325 #define INITIAL_CRC 0x00
326 
327 #define CRC_DEBUG
328 
329 /* AD7768-1 */
330 /* A special key for exit the contiuous read mode, taken from the AD7768-1 datasheet */
331 #define EXIT_CONT_READ 0x6C
332 /* Bit resolution of the AD7768-1 */
333 #define AD7768_N_BITS 24
334 /* Full scale of the AD7768-1 = 2^24 = 16777216 */
335 #define AD7768_FULL_SCALE (1 << AD7768_N_BITS)
336 /* Half scale of the AD7768-1 = 2^23 = 8388608 */
337 #define AD7768_HALF_SCALE (1 << (AD7768_N_BITS - 1))
338 
339 #define ENABLE 1
340 #define DISABLE 0
341 
342 /*****************************************************************************/
343 /*************************** Types Declarations *******************************/
344 /******************************************************************************/
349 };
350 
356 };
357 
364 };
365 
369 };
370 
374 };
375 
381 };
382 
387 };
388 
389 /* Filter tye FIR, SINC3, SINC5 */
396 };
397 
398 /* Dectimation ratios for SINC5 and FIR */
406 };
407 
408 /* Sleep / Power up */
412 };
413 
414 /* Reset option */
418 };
419 /* AIN- precharge */
423 };
424 
425 /* AIN+ precharge */
429 };
430 
431 /* REF- buffer */
436 };
437 
438 /* REF+ buffer */
443 };
444 
445 /* VCM output voltage */
455 };
456 
457 /* Global GPIO enable/disable */
461 };
462 
463 /* ADCs GPIO numbering */
470 };
471 
475 };
476 
477 /* Continuous ADC read */
481 };
482 
483 /* ADC data read mode */
487 };
488 
489 /* ADC data structure */
490 struct adc_data {
491  bool finish;
492  uint16_t count;
493  uint16_t samples;
494  uint32_t raw_data[4096];
495 };
496 /* ADC status registers structure */
499  bool adc_error;
500  bool dig_error;
504  bool spi_error;
505  bool por_flag;
520 };
521 
522 struct ad77681_dev {
523  /* SPI */
525  /* Configuration */
533  uint8_t status_bit;
541  uint16_t sinc3_osr;
542  uint16_t vref; /* Reference voltage*/
543  uint16_t mclk; /* Mater clock*/
544  uint32_t sample_rate; /* Sample rate*/
545  uint8_t data_frame_byte; /* SPI 8bit frames*/
546 };
547 
549  /* SPI */
551  /* Configuration */
559  uint8_t status_bit;
567  uint16_t sinc3_osr;
568  uint16_t vref;
569  uint16_t mclk;
570  uint32_t sample_rate;
572 };
573 
574 /******************************************************************************/
575 /************************ Functions Declarations ******************************/
576 /******************************************************************************/
577 uint8_t ad77681_compute_crc8(uint8_t *data,
578  uint8_t data_size,
579  uint8_t init_val);
580 uint8_t ad77681_compute_xor(uint8_t *data,
581  uint8_t data_size,
582  uint8_t init_val);
583 int32_t ad77681_setup(struct ad77681_dev **device,
585  struct ad77681_status_registers **status);
586 int32_t ad77681_spi_reg_read(struct ad77681_dev *dev,
587  uint8_t reg_addr,
588  uint8_t *reg_data);
589 int32_t ad77681_spi_read_mask(struct ad77681_dev *dev,
590  uint8_t reg_addr,
591  uint8_t mask,
592  uint8_t *data);
593 int32_t ad77681_spi_reg_write(struct ad77681_dev *dev,
594  uint8_t reg_addr,
595  uint8_t reg_data);
596 int32_t ad77681_spi_write_mask(struct ad77681_dev *dev,
597  uint8_t reg_addr,
598  uint8_t mask,
599  uint8_t data);
600 int32_t ad77681_set_power_mode(struct ad77681_dev *dev,
601  enum ad77681_power_mode mode);
602 int32_t ad77681_set_mclk_div(struct ad77681_dev *dev,
603  enum ad77681_mclk_div clk_div);
604 int32_t ad77681_spi_read_adc_data(struct ad77681_dev *dev,
605  uint8_t *adc_data,
607 int32_t ad77681_set_conv_mode(struct ad77681_dev *dev,
608  enum ad77681_conv_mode conv_mode,
609  enum ad77681_conv_diag_mux diag_mux_sel,
610  bool conv_diag_sel);
611 int32_t ad77681_set_convlen(struct ad77681_dev *dev,
612  enum ad77681_conv_len conv_len);
613 int32_t ad77681_soft_reset(struct ad77681_dev *dev);
614 int32_t ad77681_initiate_sync(struct ad77681_dev *dev);
615 int32_t ad77681_programmable_filter(struct ad77681_dev *dev,
616  const float *coeffs,
617  uint8_t num_coeffs);
618 int32_t ad77681_gpio_read(struct ad77681_dev *dev,
619  uint8_t *value,
620  enum ad77681_gpios gpio_number);
621 int32_t ad77681_apply_offset(struct ad77681_dev *dev,
622  uint32_t value);
623 int32_t ad77681_apply_gain(struct ad77681_dev *dev,
624  uint32_t value);
625 int32_t ad77681_set_crc_sel(struct ad77681_dev *dev,
626  enum ad77681_crc_sel crc_sel);
627 int32_t ad77681_gpio_open_drain(struct ad77681_dev *dev,
628  enum ad77681_gpios gpio_number,
629  enum ad77681_gpio_output_type output_type);
630 int32_t ad77681_set_continuos_read(struct ad77681_dev *dev,
631  enum ad77681_continuous_read continuous_enable);
632 int32_t ad77681_clear_error_flags(struct ad77681_dev *dev);
633 int32_t ad77681_data_to_voltage(struct ad77681_dev *dev,
634  uint32_t *raw_code,
635  double *voltage);
636 int32_t ad77681_CRC_status_handling(struct ad77681_dev *dev,
637  uint16_t *data_buffer);
638 int32_t ad77681_set_AINn_buffer(struct ad77681_dev *dev,
639  enum ad77681_AINn_precharge AINn);
640 int32_t ad77681_set_AINp_buffer(struct ad77681_dev *dev,
641  enum ad77681_AINp_precharge AINp);
642 int32_t ad77681_set_REFn_buffer(struct ad77681_dev *dev,
643  enum ad77681_REFn_buffer REFn);
644 int32_t ad77681_set_REFp_buffer(struct ad77681_dev *dev,
645  enum ad77681_REFp_buffer REFp);
646 int32_t ad77681_set_filter_type(struct ad77681_dev *dev,
647  enum ad77681_sinc5_fir_decimate decimate,
648  enum ad77681_filter_type filter,
649  uint16_t sinc3_osr);
650 int32_t ad77681_set_50HZ_rejection(struct ad77681_dev *dev,
651  uint8_t enable);
652 int32_t ad77681_power_down(struct ad77681_dev *dev,
653  enum ad77681_sleep_wake sleep_wake);
654 int32_t ad77681_set_status_bit(struct ad77681_dev *dev,
655  bool status_bit);
656 int32_t ad77681_set_VCM_output(struct ad77681_dev *dev,
657  enum ad77681_VCM_out VCM_out);
658 int32_t ad77681_gpio_write(struct ad77681_dev *dev,
659  uint8_t value,
660  enum ad77681_gpios gpio_number);
661 int32_t ad77681_gpio_inout(struct ad77681_dev *dev,
662  uint8_t direction,
663  enum ad77681_gpios gpio_number);
664 int32_t ad77681_global_gpio(struct ad77681_dev *devices,
665  enum ad77681_gobal_gpio_enable gpio_enable);
666 int32_t ad77681_scratchpad(struct ad77681_dev *dev,
667  uint8_t *sequence);
668 int32_t ad77681_error_flags_enabe(struct ad77681_dev *dev);
669 int32_t ad77681_update_sample_rate(struct ad77681_dev *dev);
670 int32_t ad77681_SINC3_ODR(struct ad77681_dev *dev,
671  uint16_t *sinc3_dec_reg,
672  float sinc3_odr);
673 int32_t ad77681_status(struct ad77681_dev *dev,
674  struct ad77681_status_registers *status);
675 #endif /* SRC_AD77681_H_ */
AD77681_SCRATCHPAD_MSK
#define AD77681_SCRATCHPAD_MSK
Definition: ad77681.h:96
AD77681_FIR
@ AD77681_FIR
Definition: ad77681.h:395
ad77681_data_to_voltage
int32_t ad77681_data_to_voltage(struct ad77681_dev *dev, uint32_t *raw_code, double *voltage)
Definition: ad77681.c:406
ad77681_clear_error_flags
int32_t ad77681_clear_error_flags(struct ad77681_dev *dev)
Definition: ad77681.c:1581
AD77681_DIG_DIAG_ERR_MEMMAP_CRC_MSK
#define AD77681_DIG_DIAG_ERR_MEMMAP_CRC_MSK
Definition: ad77681.h:250
adc_data
Definition: ad77681.h:490
AD77681_GAIN_MID
#define AD77681_GAIN_MID(x)
Definition: ad77681.h:221
ad77681_dev
Definition: ad77681.h:522
ad77681_status_registers::adc_filt_not_settled
bool adc_filt_not_settled
Definition: ad77681.h:503
AD77681_GPIO_WRITE_ALL_MSK
#define AD77681_GPIO_WRITE_ALL_MSK
Definition: ad77681.h:193
no_os_alloc.h
AD77681_ANALOG_REF_BUF_NEG_MSK
#define AD77681_ANALOG_REF_BUF_NEG_MSK
Definition: ad77681.h:121
AD77681_GLOBAL_GPIO_DISABLE
@ AD77681_GLOBAL_GPIO_DISABLE
Definition: ad77681.h:460
AD7768_FULL_SCALE
#define AD7768_FULL_SCALE
Definition: ad77681.h:335
AD77681_REG_COEFF_DATA
#define AD77681_REG_COEFF_DATA
Definition: ad77681.h:92
AD77681_GPIO_WRITE_2_MSK
#define AD77681_GPIO_WRITE_2_MSK
Definition: ad77681.h:187
AD77681_DIG_DIAG_FREQ_COUNT_EN_MSK
#define AD77681_DIG_DIAG_FREQ_COUNT_EN_MSK
Definition: ad77681.h:256
AD77681_REG_DIG_DIAG_STATUS
#define AD77681_REG_DIG_DIAG_STATUS
Definition: ad77681.h:75
ad77681_initiate_sync
int32_t ad77681_initiate_sync(struct ad77681_dev *dev)
Definition: ad77681.c:1057
ad77681_gpio_write
int32_t ad77681_gpio_write(struct ad77681_dev *dev, uint8_t value, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1371
ad77681_error_flags_enabe
int32_t ad77681_error_flags_enabe(struct ad77681_dev *dev)
Definition: ad77681.c:1614
ad77681_setup
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
@ AD77681_SOFT_RESET
Definition: ad77681.h:416
AD77681_GPIO_CNTRL_GPIO2_OP_EN
#define AD77681_GPIO_CNTRL_GPIO2_OP_EN(x)
Definition: ad77681.h:176
AD77681_MASTER_FILT_NOT_SET_MSK
#define AD77681_MASTER_FILT_NOT_SET_MSK
Definition: ad77681.h:265
ad77681_status_registers::fuse_crc_error
bool fuse_crc_error
Definition: ad77681.h:519
ad77681_power_down
int32_t ad77681_power_down(struct ad77681_dev *dev, enum ad77681_sleep_wake sleep_wake)
Definition: ad77681.c:866
AD77681_MASTER_ERROR_MSK
#define AD77681_MASTER_ERROR_MSK
Definition: ad77681.h:260
ad77681_spi_reg_write
int32_t ad77681_spi_reg_write(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: ad77681.c:157
AD77681_MASTER_POR_FLAG_MSK
#define AD77681_MASTER_POR_FLAG_MSK
Definition: ad77681.h:267
AD77681_ACCESS_KEY_CHECK_MSK
#define AD77681_ACCESS_KEY_CHECK_MSK
Definition: ad77681.h:314
no_os_spi_write_and_read
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
AD77681_CONVERSION_DIAG_SEL
#define AD77681_CONVERSION_DIAG_SEL(x)
Definition: ad77681.h:114
ad77681_initiate_sync
int32_t ad77681_initiate_sync(struct ad77681_dev *dev)
Definition: ad77681.c:1057
AD77681_SYNC_RST_SPI_STARTB
#define AD77681_SYNC_RST_SPI_STARTB(x)
Definition: ad77681.h:154
ad77681_status_registers::spi_ignore
bool spi_ignore
Definition: ad77681.h:506
AD77681_GPIO_CNTRL_ALL_GPIOS_OP_EN_MSK
#define AD77681_GPIO_CNTRL_ALL_GPIOS_OP_EN_MSK
Definition: ad77681.h:181
AD77681_OFFSET_MID_MSK
#define AD77681_OFFSET_MID_MSK
Definition: ad77681.h:208
ad77681_status_registers
Definition: ad77681.h:497
ad77681_setup
int32_t ad77681_setup(struct ad77681_dev **device, struct ad77681_init_param init_param, struct ad77681_status_registers **status)
Definition: ad77681.c:1746
ad77681_set_crc_sel
int32_t ad77681_set_crc_sel(struct ad77681_dev *dev, enum ad77681_crc_sel crc_sel)
Definition: ad77681.c:972
ad77681_spi_read_adc_data
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
@ AD77681_BUFn_FULL_BUFFER_ON
Definition: ad77681.h:435
AD77681_GPIO_CNTRL_GPIO2_OP_EN_MSK
#define AD77681_GPIO_CNTRL_GPIO2_OP_EN_MSK
Definition: ad77681.h:175
no_os_spi.h
Header file of SPI Interface.
AD77681_OFFSET_LO_MSK
#define AD77681_OFFSET_LO_MSK
Definition: ad77681.h:212
AD77681_TEMP_SENSOR
@ AD77681_TEMP_SENSOR
Definition: ad77681.h:377
AD77681_GAIN_LOW_MSK
#define AD77681_GAIN_LOW_MSK
Definition: ad77681.h:224
ad77681_filter_type
ad77681_filter_type
Definition: ad77681.h:390
AD77681_AINn_DISABLED
@ AD77681_AINn_DISABLED
Definition: ad77681.h:422
ad77681_data_to_voltage
int32_t ad77681_data_to_voltage(struct ad77681_dev *dev, uint32_t *raw_code, double *voltage)
Definition: ad77681.c:406
AD77681_DIG_DIAG_ERR_MEMMAP_CRC
#define AD77681_DIG_DIAG_ERR_MEMMAP_CRC(x)
Definition: ad77681.h:251
AD77681_GPIO_READ_0_MSK
#define AD77681_GPIO_READ_0_MSK
Definition: ad77681.h:200
AD77681_REG_ADC_DIAG_STATUS
#define AD77681_REG_ADC_DIAG_STATUS
Definition: ad77681.h:74
AD77681_GPIO_WRITE_1
#define AD77681_GPIO_WRITE_1(x)
Definition: ad77681.h:190
ad77681_scratchpad
int32_t ad77681_scratchpad(struct ad77681_dev *dev, uint8_t *sequence)
Definition: ad77681.c:1500
AD77681_REG_GAIN_LO
#define AD77681_REG_GAIN_LO
Definition: ad77681.h:67
AD77681_CONTINUOUS_READ_DISABLE
@ AD77681_CONTINUOUS_READ_DISABLE
Definition: ad77681.h:480
AD77681_REG_GAIN_MID
#define AD77681_REG_GAIN_MID
Definition: ad77681.h:66
AD77681_SINC3
@ AD77681_SINC3
Definition: ad77681.h:394
AD77681_SPI_DIAG_ERR_SPI_IGNORE
#define AD77681_SPI_DIAG_ERR_SPI_IGNORE(x)
Definition: ad77681.h:229
AD77681_SINC5_FIR_DECx512
@ AD77681_SINC5_FIR_DECx512
Definition: ad77681.h:404
AD77681_GPIO_CNTRL_GPIO0_OD_EN
#define AD77681_GPIO_CNTRL_GPIO0_OD_EN(x)
Definition: ad77681.h:170
AD77681_DIG_DIAG_FREQ_COUNT_EN
#define AD77681_DIG_DIAG_FREQ_COUNT_EN(x)
Definition: ad77681.h:257
AD77681_BUFp_DISABLED
@ AD77681_BUFp_DISABLED
Definition: ad77681.h:441
AD77681_REG_GPIO_WRITE
#define AD77681_REG_GPIO_WRITE
Definition: ad77681.h:60
AD77681_ADC_DIAG_ERR_EXT_CLK_QUAL
#define AD77681_ADC_DIAG_ERR_EXT_CLK_QUAL(x)
Definition: ad77681.h:247
AD77681_SPI_DIAG_ERR_SPI_IGNORE_MSK
#define AD77681_SPI_DIAG_ERR_SPI_IGNORE_MSK
Definition: ad77681.h:228
ad77681_set_REFn_buffer
int32_t ad77681_set_REFn_buffer(struct ad77681_dev *dev, enum ad77681_REFn_buffer REFn)
Definition: ad77681.c:686
AD77681_ADC_DIAG_ERR_EXT_CLK_QUAL_MSK
#define AD77681_ADC_DIAG_ERR_EXT_CLK_QUAL_MSK
Definition: ad77681.h:246
AD77681_FAST
@ AD77681_FAST
Definition: ad77681.h:348
ad77681_dev::crc_sel
enum ad77681_crc_sel crc_sel
Definition: ad77681.h:532
AD77681_DIGI_FILTER_FILTER_MSK
#define AD77681_DIGI_FILTER_FILTER_MSK
Definition: ad77681.h:135
AD77681_GPIO_WRITE_3
#define AD77681_GPIO_WRITE_3(x)
Definition: ad77681.h:186
ad77681_spi_reg_read
int32_t ad77681_spi_reg_read(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: ad77681.c:107
ad77681_set_REFp_buffer
int32_t ad77681_set_REFp_buffer(struct ad77681_dev *dev, enum ad77681_REFp_buffer REFp)
Definition: ad77681.c:711
ad77681_sinc5_fir_decimate
ad77681_sinc5_fir_decimate
Definition: ad77681.h:399
no_os_delay.h
Header file of Delay functions.
ad77681_CRC_status_handling
int32_t ad77681_CRC_status_handling(struct ad77681_dev *dev, uint16_t *data_buffer)
Definition: ad77681.c:332
AD77681_MASTER_DIG_ERROR_MSK
#define AD77681_MASTER_DIG_ERROR_MSK
Definition: ad77681.h:262
ad77681_AINp_precharge
ad77681_AINp_precharge
Definition: ad77681.h:426
ad77681_init_param::conv_mode
enum ad77681_conv_mode conv_mode
Definition: ad77681.h:554
AD77681_BUFn_ENABLED
@ AD77681_BUFn_ENABLED
Definition: ad77681.h:433
ad77681_error_flags_enabe
int32_t ad77681_error_flags_enabe(struct ad77681_dev *dev)
Definition: ad77681.c:1614
AD77681_REG_COEFF_CONTROL
#define AD77681_REG_COEFF_CONTROL
Definition: ad77681.h:91
AD77681_ANALOG_REF_BUF_NEG
#define AD77681_ANALOG_REF_BUF_NEG(x)
Definition: ad77681.h:122
AD77681_CONVERSION_MODE
#define AD77681_CONVERSION_MODE(x)
Definition: ad77681.h:116
AD77681_OFFSET_HI_MSK
#define AD77681_OFFSET_HI_MSK
Definition: ad77681.h:204
AD77681_DIGI_FILTER_60HZ_REJ_EN
#define AD77681_DIGI_FILTER_60HZ_REJ_EN(x)
Definition: ad77681.h:134
ad77681_status_registers::adc_err_ext_clk_qual
bool adc_err_ext_clk_qual
Definition: ad77681.h:501
AD77681_AINp_DISABLED
@ AD77681_AINp_DISABLED
Definition: ad77681.h:428
AD77681_ADC_DIAG_ERR_DLDO_PSM_MSK
#define AD77681_ADC_DIAG_ERR_DLDO_PSM_MSK
Definition: ad77681.h:238
ad77681_set_REFn_buffer
int32_t ad77681_set_REFn_buffer(struct ad77681_dev *dev, enum ad77681_REFn_buffer REFn)
Definition: ad77681.c:686
AD77681_GPIO1
@ AD77681_GPIO1
Definition: ad77681.h:466
AD77681_DIG_DIAG_ERR_FUSE_CRC_MSK
#define AD77681_DIG_DIAG_ERR_FUSE_CRC_MSK
Definition: ad77681.h:254
AD77681_SYNC_RST_SPI_RESET_MSK
#define AD77681_SYNC_RST_SPI_RESET_MSK
Definition: ad77681.h:159
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:148
ad77681_init_param::filter
enum ad77681_filter_type filter
Definition: ad77681.h:565
ENABLE
#define ENABLE
Definition: ad77681.h:339
AD77681_REG_SPI_DIAG_ENABLE
#define AD77681_REG_SPI_DIAG_ENABLE
Definition: ad77681.h:68
AD77681_COEF_CONTROL_COEFFWRITEEN
#define AD77681_COEF_CONTROL_COEFFWRITEEN(x)
Definition: ad77681.h:301
AD77681_VCM_1_9V
@ AD77681_VCM_1_9V
Definition: ad77681.h:450
device
Definition: ad9361_util.h:69
ad77681_gpio_open_drain
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
ad77681_gpio_inout
int32_t ad77681_gpio_inout(struct ad77681_dev *dev, uint8_t direction, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1430
ad77681_init_param::AINn
enum ad77681_AINn_precharge AINn
Definition: ad77681.h:561
AD77681_SPI_DIAG_ERR_SPI_RD_MSK
#define AD77681_SPI_DIAG_ERR_SPI_RD_MSK
Definition: ad77681.h:232
AD77681_GPIO_CNTRL_GPIO2_OD_EN_MSK
#define AD77681_GPIO_CNTRL_GPIO2_OD_EN_MSK
Definition: ad77681.h:165
AD77681_GPIO_CNTRL_GPIO0_OD_EN_MSK
#define AD77681_GPIO_CNTRL_GPIO0_OD_EN_MSK
Definition: ad77681.h:169
AD77681_REG_WRITE
#define AD77681_REG_WRITE(x)
Definition: ad77681.h:317
ad77681_status
int32_t ad77681_status(struct ad77681_dev *dev, struct ad77681_status_registers *status)
Definition: ad77681.c:1698
AD77681_WAKE
@ AD77681_WAKE
Definition: ad77681.h:411
ad77681_set_50HZ_rejection
int32_t ad77681_set_50HZ_rejection(struct ad77681_dev *dev, uint8_t enable)
Definition: ad77681.c:817
ad77681_set_crc_sel
int32_t ad77681_set_crc_sel(struct ad77681_dev *dev, enum ad77681_crc_sel crc_sel)
Definition: ad77681.c:972
AD77681_REG_DIGITAL_FILTER
#define AD77681_REG_DIGITAL_FILTER
Definition: ad77681.h:54
ad77681_dev::AINn
enum ad77681_AINn_precharge AINn
Definition: ad77681.h:535
AD77681_REG_CONVERSION
#define AD77681_REG_CONVERSION
Definition: ad77681.h:53
AD77681_POSITIVE_FS
@ AD77681_POSITIVE_FS
Definition: ad77681.h:379
ad77681_power_mode
ad77681_power_mode
Definition: ad77681.h:345
ad77681_init_param::AINp
enum ad77681_AINp_precharge AINp
Definition: ad77681.h:562
AD77681_SINC5_FIR_DECx128
@ AD77681_SINC5_FIR_DECx128
Definition: ad77681.h:402
AD77681_ECO
@ AD77681_ECO
Definition: ad77681.h:346
ad77681_set_AINn_buffer
int32_t ad77681_set_AINn_buffer(struct ad77681_dev *dev, enum ad77681_AINn_precharge AINn)
Definition: ad77681.c:637
AD77681_REG_POWER_CLOCK
#define AD77681_REG_POWER_CLOCK
Definition: ad77681.h:50
AD77681_REG_SPI_DIAG_STATUS
#define AD77681_REG_SPI_DIAG_STATUS
Definition: ad77681.h:73
AD77681_CONTINUOUS_DATA_READ
@ AD77681_CONTINUOUS_DATA_READ
Definition: ad77681.h:486
AD77681_GPIO_WRITE_1_MSK
#define AD77681_GPIO_WRITE_1_MSK
Definition: ad77681.h:189
AD77681_MASTER_FILT_SAT_MSK
#define AD77681_MASTER_FILT_SAT_MSK
Definition: ad77681.h:264
ad77681_compute_xor
uint8_t ad77681_compute_xor(uint8_t *data, uint8_t data_size, uint8_t init_val)
Definition: ad77681.c:84
ad77681_gpio_open_drain
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
AD77681_REG_ANALOG
#define AD77681_REG_ANALOG
Definition: ad77681.h:51
ad77681_gpio_inout
int32_t ad77681_gpio_inout(struct ad77681_dev *dev, uint8_t direction, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1430
AD77681_CONV_CONTINUOUS
@ AD77681_CONV_CONTINUOUS
Definition: ad77681.h:359
AD77681_NEGATIVE_FS
@ AD77681_NEGATIVE_FS
Definition: ad77681.h:380
AD77681_POWER_CLK_POWER_DOWN
#define AD77681_POWER_CLK_POWER_DOWN
Definition: ad77681.h:104
ad77681_set_filter_type
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
@ AD77681_VCM_2_05V
Definition: ad77681.h:449
AD77681_REG_ADC_DIAG_ENABLE
#define AD77681_REG_ADC_DIAG_ENABLE
Definition: ad77681.h:69
AD77681_GPIO_WRITE_3_MSK
#define AD77681_GPIO_WRITE_3_MSK
Definition: ad77681.h:185
AD77681_AIN_SHORT
@ AD77681_AIN_SHORT
Definition: ad77681.h:378
ad77681_rdy_dout
ad77681_rdy_dout
Definition: ad77681.h:371
AD77681_SINC5_FIR_DECx64
@ AD77681_SINC5_FIR_DECx64
Definition: ad77681.h:401
AD77681_GPIO_WRITE_0_MSK
#define AD77681_GPIO_WRITE_0_MSK
Definition: ad77681.h:191
ad77681_set_convlen
int32_t ad77681_set_convlen(struct ad77681_dev *dev, enum ad77681_conv_len conv_len)
Definition: ad77681.c:944
AD77681_INTERFACE_CONT_READ_MSK
#define AD77681_INTERFACE_CONT_READ_MSK
Definition: ad77681.h:89
ad77681_set_REFp_buffer
int32_t ad77681_set_REFp_buffer(struct ad77681_dev *dev, enum ad77681_REFp_buffer REFp)
Definition: ad77681.c:711
ad77681_set_AINp_buffer
int32_t ad77681_set_AINp_buffer(struct ad77681_dev *dev, enum ad77681_AINp_precharge AINp)
Definition: ad77681.c:661
ad77681_status_registers::ref_det_error
bool ref_det_error
Definition: ad77681.h:513
AD77681_REG_MASTER_STATUS
#define AD77681_REG_MASTER_STATUS
Definition: ad77681.h:72
AD77681_GLOBAL_GPIO_ENABLE
@ AD77681_GLOBAL_GPIO_ENABLE
Definition: ad77681.h:459
ad77681_CRC_status_handling
int32_t ad77681_CRC_status_handling(struct ad77681_dev *dev, uint16_t *data_buffer)
Definition: ad77681.c:332
ad77681_init_param::REFp
enum ad77681_REFp_buffer REFp
Definition: ad77681.h:564
AD77681_REG_INTERFACE_FORMAT
#define AD77681_REG_INTERFACE_FORMAT
Definition: ad77681.h:49
AD77681_REG_OFFSET_LO
#define AD77681_REG_OFFSET_LO
Definition: ad77681.h:64
ad77681_spi_read_mask
int32_t ad77681_spi_read_mask(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t *data)
Definition: ad77681.c:183
AD77681_ADC_DIAG_ERR_FILT_NOT_SET_MSK
#define AD77681_ADC_DIAG_ERR_FILT_NOT_SET_MSK
Definition: ad77681.h:244
ad77681_set_mclk_div
int32_t ad77681_set_mclk_div(struct ad77681_dev *dev, enum ad77681_mclk_div clk_div)
Definition: ad77681.c:583
ad77681_dev::conv_diag_sel
bool conv_diag_sel
Definition: ad77681.h:530
ad77681_programmable_filter
int32_t ad77681_programmable_filter(struct ad77681_dev *dev, const float *coeffs, uint8_t num_coeffs)
Definition: ad77681.c:1140
ad77681_set_status_bit
int32_t ad77681_set_status_bit(struct ad77681_dev *dev, bool status_bit)
Definition: ad77681.c:1010
ad77681_set_convlen
int32_t ad77681_set_convlen(struct ad77681_dev *dev, enum ad77681_conv_len conv_len)
Definition: ad77681.c:944
AD77681_GPIO_CNTRL_UGPIO_EN_MSK
#define AD77681_GPIO_CNTRL_UGPIO_EN_MSK
Definition: ad77681.h:163
ad77681_set_continuos_read
int32_t ad77681_set_continuos_read(struct ad77681_dev *dev, enum ad77681_continuous_read continuous_enable)
Definition: ad77681.c:838
ad77681_set_AINp_buffer
int32_t ad77681_set_AINp_buffer(struct ad77681_dev *dev, enum ad77681_AINp_precharge AINp)
Definition: ad77681.c:661
ad77681_dev::mclk_div
enum ad77681_mclk_div mclk_div
Definition: ad77681.h:527
AD77681_REG_OFFSET_HI
#define AD77681_REG_OFFSET_HI
Definition: ad77681.h:62
AD77681_INTERFACE_STATUS_EN_MSK
#define AD77681_INTERFACE_STATUS_EN_MSK
Definition: ad77681.h:83
AD77681_ANALOG_AIN_BUF_POS_OFF_MSK
#define AD77681_ANALOG_AIN_BUF_POS_OFF_MSK
Definition: ad77681.h:123
AD77681_SINC5_DECx16
@ AD77681_SINC5_DECx16
Definition: ad77681.h:393
AD77681_REG_SINC3_DEC_RATE_LSB
#define AD77681_REG_SINC3_DEC_RATE_LSB
Definition: ad77681.h:56
ad77681_conv_mode
ad77681_conv_mode
Definition: ad77681.h:358
AD77681_POWER_CLK_PWRMODE
#define AD77681_POWER_CLK_PWRMODE(x)
Definition: ad77681.h:101
ad77681_init_param::vref
uint16_t vref
Definition: ad77681.h:568
AD77681_SPI_DIAG_ERR_SPI_WR
#define AD77681_SPI_DIAG_ERR_SPI_WR(x)
Definition: ad77681.h:235
ad77681_set_50HZ_rejection
int32_t ad77681_set_50HZ_rejection(struct ad77681_dev *dev, uint8_t enable)
Definition: ad77681.c:817
no_os_error.h
Error codes definition.
ad77681_dev::diag_mux_sel
enum ad77681_conv_diag_mux diag_mux_sel
Definition: ad77681.h:529
ad77681_init_param::mclk_div
enum ad77681_mclk_div mclk_div
Definition: ad77681.h:553
ad77681_spi_read_mask
int32_t ad77681_spi_read_mask(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t *data)
Definition: ad77681.c:183
ad77681_dev::conv_len
enum ad77681_conv_len conv_len
Definition: ad77681.h:531
AD77681_GPIO_WRITE_ALL
#define AD77681_GPIO_WRITE_ALL(x)
Definition: ad77681.h:194
AD77681_AINn_ENABLED
@ AD77681_AINn_ENABLED
Definition: ad77681.h:421
ad77681_set_mclk_div
int32_t ad77681_set_mclk_div(struct ad77681_dev *dev, enum ad77681_mclk_div clk_div)
Definition: ad77681.c:583
ad77681_dev::AINp
enum ad77681_AINp_precharge AINp
Definition: ad77681.h:536
AD77681_REG_GAIN_HI
#define AD77681_REG_GAIN_HI
Definition: ad77681.h:65
AD77681_OFFSET_LO
#define AD77681_OFFSET_LO(x)
Definition: ad77681.h:213
ad77681_init_param::VCM_out
enum ad77681_VCM_out VCM_out
Definition: ad77681.h:560
ad77681.h
Header file of the AD7768-1 Driver.
AD77681_REG_GPIO_CONTROL
#define AD77681_REG_GPIO_CONTROL
Definition: ad77681.h:59
AD77681_VCM_1_1V
@ AD77681_VCM_1_1V
Definition: ad77681.h:452
ad77681_gobal_gpio_enable
ad77681_gobal_gpio_enable
Definition: ad77681.h:458
ad77681_init_param::crc_sel
enum ad77681_crc_sel crc_sel
Definition: ad77681.h:558
AD77681_DIGI_FILTER_DEC_RATE
#define AD77681_DIGI_FILTER_DEC_RATE(x)
Definition: ad77681.h:138
ad77681_status_registers::spi_crc_error
bool spi_crc_error
Definition: ad77681.h:510
AD77681_RDY_DOUT_DIS
@ AD77681_RDY_DOUT_DIS
Definition: ad77681.h:373
AD77681_REG_ACCESS_KEY
#define AD77681_REG_ACCESS_KEY
Definition: ad77681.h:93
ad77681_gpio_read
int32_t ad77681_gpio_read(struct ad77681_dev *dev, uint8_t *value, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1312
ad77681_status_registers::memoy_map_crc_error
bool memoy_map_crc_error
Definition: ad77681.h:517
AD77681_VCM_0_9V
@ AD77681_VCM_0_9V
Definition: ad77681.h:453
AD77681_ACCESS_KEY_MSK
#define AD77681_ACCESS_KEY_MSK
Definition: ad77681.h:312
AD77681_INTERFACE_CRC_EN_MSK
#define AD77681_INTERFACE_CRC_EN_MSK
Definition: ad77681.h:79
ad77681_dev::conv_mode
enum ad77681_conv_mode conv_mode
Definition: ad77681.h:528
AD77681_BUFp_ENABLED
@ AD77681_BUFp_ENABLED
Definition: ad77681.h:440
AD77681_GPIO_CNTRL_GPIO0_OP_EN
#define AD77681_GPIO_CNTRL_GPIO0_OP_EN(x)
Definition: ad77681.h:180
AD77681_CONTINUOUS_READ_ENABLE
@ AD77681_CONTINUOUS_READ_ENABLE
Definition: ad77681.h:479
adc_data::raw_data
uint32_t raw_data[4096]
Definition: ad77681.h:494
AD77681_SINC5_FIR_DECx256
@ AD77681_SINC5_FIR_DECx256
Definition: ad77681.h:403
ad77681_apply_offset
int32_t ad77681_apply_offset(struct ad77681_dev *dev, uint32_t value)
Definition: ad77681.c:1071
adc_data::count
uint16_t count
Definition: ad77681.h:492
AD77681_GPIO3
@ AD77681_GPIO3
Definition: ad77681.h:468
AD77681_POWER_CLK_PWRMODE_MSK
#define AD77681_POWER_CLK_PWRMODE_MSK
Definition: ad77681.h:100
ad77681_dev::power_mode
enum ad77681_power_mode power_mode
Definition: ad77681.h:526
ad77681_set_VCM_output
int32_t ad77681_set_VCM_output(struct ad77681_dev *dev, enum ad77681_VCM_out VCM_out)
Definition: ad77681.c:613
AD77681_GPIO_OPEN_DRAIN
@ AD77681_GPIO_OPEN_DRAIN
Definition: ad77681.h:474
ad77681_set_power_mode
int32_t ad77681_set_power_mode(struct ad77681_dev *dev, enum ad77681_power_mode mode)
Definition: ad77681.c:557
AD77681_VCM_HALF_VCC
@ AD77681_VCM_HALF_VCC
Definition: ad77681.h:447
AD77681_MASTER_ADC_ERROR_MSK
#define AD77681_MASTER_ADC_ERROR_MSK
Definition: ad77681.h:261
ad77681_conv_diag_mux
ad77681_conv_diag_mux
Definition: ad77681.h:376
AD77681_CONV_24BIT
@ AD77681_CONV_24BIT
Definition: ad77681.h:367
AD77681_HARD_RESET
@ AD77681_HARD_RESET
Definition: ad77681.h:417
AD77681_RDY_DOUT_EN
@ AD77681_RDY_DOUT_EN
Definition: ad77681.h:372
ad77681_init_param
Definition: ad77681.h:548
ad77681_crc_sel
ad77681_crc_sel
Definition: ad77681.h:383
ad77681_apply_gain
int32_t ad77681_apply_gain(struct ad77681_dev *dev, uint32_t value)
Definition: ad77681.c:1105
AD77681_REG_SINC3_DEC_RATE_MSB
#define AD77681_REG_SINC3_DEC_RATE_MSB
Definition: ad77681.h:55
ad77681_dev::filter
enum ad77681_filter_type filter
Definition: ad77681.h:539
AD77681_REG_OFFSET_MID
#define AD77681_REG_OFFSET_MID
Definition: ad77681.h:63
AD77681_GPIO_CNTRL_GPIO0_OP_EN_MSK
#define AD77681_GPIO_CNTRL_GPIO0_OP_EN_MSK
Definition: ad77681.h:179
AD77681_GPIO_CNTRL_GPIO1_OP_EN
#define AD77681_GPIO_CNTRL_GPIO1_OP_EN(x)
Definition: ad77681.h:178
ad77681_init_param::decimate
enum ad77681_sinc5_fir_decimate decimate
Definition: ad77681.h:566
ad77681_init_param::conv_diag_sel
bool conv_diag_sel
Definition: ad77681.h:556
ad77681_status_registers::spi_read_error
bool spi_read_error
Definition: ad77681.h:508
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ad77681_set_conv_mode
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
AD77681_SYNC_RST_SPI_STARTB_MSK
#define AD77681_SYNC_RST_SPI_STARTB_MSK
Definition: ad77681.h:153
ad77681_status_registers::spi_error
bool spi_error
Definition: ad77681.h:504
AD77681_ADC_DIAG_ERR_FILT_NOT_SET
#define AD77681_ADC_DIAG_ERR_FILT_NOT_SET(x)
Definition: ad77681.h:245
ad77681_init_param::sample_rate
uint32_t sample_rate
Definition: ad77681.h:570
ad77681_gpio_write
int32_t ad77681_gpio_write(struct ad77681_dev *dev, uint8_t value, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1371
AD77681_COEF_CONTROL_COEFFACCESSEN
#define AD77681_COEF_CONTROL_COEFFACCESSEN(x)
Definition: ad77681.h:299
AD77681_MCLK_DIV_2
@ AD77681_MCLK_DIV_2
Definition: ad77681.h:355
ad77681_status_registers::dldo_psm_error
bool dldo_psm_error
Definition: ad77681.h:511
ad77681_status_registers::por_flag
bool por_flag
Definition: ad77681.h:505
ad77681_dev::REFp
enum ad77681_REFp_buffer REFp
Definition: ad77681.h:538
AD77681_DIG_MEMMAP_CRC_ERROR_MSK
#define AD77681_DIG_MEMMAP_CRC_ERROR_MSK
Definition: ad77681.h:289
AD77681_SLEEP
@ AD77681_SLEEP
Definition: ad77681.h:410
AD77681_SPI_READ_ERROR_CLR
#define AD77681_SPI_READ_ERROR_CLR(x)
Definition: ad77681.h:274
AD77681_ADC_FILT_NOT_SET_MSK
#define AD77681_ADC_FILT_NOT_SET_MSK
Definition: ad77681.h:285
AD77681_ANALOG_AIN_BUF_POS_OFF
#define AD77681_ANALOG_AIN_BUF_POS_OFF(x)
Definition: ad77681.h:124
ad77681_status_registers::ext_clk_qual_error
bool ext_clk_qual_error
Definition: ad77681.h:516
AD77681_ANALOG_REF_BUF_POS_MSK
#define AD77681_ANALOG_REF_BUF_POS_MSK
Definition: ad77681.h:119
ad77681_apply_gain
int32_t ad77681_apply_gain(struct ad77681_dev *dev, uint32_t value)
Definition: ad77681.c:1105
ad77681_power_down
int32_t ad77681_power_down(struct ad77681_dev *dev, enum ad77681_sleep_wake sleep_wake)
Definition: ad77681.c:866
ad77681_spi_reg_write
int32_t ad77681_spi_reg_write(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: ad77681.c:157
AD77681_SPI_CLK_CNT_ERROR_MSK
#define AD77681_SPI_CLK_CNT_ERROR_MSK
Definition: ad77681.h:272
AD77681_COEF_CONTROL_COEFFWRITEEN_MSK
#define AD77681_COEF_CONTROL_COEFFWRITEEN_MSK
Definition: ad77681.h:300
AD77681_MASTER_DIG_ERR_EXT_CLK_MSK
#define AD77681_MASTER_DIG_ERR_EXT_CLK_MSK
Definition: ad77681.h:263
AD77681_DIGI_FILTER_FILTER
#define AD77681_DIGI_FILTER_FILTER(x)
Definition: ad77681.h:136
AD77681_SPI_WRITE_ERROR_CLR
#define AD77681_SPI_WRITE_ERROR_CLR(x)
Definition: ad77681.h:276
AD77681_CONV_PERIODIC
@ AD77681_CONV_PERIODIC
Definition: ad77681.h:362
ad77681_gpios
ad77681_gpios
Definition: ad77681.h:464
AD77681_POWER_CLK_MCLK_DIV
#define AD77681_POWER_CLK_MCLK_DIV(x)
Definition: ad77681.h:106
ad77681_gpio_output_type
ad77681_gpio_output_type
Definition: ad77681.h:472
ad77681_init_param::power_mode
enum ad77681_power_mode power_mode
Definition: ad77681.h:552
AD77681_VCM_OFF
@ AD77681_VCM_OFF
Definition: ad77681.h:454
AD77681_GPIO0
@ AD77681_GPIO0
Definition: ad77681.h:465
ad77681_VCM_out
ad77681_VCM_out
Definition: ad77681.h:446
AD77681_SINC3_DEC_RATE_LSB_MSK
#define AD77681_SINC3_DEC_RATE_LSB_MSK
Definition: ad77681.h:145
ad77681_set_filter_type
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_ANALOG_AIN_BUF_NEG_OFF_MSK
#define AD77681_ANALOG_AIN_BUF_NEG_OFF_MSK
Definition: ad77681.h:125
ad77681_dev::mclk
uint16_t mclk
Definition: ad77681.h:543
INITIAL_CRC
#define INITIAL_CRC
Definition: ad77681.h:325
AD77681_GPIO_CNTRL_GPIO3_OP_EN
#define AD77681_GPIO_CNTRL_GPIO3_OP_EN(x)
Definition: ad77681.h:174
AD77681_BUFp_FULL_BUFFER_ON
@ AD77681_BUFp_FULL_BUFFER_ON
Definition: ad77681.h:442
ad77681_set_power_mode
int32_t ad77681_set_power_mode(struct ad77681_dev *dev, enum ad77681_power_mode mode)
Definition: ad77681.c:557
ad77681_init_param::mclk
uint16_t mclk
Definition: ad77681.h:569
AD77681_SINC3_DEC_RATE_LSB
#define AD77681_SINC3_DEC_RATE_LSB(x)
Definition: ad77681.h:146
AD77681_SPI_READ_ERROR_MSK
#define AD77681_SPI_READ_ERROR_MSK
Definition: ad77681.h:273
ad7761_reset_option
ad7761_reset_option
Definition: ad77681.h:415
AD77681_REG_READ
#define AD77681_REG_READ(x)
Definition: ad77681.h:316
AD77681_SINC3_DEC_RATE_MSB_MSK
#define AD77681_SINC3_DEC_RATE_MSB_MSK
Definition: ad77681.h:141
AD77681_GPIO_WRITE_2
#define AD77681_GPIO_WRITE_2(x)
Definition: ad77681.h:188
AD77681_INTERFACE_CRC_TYPE_MSK
#define AD77681_INTERFACE_CRC_TYPE_MSK
Definition: ad77681.h:81
AD77681_GPIO_READ_3_MSK
#define AD77681_GPIO_READ_3_MSK
Definition: ad77681.h:197
AD77681_GPIO_READ_1_MSK
#define AD77681_GPIO_READ_1_MSK
Definition: ad77681.h:199
ad77681_scratchpad
int32_t ad77681_scratchpad(struct ad77681_dev *dev, uint8_t *sequence)
Definition: ad77681.c:1500
AD77681_DIG_DIAG_ERR_FUSE_CRC
#define AD77681_DIG_DIAG_ERR_FUSE_CRC(x)
Definition: ad77681.h:255
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
AD77681_ADC_DIG_ERR_EXT_CLK_MSK
#define AD77681_ADC_DIG_ERR_EXT_CLK_MSK
Definition: ad77681.h:286
AD77681_MEDIAN
@ AD77681_MEDIAN
Definition: ad77681.h:347
AD77681_REGISTER_DATA_READ
@ AD77681_REGISTER_DATA_READ
Definition: ad77681.h:485
ad77681_soft_reset
int32_t ad77681_soft_reset(struct ad77681_dev *dev)
Definition: ad77681.c:1034
ad77681_get_frame_byte
uint8_t ad77681_get_frame_byte(struct ad77681_dev *dev)
Definition: ad77681.c:247
AD77681_DIG_RAM_CRC_ERROR_MSK
#define AD77681_DIG_RAM_CRC_ERROR_MSK
Definition: ad77681.h:290
INITIAL_CRC_CRC8
#define INITIAL_CRC_CRC8
Definition: ad77681.h:323
AD77681_POWER_CLK_MCLK_DIV_MSK
#define AD77681_POWER_CLK_MCLK_DIV_MSK
Definition: ad77681.h:105
AD77681_ANALOG2_VCM
#define AD77681_ANALOG2_VCM(x)
Definition: ad77681.h:130
AD77681_INTERFACE_CONT_READ_EN
#define AD77681_INTERFACE_CONT_READ_EN(x)
Definition: ad77681.h:90
ad77681_spi_reg_read
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
ad77681_AINn_precharge
Definition: ad77681.h:420
ad77681_init_param::sinc3_osr
uint16_t sinc3_osr
Definition: ad77681.h:567
AD77681_CRC
@ AD77681_CRC
Definition: ad77681.h:384
AD77681_SPI_DIAG_ERR_SPI_CLK_CNT
#define AD77681_SPI_DIAG_ERR_SPI_CLK_CNT(x)
Definition: ad77681.h:231
ad77681_set_conv_mode
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
ad77681_status_registers::master_error
bool master_error
Definition: ad77681.h:498
AD77681_ADC_DIAG_ERR_FILT_SAT_MSK
#define AD77681_ADC_DIAG_ERR_FILT_SAT_MSK
Definition: ad77681.h:242
AD77681_ADC_FILT_SAT_MSK
#define AD77681_ADC_FILT_SAT_MSK
Definition: ad77681.h:284
AD77681_MCLK_DIV_16
@ AD77681_MCLK_DIV_16
Definition: ad77681.h:352
AD77681_GPIO_CNTRL_GPIO1_OD_EN
#define AD77681_GPIO_CNTRL_GPIO1_OD_EN(x)
Definition: ad77681.h:168
AD77681_ALL_GPIOS
@ AD77681_ALL_GPIOS
Definition: ad77681.h:469
no_os_free
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
AD77681_ADC_DIAG_ERR_ALDO_PSM
#define AD77681_ADC_DIAG_ERR_ALDO_PSM(x)
Definition: ad77681.h:241
AD77681_GPIO_CNTRL_ALL_GPIOS_OP_EN
#define AD77681_GPIO_CNTRL_ALL_GPIOS_OP_EN(x)
Definition: ad77681.h:182
AD77681_GPIO_READ_ALL_MSK
#define AD77681_GPIO_READ_ALL_MSK
Definition: ad77681.h:201
ad77681_sleep_wake
ad77681_sleep_wake
Definition: ad77681.h:409
ad77681_dev::REFn
enum ad77681_REFn_buffer REFn
Definition: ad77681.h:537
AD77681_ADC_ALDO_PSM_ERROR_MSK
#define AD77681_ADC_ALDO_PSM_ERROR_MSK
Definition: ad77681.h:282
AD77681_VCM_1_65V
@ AD77681_VCM_1_65V
Definition: ad77681.h:451
AD77681_DIG_DIAG_ERR_RAM_CRC
#define AD77681_DIG_DIAG_ERR_RAM_CRC(x)
Definition: ad77681.h:253
AD77681_REG_SCRATCH_PAD
#define AD77681_REG_SCRATCH_PAD
Definition: ad77681.h:46
AD77681_CONVERSION_DIAG_SEL_MSK
#define AD77681_CONVERSION_DIAG_SEL_MSK
Definition: ad77681.h:113
AD77681_OFFSET_HI
#define AD77681_OFFSET_HI(x)
Definition: ad77681.h:205
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
ad77681_get_rx_buf_len
uint8_t ad77681_get_rx_buf_len(struct ad77681_dev *dev)
Definition: ad77681.c:226
AD77681_SPI_CRC_ERROR_CLR
#define AD77681_SPI_CRC_ERROR_CLR(x)
Definition: ad77681.h:278
AD77681_ADC_REF_DET_ERROR_MSK
#define AD77681_ADC_REF_DET_ERROR_MSK
Definition: ad77681.h:283
AD77681_COEF_CONTROL_COEFFACCESSEN_MSK
#define AD77681_COEF_CONTROL_COEFFACCESSEN_MSK
Definition: ad77681.h:298
AD77681_CONVERSION_DIAG_MUX_SEL
#define AD77681_CONVERSION_DIAG_MUX_SEL(x)
Definition: ad77681.h:112
AD77681_NO_CRC
@ AD77681_NO_CRC
Definition: ad77681.h:386
AD77681_SPI_DIAG_ERR_SPI_CLK_CNT_MSK
#define AD77681_SPI_DIAG_ERR_SPI_CLK_CNT_MSK
Definition: ad77681.h:230
ad77681_REFn_buffer
ad77681_REFn_buffer
Definition: ad77681.h:432
AD77681_SYNC_RST_SPI_RESET
#define AD77681_SYNC_RST_SPI_RESET(x)
Definition: ad77681.h:160
AD77681_DIGI_FILTER_60HZ_REJ_EN_MSK
#define AD77681_DIGI_FILTER_60HZ_REJ_EN_MSK
Definition: ad77681.h:133
AD77681_GPIO_CNTRL_ALL_GPIOS_OD_EN_MSK
#define AD77681_GPIO_CNTRL_ALL_GPIOS_OD_EN_MSK
Definition: ad77681.h:171
AD77681_SINC5_DECx8
@ AD77681_SINC5_DECx8
Definition: ad77681.h:392
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
AD77681_GPIO_CNTRL_GPIO1_OD_EN_MSK
#define AD77681_GPIO_CNTRL_GPIO1_OD_EN_MSK
Definition: ad77681.h:167
AD77681_ADC_DIAG_ERR_ALDO_PSM_MSK
#define AD77681_ADC_DIAG_ERR_ALDO_PSM_MSK
Definition: ad77681.h:240
AD77681_REG_GPIO_READ
#define AD77681_REG_GPIO_READ
Definition: ad77681.h:61
AD77681_VCM_2_5V
@ AD77681_VCM_2_5V
Definition: ad77681.h:448
ad77681_status_registers::dig_error
bool dig_error
Definition: ad77681.h:500
ad77681_init_param::conv_len
enum ad77681_conv_len conv_len
Definition: ad77681.h:557
AD77681_CRC8_POLY
#define AD77681_CRC8_POLY
Definition: ad77681.h:320
AD77681_DIG_FUS_CRC_ERROR_MSK
#define AD77681_DIG_FUS_CRC_ERROR_MSK
Definition: ad77681.h:291
ad77681_dev::decimate
enum ad77681_sinc5_fir_decimate decimate
Definition: ad77681.h:540
AD77681_CONV_ONE_SHOT
@ AD77681_CONV_ONE_SHOT
Definition: ad77681.h:360
AD77681_DIGI_FILTER_DEC_RATE_MSK
#define AD77681_DIGI_FILTER_DEC_RATE_MSK
Definition: ad77681.h:137
AD77681_GPIO_READ_2_MSK
#define AD77681_GPIO_READ_2_MSK
Definition: ad77681.h:198
ad77681_status_registers::ram_crc_error
bool ram_crc_error
Definition: ad77681.h:518
AD77681_SINC5_FIR_DECx1024
@ AD77681_SINC5_FIR_DECx1024
Definition: ad77681.h:405
ad77681_update_sample_rate
int32_t ad77681_update_sample_rate(struct ad77681_dev *dev)
Definition: ad77681.c:429
AD77681_MCLK_DIV_4
@ AD77681_MCLK_DIV_4
Definition: ad77681.h:354
ad77681_global_gpio
int32_t ad77681_global_gpio(struct ad77681_dev *dev, enum ad77681_gobal_gpio_enable gpio_enable)
Definition: ad77681.c:1483
AD77681_SINC5_FIR_DECx32
@ AD77681_SINC5_FIR_DECx32
Definition: ad77681.h:400
AD77681_SPI_IGNORE_ERROR_CLR
#define AD77681_SPI_IGNORE_ERROR_CLR(x)
Definition: ad77681.h:271
AD77681_CONV_SINGLE
@ AD77681_CONV_SINGLE
Definition: ad77681.h:361
ad77681_spi_read_adc_data
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_ANALOG_AIN_BUF_NEG_OFF
#define AD77681_ANALOG_AIN_BUF_NEG_OFF(x)
Definition: ad77681.h:126
AD77681_ANALOG_REF_BUF_POS
#define AD77681_ANALOG_REF_BUF_POS(x)
Definition: ad77681.h:120
ad77681_dev::data_frame_byte
uint8_t data_frame_byte
Definition: ad77681.h:545
AD77681_GPIO_WRITE_0
#define AD77681_GPIO_WRITE_0(x)
Definition: ad77681.h:192
AD77681_ADC_DIAG_ERR_FILT_SAT
#define AD77681_ADC_DIAG_ERR_FILT_SAT(x)
Definition: ad77681.h:243
ad77681_compute_crc8
uint8_t ad77681_compute_crc8(uint8_t *data, uint8_t data_size, uint8_t init_val)
Definition: ad77681.c:56
AD77681_SPI_CRC_ERROR_MSK
#define AD77681_SPI_CRC_ERROR_MSK
Definition: ad77681.h:277
AD77681_GAIN_LOW
#define AD77681_GAIN_LOW(x)
Definition: ad77681.h:225
AD77681_SINC3_DEC_RATE_MSB
#define AD77681_SINC3_DEC_RATE_MSB(x)
Definition: ad77681.h:142
AD77681_ANALOG2_VCM_MSK
#define AD77681_ANALOG2_VCM_MSK
Definition: ad77681.h:129
AD77681_GPIO_CNTRL_ALL_GPIOS_OD_EN
#define AD77681_GPIO_CNTRL_ALL_GPIOS_OD_EN(x)
Definition: ad77681.h:172
adc_data::samples
uint16_t samples
Definition: ad77681.h:493
ad77681_init_param::data_frame_byte
uint8_t data_frame_byte
Definition: ad77681.h:571
AD77681_SPI_DIAG_ERR_SPI_WR_MSK
#define AD77681_SPI_DIAG_ERR_SPI_WR_MSK
Definition: ad77681.h:234
AD77681_SPI_WRITE_ERROR_MSK
#define AD77681_SPI_WRITE_ERROR_MSK
Definition: ad77681.h:275
ad77681_SINC3_ODR
int32_t ad77681_SINC3_ODR(struct ad77681_dev *dev, uint16_t *sinc3_dec_reg, float sinc3_odr)
Definition: ad77681.c:510
ad77681_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad77681.h:524
AD77681_GAIN_MID_MSK
#define AD77681_GAIN_MID_MSK
Definition: ad77681.h:220
AD77681_ADC_DIAG_ERR_DLDO_PSM
#define AD77681_ADC_DIAG_ERR_DLDO_PSM(x)
Definition: ad77681.h:239
ad77681_init_param::REFn
enum ad77681_REFn_buffer REFn
Definition: ad77681.h:563
AD77681_GPIO_CNTRL_GPIO1_OP_EN_MSK
#define AD77681_GPIO_CNTRL_GPIO1_OP_EN_MSK
Definition: ad77681.h:177
AD77681_CONV_16BIT
@ AD77681_CONV_16BIT
Definition: ad77681.h:368
AD77681_REG_ADC_DATA
#define AD77681_REG_ADC_DATA
Definition: ad77681.h:71
ad77681_spi_write_mask
int32_t ad77681_spi_write_mask(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Definition: ad77681.c:205
ad77681_programmable_filter
int32_t ad77681_programmable_filter(struct ad77681_dev *dev, const float *coeffs, uint8_t num_coeffs)
Definition: ad77681.c:1140
AD77681_ACCESS_KEY
#define AD77681_ACCESS_KEY(x)
Definition: ad77681.h:313
AD77681_CONV_STANDBY
@ AD77681_CONV_STANDBY
Definition: ad77681.h:363
ad77681_set_status_bit
int32_t ad77681_set_status_bit(struct ad77681_dev *dev, bool status_bit)
Definition: ad77681.c:1010
ad77681_compute_crc8
uint8_t ad77681_compute_crc8(uint8_t *data, uint8_t data_size, uint8_t init_val)
Definition: ad77681.c:56
AD77681_CONVERSION_MODE_MSK
#define AD77681_CONVERSION_MODE_MSK
Definition: ad77681.h:115
no_os_spi_init
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
ad77681_set_continuos_read
int32_t ad77681_set_continuos_read(struct ad77681_dev *dev, enum ad77681_continuous_read continuous_enable)
Definition: ad77681.c:838
ad77681_conv_len
ad77681_conv_len
Definition: ad77681.h:366
ad77681_status_registers::filt_not_set_error
bool filt_not_set_error
Definition: ad77681.h:515
AD77681_SINC5
@ AD77681_SINC5
Definition: ad77681.h:391
AD77681_GPIO_STRONG_DRIVER
@ AD77681_GPIO_STRONG_DRIVER
Definition: ad77681.h:473
ad77681_continuous_read
ad77681_continuous_read
Definition: ad77681.h:478
AD77681_MASTER_SPI_ERROR_MSK
#define AD77681_MASTER_SPI_ERROR_MSK
Definition: ad77681.h:266
ad77681_dev::status_bit
uint8_t status_bit
Definition: ad77681.h:533
AD77681_INTERFACE_CRC_EN
#define AD77681_INTERFACE_CRC_EN(x)
Definition: ad77681.h:80
AD77681_ADC_DLDO_PSM_ERROR_MSK
#define AD77681_ADC_DLDO_PSM_ERROR_MSK
Definition: ad77681.h:281
AD77681_XOR
@ AD77681_XOR
Definition: ad77681.h:385
AD77681_GAIN_HI_MSK
#define AD77681_GAIN_HI_MSK
Definition: ad77681.h:216
ad77681_status_registers::adc_error
bool adc_error
Definition: ad77681.h:499
ad77681_init_param::diag_mux_sel
enum ad77681_conv_diag_mux diag_mux_sel
Definition: ad77681.h:555
ad77681_dev::sinc3_osr
uint16_t sinc3_osr
Definition: ad77681.h:541
AD77681_REG_SYNC_RESET
#define AD77681_REG_SYNC_RESET
Definition: ad77681.h:58
AD77681_INTERFACE_CONVLEN_MSK
#define AD77681_INTERFACE_CONVLEN_MSK
Definition: ad77681.h:85
ad77681_spi_write_mask
int32_t ad77681_spi_write_mask(struct ad77681_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Definition: ad77681.c:205
AD77681_GPIO_CNTRL_GPIO2_OD_EN
#define AD77681_GPIO_CNTRL_GPIO2_OD_EN(x)
Definition: ad77681.h:166
ad77681_global_gpio
int32_t ad77681_global_gpio(struct ad77681_dev *devices, enum ad77681_gobal_gpio_enable gpio_enable)
Definition: ad77681.c:1483
AD77681_GPIO2
@ AD77681_GPIO2
Definition: ad77681.h:467
AD77681_GAIN_HI
#define AD77681_GAIN_HI(x)
Definition: ad77681.h:217
no_os_spi_desc::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:202
AD77681_GPIO_CNTRL_UGPIO_EN
#define AD77681_GPIO_CNTRL_UGPIO_EN(x)
Definition: ad77681.h:164
adc_data::finish
bool finish
Definition: ad77681.h:491
ad77681_update_sample_rate
int32_t ad77681_update_sample_rate(struct ad77681_dev *dev)
Definition: ad77681.c:429
AD77681_SCRATCHPAD
#define AD77681_SCRATCHPAD(x)
Definition: ad77681.h:97
ad77681_status_registers::adc_filt_saturated
bool adc_filt_saturated
Definition: ad77681.h:502
ad77681_status
int32_t ad77681_status(struct ad77681_dev *dev, struct ad77681_status_registers *status)
Definition: ad77681.c:1698
ad77681_dev::VCM_out
enum ad77681_VCM_out VCM_out
Definition: ad77681.h:534
ad77681_dev::sample_rate
uint32_t sample_rate
Definition: ad77681.h:544
INITIAL_CRC_XOR
#define INITIAL_CRC_XOR
Definition: ad77681.h:324
ad77681_status_registers::aldo_psm_error
bool aldo_psm_error
Definition: ad77681.h:512
AD77681_SPI_DIAG_ERR_SPI_RD
#define AD77681_SPI_DIAG_ERR_SPI_RD(x)
Definition: ad77681.h:233
AD77681_SPI_IGNORE_ERROR_MSK
#define AD77681_SPI_IGNORE_ERROR_MSK
Definition: ad77681.h:270
EXIT_CONT_READ
#define EXIT_CONT_READ
Definition: ad77681.h:331
AD77681_MCLK_DIV_8
@ AD77681_MCLK_DIV_8
Definition: ad77681.h:353
AD77681_INTERFACE_STATUS_EN
#define AD77681_INTERFACE_STATUS_EN(x)
Definition: ad77681.h:84
ad77681_status_registers::spi_clock_count
bool spi_clock_count
Definition: ad77681.h:507
ad77681_gpio_read
int32_t ad77681_gpio_read(struct ad77681_dev *dev, uint8_t *value, enum ad77681_gpios gpio_number)
Definition: ad77681.c:1312
AD77681_OFFSET_MID
#define AD77681_OFFSET_MID(x)
Definition: ad77681.h:209
ad77681_status_registers::spi_write_error
bool spi_write_error
Definition: ad77681.h:509
AD77681_INTERFACE_CONVLEN
#define AD77681_INTERFACE_CONVLEN(x)
Definition: ad77681.h:86
ad77681_set_AINn_buffer
int32_t ad77681_set_AINn_buffer(struct ad77681_dev *dev, enum ad77681_AINn_precharge AINn)
Definition: ad77681.c:637
ad77681_init_param::spi_eng_dev_init
struct no_os_spi_init_param spi_eng_dev_init
Definition: ad77681.h:550
ad77681_clear_error_flags
int32_t ad77681_clear_error_flags(struct ad77681_dev *dev)
Definition: ad77681.c:1581
ad77681_compute_xor
uint8_t ad77681_compute_xor(uint8_t *data, uint8_t data_size, uint8_t init_val)
Definition: ad77681.c:84
AD77681_CONVERSION_DIAG_MUX_MSK
#define AD77681_CONVERSION_DIAG_MUX_MSK
Definition: ad77681.h:111
AD77681_AINp_ENABLED
@ AD77681_AINp_ENABLED
Definition: ad77681.h:427
ad77681_dev::vref
uint16_t vref
Definition: ad77681.h:542
AD77681_DIG_DIAG_ERR_RAM_CRC_MSK
#define AD77681_DIG_DIAG_ERR_RAM_CRC_MSK
Definition: ad77681.h:252
ad77681_REFp_buffer
ad77681_REFp_buffer
Definition: ad77681.h:439
AD77681_BUFn_DISABLED
@ AD77681_BUFn_DISABLED
Definition: ad77681.h:434
ad77681_data_read_mode
ad77681_data_read_mode
Definition: ad77681.h:484
ad77681_soft_reset
int32_t ad77681_soft_reset(struct ad77681_dev *dev)
Definition: ad77681.c:1034
ad77681_status_registers::filt_sat_error
bool filt_sat_error
Definition: ad77681.h:514
AD77681_REG_DIG_DIAG_ENABLE
#define AD77681_REG_DIG_DIAG_ENABLE
Definition: ad77681.h:70
ad77681_apply_offset
int32_t ad77681_apply_offset(struct ad77681_dev *dev, uint32_t value)
Definition: ad77681.c:1071
ad77681_SINC3_ODR
int32_t ad77681_SINC3_ODR(struct ad77681_dev *dev, uint16_t *sinc3_dec_reg, float sinc3_odr)
Definition: ad77681.c:510
ad77681_mclk_div
ad77681_mclk_div
Definition: ad77681.h:351
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
AD77681_INTERFACE_CRC_TYPE
#define AD77681_INTERFACE_CRC_TYPE(x)
Definition: ad77681.h:82
AD77681_GPIO_CNTRL_GPIO3_OP_EN_MSK
#define AD77681_GPIO_CNTRL_GPIO3_OP_EN_MSK
Definition: ad77681.h:173
ad77681_set_VCM_output
int32_t ad77681_set_VCM_output(struct ad77681_dev *dev, enum ad77681_VCM_out VCM_out)
Definition: ad77681.c:613
AD77681_REG_ANALOG2
#define AD77681_REG_ANALOG2
Definition: ad77681.h:52
ad77681_init_param::status_bit
uint8_t status_bit
Definition: ad77681.h:559