no-OS
ad713x.h
Go to the documentation of this file.
1 /***************************************************************************/
35 /*
36  * Supported parts:
37  * - AD7134;
38  * - AD4134.
39  */
40 
41 #ifndef SRC_AD713X_H_
42 #define SRC_AD713X_H_
43 
44 /******************************************************************************/
45 /***************************** Include Files **********************************/
46 /******************************************************************************/
47 
48 #include <stdbool.h>
49 #include <stdio.h>
50 #include "no_os_spi.h"
51 #include "no_os_gpio.h"
52 #include "no_os_util.h"
53 
54 /******************************************************************************/
55 /********************** Macros and Constants Definitions **********************/
56 /******************************************************************************/
57 /*
58  * AD713X registers definition
59  */
60 #define AD713X_REG_INTERFACE_CONFIG_A 0x00
61 #define AD713X_REG_INTERFACE_CONFIG_B 0x01
62 #define AD713X_REG_DEVICE_CONFIG 0x02
63 #define AD713X_REG_CHIP_TYPE 0x03
64 #define AD713X_REG_PRODUCT_ID_LSB 0x04
65 #define AD713X_REG_PRODUCT_ID_MSB 0x05
66 #define AD713X_REG_CHIP_GRADE 0x06
67 #define AD713X_REG_CHIP_INDEX 0x07
68 #define AD713X_REG_SCTATCH_PAD 0x0A
69 #define AD713X_REG_SPI_REVISION 0x0B
70 #define AD713X_REG_VENDOR_ID_LSB 0x0C
71 #define AD713X_REG_VENDOR_ID_MSB 0x0D
72 #define AD713X_REG_STREAM_MODE 0x0E
73 #define AD713X_REG_TRANSFER_REGISTER 0x0F
74 #define AD713X_REG_DEVICE_CONFIG1 0x10
75 #define AD713X_REG_DATA_PACKET_CONFIG 0x11
76 #define AD713X_REG_DIGITAL_INTERFACE_CONFIG 0x12
77 #define AD713X_REG_POWER_DOWN_CONTROL 0x13
78 #define AD713X_REG_AIN_RANGE_SELECT 0x14
79 #define AD713X_REG_DEVICE_STATUS 0x15
80 #define AD713X_REG_ODR_VAL_INT_LSB 0x16
81 #define AD713X_REG_ODR_VAL_INT_MID 0x17
82 #define AD713X_REG_ODR_VAL_INT_MSB 0x18
83 #define AD713X_REG_ODR_VAL_FLT_LSB 0x19
84 #define AD713X_REG_ODR_VAL_FLT_MID0 0x1A
85 #define AD713X_REG_ODR_VAL_FLT_MID1 0x1B
86 #define AD713X_REG_ODR_VAL_FLT_MSB 0x1C
87 #define AD713X_REG_CHANNEL_ODR_SELECT 0x1D
88 #define AD713X_REG_CHAN_DIG_FILTER_SEL 0x1E
89 #define AD713X_REG_FIR_BW_SEL 0x1F
90 #define AD713X_REG_GPIO_DIR_CTRL 0x20
91 #define AD713X_REG_GPIO_DATA 0x21
92 #define AD713X_REG_ERROR_PIN_SRC_CONTROL 0x22
93 #define AD713X_REG_ERROR_PIN_CONTROL 0x23
94 #define AD713X_REG_VCMBUF_CTRL 0x24
95 #define AD713X_REG_DIAGNOSTIC_CONTROL 0x25
96 #define AD713X_REG_MPC_CONFIG 0x26
97 #define AD713X_REG_CH0_GAIN_LSB 0x27
98 #define AD713X_REG_CH0_GAIN_MID 0x28
99 #define AD713X_REG_CH0_GAIN_MSB 0x29
100 #define AD713X_REG_CH0_OFFSET_LSB 0x2A
101 #define AD713X_REG_CH0_OFFSET_MID 0x2B
102 #define AD713X_REG_CH0_OFFSET_MSB 0x2C
103 #define AD713X_REG_CH1_GAIN_LSB 0x2D
104 #define AD713X_REG_CH1_GAIN_MID 0x2E
105 #define AD713X_REG_CH1_GAIN_MSB 0x2F
106 #define AD713X_REG_CH1_OFFSET_LSB 0x30
107 #define AD713X_REG_CH1_OFFSET_MID 0x31
108 #define AD713X_REG_CH1_OFFSET_MSB 0x32
109 #define AD713X_REG_CH2_GAIN_LSB 0x33
110 #define AD713X_REG_CH2_GAIN_MID 0x34
111 #define AD713X_REG_CH2_GAIN_MSB 0x35
112 #define AD713X_REG_CH2_OFFSET_LSB 0x36
113 #define AD713X_REG_CH2_OFFSET_MID 0x37
114 #define AD713X_REG_CH2_OFFSET_MSB 0x38
115 #define AD713X_REG_CH3_GAIN_LSB 0x39
116 #define AD713X_REG_CH3_GAIN_MID 0x3A
117 #define AD713X_REG_CH3_GAIN_MSB 0x3B
118 #define AD713X_REG_CH3_OFFSET_LSB 0x3C
119 #define AD713X_REG_CH3_OFFSET_MID 0x3D
120 #define AD713X_REG_CH3_OFFSET_MSB 0x3E
121 #define AD713X_REG_MCLK_COUNTER 0x3F
122 #define AD713X_REG_DIG_FILTER_OFUF 0x40
123 #define AD713X_REG_DIG_FILTER_SETTLED 0x41
124 #define AD713X_REG_INTERNAL_ERROR 0x42
125 #define AD713X_REG_POWER_OV_ERROR_1 0x43
126 #define AD713X_REG_POWER_UV_ERROR_1 0x44
127 #define AD713X_REG_POWER_OV_ERROR_2 0x45
128 #define AD713X_REG_POWER_UV_ERROR_2 0x46
129 #define AD713X_REG_SPI_ERROR 0x47
130 #define AD713X_REG_AIN_OR_ERROR 0x48
131 #define AD713X_REG_AVDD5_VALUE 0x49
132 #define AD713X_REG_DVDD5_VALUE 0x4A
133 #define AD713X_REG_VREF_VALUE 0x4B
134 #define AD713X_REG_LDOIN_VALUE 0x4C
135 #define AD713X_REG_AVDD1V8_VALUE 0x4D
136 #define AD713X_REG_DVDD1V8_VALUE 0x4E
137 #define AD713X_REG_CLKVDD_VALUE 0x4F
138 #define AD713X_REG_IOVDD_VALUE 0x50
139 #define AD713X_REG_TEMPERATURE_DATA 0x51
140 
141 /*
142  * AD713X_REG_INTERFACE_CONFIG_A
143  */
144 #define AD713X_INT_CONFIG_A_SOFT_RESET_MSK NO_OS_BIT(7)
145 #define AD713X_INT_CONFIG_A_ADDR_ASC_BIT_MSK NO_OS_BIT(5)
146 #define AD713X_INT_CONFIG_A_SDO_ACTIVE_BIT_MSK NO_OS_BIT(4)
147 #define AD713X_INT_CONFIG_A_SOFT_RESET_MIRR_MSK NO_OS_BIT(0)
148 #define AD713X_INT_CONFIG_A_ADDR_ASC_MIRR_MSK NO_OS_BIT(2)
149 #define AD713X_INT_CONFIG_A_SDO_ACTIVE_MIRR_MSK NO_OS_BIT(3)
150 
151 /*
152  * AD713X_REG_INTERFACE_CONFIG_B
153  */
154 #define AD713X_INT_CONFIG_B_SINGLE_INSTR_MSK NO_OS_BIT(7)
155 #define AD713X_INT_CONFIG_B_M_S_RD_CTRL_MSK NO_OS_BIT(5)
156 #define AD713X_INT_CONFIG_B_DIG_IF_RST_MSK NO_OS_BIT(1)
157 
158 /*
159  * AD713X_REG_DEVICE_CONFIG
160  */
161 #define AD713X_DEV_CONFIG_OP_IN_PROGRESS_MSK NO_OS_BIT(5)
162 #define AD713X_DEV_CONFIG_NO_CHIP_ERR_MSK NO_OS_BIT(4)
163 #define AD713X_DEV_CONFIG_PWR_MODE_MSK NO_OS_BIT(0)
164 
165 /*
166  * AD713X_REG_CHIP_TYPE
167  */
168 #define AD713X_CHIP_TYPE_BITS_MSK NO_OS_GENMASK(7, 0)
169 #define AD713X_CHIP_TYPE_BITS_MODE(x) (((x) & 0xFF) << 0)
170 #define AD713X_CHIP_TYPE 0x07
171 
172 /*
173  * AD713X_REG_PRODUCT_ID_LSB
174  */
175 #define AD713X_PRODUCT_ID_LSB_BITS_MSK NO_OS_GENMASK(7, 0)
176 #define AD713X_PRODUCT_ID_LSB_BITS_MODE(x) (((x) & 0xFF) << 0)
177 
178 /*
179  * AD713X_REG_PRODUCT_ID_MSB
180  */
181 #define AD713X_PRODUCT_ID_MSB_BITS_MSK NO_OS_GENMASK(7, 0)
182 #define AD713X_PRODUCT_ID_MSB_BITS_MODE(x) (((x) & 0xFF) << 0)
183 
184 /*
185  * AD713X_REG_CHIP_GRADE
186  */
187 #define AD713X_CHIP_GRADE_PROD_GRADE_BITS_MSK NO_OS_GENMASK(7, 4)
188 #define AD713X_CHIP_GRADE_PROD_GRADE_BITS_MODE(x) (((x) & 0x0F) << 4)
189 #define AD713X_CHIP_GRADE_DEV_VERSION_BITS_MSK NO_OS_GENMASK(3, 0)
190 #define AD713X_CHIP_GRADE_DEV_VERSION_BITS_MODE(x) (((x) & 0x0F) << 0)
191 
192 /*
193  * AD713X_REG_CHIP_INDEX
194  */
195 #define AD713X_SILICON_REV_ID_BITS_MSK NO_OS_GENMASK(7, 0)
196 #define AD713X_SILICON_REV_ID_BITS_MODE(x) (((x) & 0xFF) << 0)
197 
198 /*
199  * AD713X_REG_SCRATCH_PAD
200  */
201 #define AD713X_SCRATCH_PAD_BITS_MSK NO_OS_GENMASK(7, 0)
202 #define AD713X_SCRATCH_PAD_BITS_MODE(x) (((x) & 0xFF) << 0)
203 
204 /*
205  * AD713X_REG_SPI_REVISION
206  */
207 #define AD713X_SPI_REVISION_BITS_MSK NO_OS_GENMASK(7, 0)
208 #define AD713X_SPI_REVISION_BITS_MODE(x) (((x) & 0xFF) << 0)
209 
210 /*
211  * AD713X_REG_VENDOR_ID_LSB
212  */
213 #define AD713X_VENDOR_ID_LSB_BITS_MSK NO_OS_GENMASK(7, 0)
214 #define AD713X_VENDOR_ID_LSB_BITS_MODE(x) (((x) & 0xFF) << 0)
215 
216 /*
217  * AD713X_REG_VENDOR_ID_MSB
218  */
219 #define AD713X_VENDOR_ID_MSB_BITS_MSK NO_OS_GENMASK(7, 0)
220 #define AD713X_VENDOR_ID_MSB_BITS_MODE(x) (((x) & 0xFF) << 0)
221 
222 /*
223  * AD713X_REG_STREAM_MODE
224  */
225 #define AD713X_STREAM_MODE_BITS_MSK NO_OS_GENMASK(7, 0)
226 #define AD713X_STREAM_MODE_BITS_MODE(x) (((x) & 0xFF) << 0)
227 
228 /*
229  * AD713X_REG_TRANSFER_REGISTER
230  */
231 #define AD713X_TRANSFER_MASTER_SLAVE_TX_BIT_MSK NO_OS_BIT(0)
232 
233 /*
234  * AD713X_REG_DEVICE_CONFIG1
235  */
236 #define AD713X_DEV_CONFIG1_MPC_MAGPHA_EN_MSK NO_OS_BIT(6)
237 #define AD713X_DEV_CONFIG1_MPC_MAG_EN_MSK NO_OS_BIT(5)
238 #define AD713X_DEV_CONFIG1_AA_MODE_MSK NO_OS_BIT(4)
239 #define AD713X_DEV_CONFIG1_SDO_PIN_SRC_SEL_MSK NO_OS_BIT(2)
240 #define AD713X_DEV_CONFIG1_REF_GAIN_CORR_EN_MSK NO_OS_BIT(1)
241 #define AD713X_DEV_CONFIG1_CLKOUT_EN_MSK NO_OS_BIT(0)
242 
243 /*
244  * AD713X_REG_DATA_PACKET_CONFIG
245  */
246 #define AD713X_DATA_PACKET_CONFIG_CRC_POLY_RST_MSK NO_OS_BIT(7)
247 #define AD713X_DATA_PACKET_CONFIG_FRAME_MSK NO_OS_GENMASK(6, 4)
248 #define AD713X_DATA_PACKET_CONFIG_FRAME_MODE(x) (((x) & 0x7) << 4)
249 #define AD713X_DATA_PACKET_CONFIG_DCLK_FREQ_MSK NO_OS_GENMASK(3, 0)
250 #define AD713X_DATA_PACKET_CONFIG_DCLK_FREQ_MODE(x) (((x) & 0xF) << 0)
251 
252 /*
253  * AD713X_REG_DIGITAL_INTERFACE_CONFIG
254  */
255 #define AD713X_DIG_INT_CONFIG_DAISY_CHAIN_NUM_MSK NO_OS_GENMASK(7, 4)
256 #define AD713X_DIG_INT_CONFIG_DAISY_CHAIN_NUM_MODE(x) (((x) & 0xF) << 4)
257 #define AD713X_DIG_INT_CONFIG_AVG_SEL_MSK NO_OS_GENMASK(3, 2)
258 #define AD713X_DIG_INT_CONFIG_AVG_SEL_MODE(x) (((x) & 0x3) << 2)
259 #define AD713X_DIG_INT_CONFIG_FORMAT_MSK NO_OS_GENMASK(1, 0)
260 #define AD713X_DIG_INT_CONFIG_FORMAT_MODE(x) (((x) & 0x3) << 0)
261 
262 /*
263  * AD713X_REG_POWER_DOWN_CONTROL
264  */
265 #define AD713X_PWRDN_CTRL_PWRDN_CH_MSK(ch) NO_OS_BIT(ch)
266 #define AD713X_PWRDN_CTRL_PWRDN_AUXADC_MSK NO_OS_BIT(2)
267 #define AD713X_PWRDN_CTRL_PWRDN_LDO_MSK NO_OS_BIT(1)
268 #define AD713X_PWRDN_CTRL_PWRDN_SLEEP_MODE_EN_MSK NO_OS_BIT(0)
269 
270 /*
271  * AD713X_REG_AIN_RANGE_SELECT
272  */
273 #define AD713X_AIN_RANGE_SEL_CH_MSK(ch) NO_OS_BIT(ch)
274 
275 /*
276  * AD713X_REG_DEVICE_STATUS
277  */
278 #define AD713X_DEV_STAT_DCLKMODE_MSK NO_OS_BIT(5)
279 #define AD713X_DEV_STAT_DCLKIO_MSK NO_OS_BIT(4)
280 #define AD713X_DEV_STAT_MODE_MSK NO_OS_BIT(3)
281 #define AD713X_DEV_STAT_CLKSEL_MSK NO_OS_BIT(2)
282 #define AD713X_DEV_STAT_FUSE_ECC_MSK NO_OS_BIT(1)
283 #define AD713X_DEV_STAT_PLL_LOCK_MSK NO_OS_BIT(0)
284 
285 /*
286  * AD713X_REG_ODR_VAL_INT_LSB
287  */
288 #define AD713X_ODR_VAL_INT_LSB_MSK NO_OS_GENMASK(7, 0)
289 #define AD713X_ODR_VAL_INT_LSB_MODE(x) (((x) & 0xFF) << 0)
290 
291 /*
292  * AD713X_REG_ODR_VAL_INT_MID
293  */
294 #define AD713X_ODR_VAL_INT_MID_MSK NO_OS_GENMASK(7, 0)
295 #define AD713X_ODR_VAL_INT_MID_MODE(x) (((x) & 0xFF) << 0)
296 
297 /*
298  * AD713X_REG_ODR_VAL_INT_MSB
299  */
300 #define AD713X_ODR_VAL_INT_MSB_MSK NO_OS_GENMASK(7, 0)
301 #define AD713X_ODR_VAL_INT_MSB_MODE(x) (((x) & 0xFF) << 0)
302 
303 /*
304  * AD713X_REG_ODR_VAL_FLT_LSB
305  */
306 #define AD713X_ODR_VAL_FLT_LSB_MSK NO_OS_GENMASK(7, 0)
307 #define AD713X_ODR_VAL_FLT_LSB_MODE(x) (((x) & 0xFF) << 0)
308 
309 /*
310  * AD713X_REG_ODR_VAL_FLT_MID0
311  */
312 #define AD713X_ODR_VAL_FLT_MID0_MSK NO_OS_GENMASK(7, 0)
313 #define AD713X_ODR_VAL_FLT_MID0_MODE(x) (((x) & 0xFF) << 0)
314 
315 /*
316  * AD713X_REG_ODR_VAL_FLT_MID1
317  */
318 #define AD713X_ODR_VAL_FLT_MID1_MSK NO_OS_GENMASK(7, 0)
319 #define AD713X_ODR_VAL_FLT_MID1_MODE(x) (((x) & 0xFF) << 0)
320 
321 /*
322  * AD713X_REG_ODR_VAL_FLT_MSB
323  */
324 #define AD713X_ODR_VAL_FLT_MSB_MSK NO_OS_GENMASK(7, 0)
325 #define AD713X_ODR_VAL_FLT_MSB_MODE(x) (((x) & 0xFF) << 0)
326 
327 /*
328  * AD713X_REG_CHANNEL_ODR_SELECT
329  */
330 #define AD713X_ODR_RATE_SEL_CH_MSK(ch) (NO_OS_GENMASK(1, 0) << (2 * ch))
331 #define AD713X_ODR_RATE_SEL_CH_MODE(x, ch) (((x) & 0x3) << (2 * ch))
332 
333 /*
334  * AD713X_REG_CHAN_DIG_FILTER_SEL
335  */
336 #define AD713X_DIGFILTER_SEL_CH_MSK(ch) (NO_OS_GENMASK(1, 0) << (2 * ch))
337 #define AD713X_DIGFILTER_SEL_CH_MODE(x, ch) (((x) & 0x3) << (2 * ch))
338 
339 /*
340  * AD713X_REG_FIR_BW_SEL
341  */
342 #define AD713X_FIR_BW_SEL_CH_MSK(ch) NO_OS_BIT(ch)
343 
344 /*
345  * AD713X_REG_GPIO_DIR_CTRL
346  */
347 #define AD713X_GPIO_IO_CTRL_MSK NO_OS_GENMASK(7, 0)
348 #define AD713X_GPIO_IO_CTRL_MODE(x) (((x) & 0xFF) << 0)
349 
350 /*
351  * AD713X_REG_GPIO_DATA
352  */
353 #define AD713X_GPIO_DATA_MSK NO_OS_GENMASK(7, 0)
354 #define AD713X_GPIO_DATA_MODE(x) (((x) & 0xFF) << 0)
355 
356 /*
357  * AD713X_REG_ERROR_PIN_SRC_CONTROL
358  */
359 #define AD713X_ERR_PIN_EN_OR_AIN_MSK NO_OS_BIT(5)
360 #define AD713X_ERR_PIN_EN_INTERNAL_MSK NO_OS_BIT(4)
361 #define AD713X_ERR_PIN_EN_SPI_MSK NO_OS_BIT(3)
362 #define AD713X_ERR_PIN_EN_LDO_XOSC_MSK NO_OS_BIT(2)
363 #define AD713X_ERR_PIN_EN_TEMP_MSK NO_OS_BIT(1)
364 #define AD713X_ERR_PIN_EN_PWR_MSK NO_OS_BIT(0)
365 
366 /*
367  * AD713X_REG_ERROR_PIN_CONTROL
368  */
369 #define AD713X_ERR_PIN_IN_STATUS_MSK NO_OS_BIT(2)
370 #define AD713X_ERR_PIN_IN_EN_MSK NO_OS_BIT(1)
371 #define AD713X_ERR_PIN_OUT_EN_MSK NO_OS_BIT(0)
372 
373 /*
374  * AD713X_REG_VCMBUF_CTRL
375  */
376 #define AD713X_VCMBUF_CTRL_PWRDN_MSK NO_OS_BIT(6)
377 #define AD713X_VCMBUF_CTRL_REF_DIV_SEL_MSK NO_OS_GENMASK(5, 1)
378 #define AD713X_VCMBUF_CTRL_REF_DIV_SEL_MODE(x) (((x) & 0x1F) << 1)
379 #define AD713X_VCMBUF_CTRL_REF_SEL_MSK NO_OS_BIT(0)
380 
381 /*
382  * AD713X_REG_DIAGNOSTIC_CONTROL
383  */
384 #define AD713X_DIAGCTRL_ERR_OR_AIN_EN_MSK NO_OS_BIT(5)
385 #define AD713X_DIAGCTRL_ERR_PWR_MON_EN_MSK NO_OS_BIT(4)
386 #define AD713X_DIAGCTRL_MCLK_CNT_EN_MSK NO_OS_BIT(3)
387 #define AD713X_DIAGCTRL_ERR_SPI_CRC_EN_MSK NO_OS_BIT(2)
388 #define AD713X_DIAGCTRL_ERR_MM_CRC_EN_MSK NO_OS_BIT(1)
389 #define AD713X_DIAGCTRL_FUSE_CRC_CHECK_MSK NO_OS_BIT(0)
390 
391 /*
392  * AD713X_REG_MPC_CONFIG
393  */
394 #define AD713X_MPC_CLKDEL_EN_CH_MSK(ch) (NO_OS_GENMASK(1, 0) << (2 * ch))
395 #define AD713X_MPC_CLKDEL_EN_CH_MODE(x, ch) (((x) & 0x3) << (2 * ch))
396 
397 /*
398  * AD713X_REG_CHx_GAIN_LSB
399  */
400 #define AD713X_CH_GAIN_LSB_MSK NO_OS_GENMASK(7, 0)
401 #define AD713X_CH_GAIN_LSB_MODE(x) (((x) & 0xFF) << 0)
402 
403 /*
404  * AD713X_REG_CHx_GAIN_MID
405  */
406 #define AD713X_CH_GAIN_MID_MSK NO_OS_GENMASK(7, 0)
407 #define AD713X_CH_GAIN_MID_MODE(x) (((x) & 0xFF) << 0)
408 
409 /*
410  * AD713X_REG_CHx_GAIN_MSB
411  */
412 #define AD713X_CH_GAIN_CAL_SEL_MSK NO_OS_BIT(4)
413 #define AD713X_CH_GAIN_MSB_MSK NO_OS_GENMASK(3, 0)
414 #define AD713X_CH_GAIN_MSB_MODE(x) (((x) & 0xF) << 0)
415 
416 /*
417  * AD713X_REG_CHx_OFFSET_LSB
418  */
419 #define AD713X_CH_OFFSET_LSB_MSK NO_OS_GENMASK(7, 0)
420 #define AD713X_CH_OFFSET_LSB_MODE(x) (((x) & 0xFF) << 0)
421 
422 /*
423  * AD713X_REG_CHx_OFFSET_MID
424  */
425 #define AD713X_CH_OFFSET_MID_MSK NO_OS_GENMASK(7, 0)
426 #define AD713X_CH_OFFSET_MID_MODE(x) (((x) & 0xFF) << 0)
427 
428 /*
429  * AD713X_REG_CHx_OFFSET_MSB
430  */
431 #define AD713X_CH_OFFSET_CAL_EN_MSK NO_OS_BIT(7)
432 #define AD713X_CH_OFFSET_MSB_MSK NO_OS_GENMASK(6, 0)
433 #define AD713X_CH_OFFSET_MSB_MODE(x) (((x) & 0x7F) << 0)
434 
435 /*
436  * AD713X_REG_MCLK_COUNTER
437  */
438 #define AD713X_MCLK_COUNT_MSK NO_OS_GENMASK(7, 0)
439 #define AD713X_MCLK_COUNT_MODE(x) (((x) & 0xFF) << 0)
440 
441 /*
442  * AD713X_REG_DIG_FILTER_OFUF
443  */
444 #define AD713X_DIGFILTER_ERR_OFUF_CH_MSK(ch) NO_OS_BIT(ch)
445 
446 /*
447  * AD713X_REG_DIG_FILTER_SETTLED
448  */
449 #define AD713X_DIGFILTER_CH_SETTLED_MSK(ch) NO_OS_BIT(ch)
450 
451 /*
452  * AD713X_REG_INTERNAL_ERROR
453  */
454 #define AD713X_INT_ERR_NO_CLOCK_MSK NO_OS_BIT(5)
455 #define AD713X_INT_ERR_TEMP_MSK NO_OS_BIT(4)
456 #define AD713X_INT_ERR_DCLK_MSK NO_OS_BIT(3)
457 #define AD713X_INT_ERR_FUSE_CRC_MSK NO_OS_BIT(2)
458 #define AD713X_INT_ERR_ASRC_MSK NO_OS_BIT(1)
459 #define AD713X_INT_ERR_MM_CRC_MSK NO_OS_BIT(0)
460 
461 /*
462  * AD713X_REG_POWER_OV_ERROR_1
463  */
464 #define AD713X_POWER_ERR_OV_IOVDD_MSK NO_OS_BIT(3)
465 #define AD713X_POWER_ERR_OV_CLKVDD_MSK NO_OS_BIT(2)
466 #define AD713X_POWER_ERR_OV_DVDD1V8_MSK NO_OS_BIT(1)
467 #define AD713X_POWER_ERR_OV_AVDD1V8_MSK NO_OS_BIT(0)
468 
469 /*
470  * AD713X_REG_POWER_UV_ERROR_1
471  */
472 #define AD713X_POWER_ERR_UV_IOVDD_MSK NO_OS_BIT(3)
473 #define AD713X_POWER_ERR_UV_CLKVDD_MSK NO_OS_BIT(2)
474 #define AD713X_POWER_ERR_UV_DVDD1V8_MSK NO_OS_BIT(1)
475 #define AD713X_POWER_ERR_UV_AVDD1V8_MSK NO_OS_BIT(0)
476 
477 /*
478  * AD713X_REG_POWER_OV_ERROR_2
479  */
480 #define AD713X_POWER_ERR_OV_VREF_MSK NO_OS_BIT(3)
481 #define AD713X_POWER_ERR_OV_LDOIN_MSK NO_OS_BIT(2)
482 #define AD713X_POWER_ERR_OV_DVDD5_MSK NO_OS_BIT(1)
483 #define AD713X_POWER_ERR_OV_AVDD5_MSK NO_OS_BIT(0)
484 
485 /*
486  * AD713X_REG_POWER_UV_ERROR_2
487  */
488 #define AD713X_POWER_ERR_UV_VREF_MSK NO_OS_BIT(3)
489 #define AD713X_POWER_ERR_UV_LDOIN_MSK NO_OS_BIT(2)
490 #define AD713X_POWER_ERR_UV_DVDD5_MSK NO_OS_BIT(1)
491 #define AD713X_POWER_ERR_UV_AVDD5_MSK NO_OS_BIT(0)
492 
493 /*
494  * AD713X_REG_SPI_ERROR
495  */
496 #define AD713X_SPI_ERROR_CRC_MSK NO_OS_BIT(3)
497 #define AD713X_SPI_ERROR_SCLK_CNT_MSK NO_OS_BIT(2)
498 #define AD713X_SPI_ERROR_WRITE_MSK NO_OS_BIT(1)
499 #define AD713X_SPI_ERROR_READ_MSK NO_OS_BIT(0)
500 
501 /*
502  * AD713X_REG_AIN_OR_ERROR
503  */
504 #define AD713X_ERR_OR_AIN_MSK(ch) NO_OS_BIT(ch)
505 
506 /*
507  * AD713X_REG_AVDD5_VALUE
508  */
509 #define AD713X_AVDD5_VALUE_PIN_MSK NO_OS_GENMASK(7, 0)
510 #define AD713X_AVDD5_VALUE_PIN_MODE(x) (((x) & 0xFF) << 0)
511 
512 /*
513  * AD713X_REG_DVDD5_VALUE
514  */
515 #define AD713X_DVDD5_VALUE_PIN_MSK NO_OS_GENMASK(7, 0)
516 #define AD713X_DVDD5_VALUE_PIN_MODE(x) (((x) & 0xFF) << 0)
517 
518 /*
519  * AD713X_REG_VREF_VALUE
520  */
521 #define AD713X_VREF_VALUE_PIN_MSK NO_OS_GENMASK(7, 0)
522 #define AD713X_VREF_VALUE_PIN_MODE(x) (((x) & 0xFF) << 0)
523 
524 /*
525  * AD713X_REG_LDOIN_VALUE
526  */
527 #define AD713X_LDOIN_VALUE_PIN_MSK NO_OS_GENMASK(7, 0)
528 #define AD713X_LDOIN_VALUE_PIN_MODE(x) (((x) & 0xFF) << 0)
529 
530 /*
531  * AD713X_REG_AVDD1V8_VALUE
532  */
533 #define AD713X_AVDD1V8_VALUE_PIN_MSK NO_OS_GENMASK(7, 0)
534 #define AD713X_AVDD1V8_VALUE_PIN_MODE(x) (((x) & 0xFF) << 0)
535 
536 /*
537  * AD713X_REG_DVDD1V8_VALUE
538  */
539 #define AD713X_DVDD1V8_VALUE_PIN_MSK NO_OS_GENMASK(7, 0)
540 #define AD713X_DVDD1V8_VALUE_PIN_MODE(x) (((x) & 0xFF) << 0)
541 
542 /*
543  * AD713X_REG_CLKVDD_VALUE
544  */
545 #define AD713X_CLKVDD_VALUE_PIN_MSK NO_OS_GENMASK(7, 0)
546 #define AD713X_CLKVDD_VALUE_PIN_MODE(x) (((x) & 0xFF) << 0)
547 
548 /*
549  * AD713X_REG_IOVDD_VALUE
550  */
551 #define AD713X_IOVDD_VALUE_PIN_MSK NO_OS_GENMASK(7, 0)
552 #define AD713X_IOVDD_VALUE_PIN_MODE(x) (((x) & 0xFF) << 0)
553 
554 /*
555  * AD713X_REG_TEMPERATURE_DATA
556  */
557 #define AD713X_TEMP_DATA_MSK NO_OS_GENMASK(7, 0)
558 #define AD713X_TEMP_DATA_MODE(x) (((x) & 0xFF) << 0)
559 
560 #define AD713X_REG_READ(x) ((1 << 7) | (x & 0x7F))
561 
562 /******************************************************************************/
563 /*************************** Types Declarations *******************************/
564 /******************************************************************************/
565 
575 };
576 
586 };
587 
601 };
602 
614 };
615 
629 };
630 
644 };
645 
661 };
662 
674 };
675 
680 struct ad713x_dev {
703 };
704 
731  bool pnd;
744 };
745 
746 /******************************************************************************/
747 /************************ Functions Declarations ******************************/
748 /******************************************************************************/
749 
751 int32_t ad713x_spi_reg_read(struct ad713x_dev *dev, uint8_t reg_addr,
752  uint8_t *reg_data);
753 
755 int32_t ad713x_spi_reg_write(struct ad713x_dev *dev, uint8_t reg_addr,
756  uint8_t reg_data);
757 
759 int32_t ad713x_spi_write_mask(struct ad713x_dev *dev, uint8_t reg_addr,
760  uint32_t mask, uint8_t data);
761 
763 int32_t ad713x_set_power_mode(struct ad713x_dev *dev,
764  enum ad713x_power_mode mode);
765 
767 int32_t ad713x_set_out_data_frame(struct ad713x_dev *dev,
768  enum ad713x_adc_data_len adc_data_len,
769  enum ad713x_crc_header crc_header);
770 
772 int32_t ad713x_dout_format_config(struct ad713x_dev *dev,
773  enum ad713x_doutx_format format);
774 
777 int32_t ad713x_mag_phase_clk_delay(struct ad713x_dev *dev, bool clk_delay_en);
778 
780 int32_t ad713x_dig_filter_sel_ch(struct ad713x_dev *dev,
781  enum ad713x_dig_filter_sel filter, enum ad713x_channels ch);
782 
784 int32_t ad713x_clkout_output_en(struct ad713x_dev *dev, bool enable);
785 
787 int32_t ad713x_ref_gain_correction_en(struct ad713x_dev *dev, bool enable);
788 
790 int32_t ad713x_wideband_bw_sel(struct ad713x_dev *dev,
791  enum ad713x_channels ch, uint8_t wb_opt);
792 
794 int32_t ad713x_init(struct ad713x_dev **device,
795  struct ad713x_init_param *init_param);
796 
798 int32_t ad713x_remove(struct ad713x_dev *dev);
799 
801 int32_t ad713x_spi_reg_dump(struct ad713x_dev *dev);
802 
804 int32_t ad713x_channel_sync(struct ad713x_dev *dev);
805 
806 #endif /* SRC_AD713X_H_ */
ad713x_init_param::gpio_dclkmode
struct no_os_gpio_init_param * gpio_dclkmode
Definition: ad713x.h:715
ad717x_mpc_clkdel
ad717x_mpc_clkdel
AD713x list of clock delays.
Definition: ad713x.h:667
no_os_alloc.h
AD713X_MPC_CLKDEL_EN_CH_MSK
#define AD713X_MPC_CLKDEL_EN_CH_MSK(ch)
Definition: ad713x.h:394
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
ad713x.h
Header file for the ad713x Driver.
ad713x_dig_filter_sel_ch
int32_t ad713x_dig_filter_sel_ch(struct ad713x_dev *dev, enum ad713x_dig_filter_sel filter, enum ad713x_channels ch)
Digital filter type selection for each channel.
Definition: ad713x.c:338
SINC6
@ SINC6
Definition: ad713x.h:639
ad713x_doutx_format
ad713x_doutx_format
AD713x list for possible output modes.
Definition: ad713x.h:620
ad713x_init_param::clk_delay_en
bool clk_delay_en
Definition: ad713x.h:740
CH1
@ CH1
Definition: ad713x.h:654
SINC3
@ SINC3
Definition: ad713x.h:641
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
ad713x_dout_format_config
int32_t ad713x_dout_format_config(struct ad713x_dev *dev, enum ad713x_doutx_format format)
DOUTx output format configuration.
Definition: ad713x.c:235
ad713x_mag_phase_clk_delay_chan
int32_t ad713x_mag_phase_clk_delay_chan(struct ad713x_dev *dev, enum ad713x_channels chan, enum ad717x_mpc_clkdel mode)
Change magnitude and phase calibration clock delay mode for a specific channel.
Definition: ad713x.c:290
no_os_spi.h
Header file of SPI Interface.
ad713x_init_param::dev_id
enum ad713x_supported_dev_ids dev_id
Definition: ad713x.h:733
ID_AD7134
@ ID_AD7134
Definition: ad713x.h:572
ad713x_dout_format_config
int32_t ad713x_dout_format_config(struct ad713x_dev *dev, enum ad713x_doutx_format format)
DOUTx output format configuration.
Definition: ad713x.c:235
QUAD_CH_PO
@ QUAD_CH_PO
Definition: ad713x.h:626
ADC_16_BIT_DATA
@ ADC_16_BIT_DATA
Definition: ad713x.h:594
ad713x_wideband_bw_sel
int32_t ad713x_wideband_bw_sel(struct ad713x_dev *dev, enum ad713x_channels ch, uint8_t wb_opt)
Select the wideband filter bandwidth for a channel. The option is relative to ODR,...
Definition: ad713x.c:387
ad713x_init_param
AD713x driver initialization structure.
Definition: ad713x.h:709
NO_OS_IS_ERR_VALUE
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:50
ad713x_channels
ad713x_channels
AD713x list of channels.
Definition: ad713x.h:650
no_os_delay.h
Header file of Delay functions.
CH_AVG_MODE
@ CH_AVG_MODE
Definition: ad713x.h:628
ad713x_dig_filter_sel
ad713x_dig_filter_sel
AD713x list of input filters.
Definition: ad713x.h:635
ADC_24_BIT_DATA
@ ADC_24_BIT_DATA
Definition: ad713x.h:596
ad713x_init_param::crc_header
enum ad713x_crc_header crc_header
Definition: ad713x.h:737
ad713x_set_power_mode
int32_t ad713x_set_power_mode(struct ad713x_dev *dev, enum ad713x_power_mode mode)
Device power mode control.
Definition: ad713x.c:174
AD713X_CH_MAX
@ AD713X_CH_MAX
Definition: ad713x.h:660
ad713x_clkout_output_en
int32_t ad713x_clkout_output_en(struct ad713x_dev *dev, bool enable)
Enable/Disable CLKOUT output.
Definition: ad713x.c:354
ad713x_init_param::pnd
bool pnd
Definition: ad713x.h:731
ad713x_init_param::dclkio_out_nin
bool dclkio_out_nin
Definition: ad713x.h:729
ad713x_set_out_data_frame
int32_t ad713x_set_out_data_frame(struct ad713x_dev *dev, enum ad713x_adc_data_len adc_data_len, enum ad713x_crc_header crc_header)
ADC conversion data output frame control.
Definition: ad713x.c:201
ad713x_power_mode
ad713x_power_mode
AD713x power modes.
Definition: ad713x.h:581
device
Definition: ad9361_util.h:69
ad713x_spi_write_mask
int32_t ad713x_spi_write_mask(struct ad713x_dev *dev, uint8_t reg_addr, uint32_t mask, uint8_t data)
SPI write to device using a mask.
Definition: ad713x.c:149
AD713X_REG_DATA_PACKET_CONFIG
#define AD713X_REG_DATA_PACKET_CONFIG
Definition: ad713x.h:75
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
ad713x_init_param::gpio_pnd
struct no_os_gpio_init_param * gpio_pnd
Definition: ad713x.h:721
FIR
@ FIR
Definition: ad713x.h:637
ad713x_init_param::adc_data_len
enum ad713x_adc_data_len adc_data_len
Definition: ad713x.h:735
ad713x_set_out_data_frame
int32_t ad713x_set_out_data_frame(struct ad713x_dev *dev, enum ad713x_adc_data_len adc_data_len, enum ad713x_crc_header crc_header)
ADC conversion data output frame control.
Definition: ad713x.c:201
ad7616_init_param::mode
enum ad7616_mode mode
Definition: ad7616.h:226
AD713X_DIG_INT_CONFIG_FORMAT_MSK
#define AD713X_DIG_INT_CONFIG_FORMAT_MSK
Definition: ad713x.h:259
ad713x_dev::dev_id
enum ad713x_supported_dev_ids dev_id
Definition: ad713x.h:696
ad713x_channel_sync
int32_t ad713x_channel_sync(struct ad713x_dev *dev)
Multidevice synchronization between channels on different devices.
Definition: ad713x.c:305
ad713x_dev::gpio_dclkio
struct no_os_gpio_desc * gpio_dclkio
Definition: ad713x.h:688
ad713x_clkout_output_en
int32_t ad713x_clkout_output_en(struct ad713x_dev *dev, bool enable)
Enable/Disable CLKOUT output.
Definition: ad713x.c:354
ad713x_remove
int32_t ad713x_remove(struct ad713x_dev *dev)
Free the resources allocated by ad713x_init().
Definition: ad713x.c:638
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
AD713X_REG_DEVICE_CONFIG
#define AD713X_REG_DEVICE_CONFIG
Definition: ad713x.h:62
no_os_spi_desc::chip_select
uint8_t chip_select
Definition: no_os_spi.h:200
ad713x_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad713x.h:682
ad713x_dev::gpio_mode
struct no_os_gpio_desc * gpio_mode
Definition: ad713x.h:684
ad713x_crc_header
ad713x_crc_header
AD713x possible data CRC header choices.
Definition: ad713x.h:607
no_os_error.h
Error codes definition.
ad713x_spi_reg_dump
int32_t ad713x_spi_reg_dump(struct ad713x_dev *dev)
Print all registers values for the AD4134 device. Register map has gaps, reg dump function specific f...
Definition: ad713x.c:664
ad713x_spi_reg_write
int32_t ad713x_spi_reg_write(struct ad713x_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Write to device.
Definition: ad713x.c:129
AD713X_DIGFILTER_SEL_CH_MODE
#define AD713X_DIGFILTER_SEL_CH_MODE(x, ch)
Definition: ad713x.h:337
ad713x_remove
int32_t ad713x_remove(struct ad713x_dev *dev)
Free the resources allocated by ad713x_init().
Definition: ad713x.c:638
AD713X_INT_CONFIG_B_DIG_IF_RST_MSK
#define AD713X_INT_CONFIG_B_DIG_IF_RST_MSK
Definition: ad713x.h:156
SINC3_50_60_REJ
@ SINC3_50_60_REJ
Definition: ad713x.h:643
AD713X_DEV_CONFIG1_REF_GAIN_CORR_EN_MSK
#define AD713X_DEV_CONFIG1_REF_GAIN_CORR_EN_MSK
Definition: ad713x.h:240
AD713X_MPC_CLKDEL_EN_CH_MODE
#define AD713X_MPC_CLKDEL_EN_CH_MODE(x, ch)
Definition: ad713x.h:395
ad713x_channel_sync
int32_t ad713x_channel_sync(struct ad713x_dev *dev)
Multidevice synchronization between channels on different devices.
Definition: ad713x.c:305
NO_CRC
@ NO_CRC
Definition: ad713x.h:609
DELAY_NONE
@ DELAY_NONE
Definition: ad713x.h:669
ad713x_dev::crc_header
enum ad713x_crc_header crc_header
Definition: ad713x.h:700
ad713x_wideband_bw_sel
int32_t ad713x_wideband_bw_sel(struct ad713x_dev *dev, enum ad713x_channels ch, uint8_t wb_opt)
Select the wideband filter bandwidth for a channel. The option is relative to ODR,...
Definition: ad713x.c:387
AD713X_FIR_BW_SEL_CH_MSK
#define AD713X_FIR_BW_SEL_CH_MSK(ch)
Definition: ad713x.h:342
ad713x_ref_gain_correction_en
int32_t ad713x_ref_gain_correction_en(struct ad713x_dev *dev, bool enable)
Enable/Disable reference gain correction.
Definition: ad713x.c:368
ad713x_dev::gpio_resetn
struct no_os_gpio_desc * gpio_resetn
Definition: ad713x.h:690
CH0
@ CH0
Definition: ad713x.h:652
ad713x_spi_reg_write
int32_t ad713x_spi_reg_write(struct ad713x_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Write to device.
Definition: ad713x.c:129
ADC_32_BIT_DATA
@ ADC_32_BIT_DATA
Definition: ad713x.h:598
CRC_6
@ CRC_6
Definition: ad713x.h:611
ad713x_init_param::spi_init_prm
struct no_os_spi_init_param spi_init_prm
Definition: ad713x.h:711
ad713x_adc_data_len
ad713x_adc_data_len
AD713x possible number of bits per data sample.
Definition: ad713x.h:592
ad713x_dig_filter_sel_ch
int32_t ad713x_dig_filter_sel_ch(struct ad713x_dev *dev, enum ad713x_dig_filter_sel filter, enum ad713x_channels ch)
Digital filter type selection for each channel.
Definition: ad713x.c:338
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ad713x_init_param::gpio_dclkio
struct no_os_gpio_init_param * gpio_dclkio
Definition: ad713x.h:717
DELAY_1_CLOCKS
@ DELAY_1_CLOCKS
Definition: ad713x.h:671
ad713x_dev::gpio_dclkmode
struct no_os_gpio_desc * gpio_dclkmode
Definition: ad713x.h:686
AD713X_DEV_CONFIG_PWR_MODE_MSK
#define AD713X_DEV_CONFIG_PWR_MODE_MSK
Definition: ad713x.h:163
AD713X_REG_FIR_BW_SEL
#define AD713X_REG_FIR_BW_SEL
Definition: ad713x.h:89
ID_AD4134
@ ID_AD4134
Definition: ad713x.h:574
ad713x_spi_reg_read
int32_t ad713x_spi_reg_read(struct ad713x_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Read from device.
Definition: ad713x.c:104
AD713X_REG_DEVICE_CONFIG1
#define AD713X_REG_DEVICE_CONFIG1
Definition: ad713x.h:74
ad713x_init_param::gpio_mode
struct no_os_gpio_init_param * gpio_mode
Definition: ad713x.h:713
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
AD713X_DIGFILTER_SEL_CH_MSK
#define AD713X_DIGFILTER_SEL_CH_MSK(ch)
Definition: ad713x.h:336
AD713X_REG_DIGITAL_INTERFACE_CONFIG
#define AD713X_REG_DIGITAL_INTERFACE_CONFIG
Definition: ad713x.h:76
AD713X_DATA_PACKET_CONFIG_FRAME_MSK
#define AD713X_DATA_PACKET_CONFIG_FRAME_MSK
Definition: ad713x.h:247
ad713x_spi_reg_read
int32_t ad713x_spi_reg_read(struct ad713x_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Read from device.
Definition: ad713x.c:104
DELAY_2_CLOCKS
@ DELAY_2_CLOCKS
Definition: ad713x.h:673
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:212
ad713x_init_param::gpio_cs_sync
struct no_os_gpio_init_param * gpio_cs_sync
Definition: ad713x.h:723
ad713x_dev::mode_master_nslave
bool mode_master_nslave
Definition: ad713x.h:702
AD713X_CHIP_TYPE
#define AD713X_CHIP_TYPE
Definition: ad713x.h:170
HIGH_POWER
@ HIGH_POWER
Definition: ad713x.h:585
AD713X_REG_INTERFACE_CONFIG_B
#define AD713X_REG_INTERFACE_CONFIG_B
Definition: ad713x.h:61
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
AD713X_INT_CONFIG_B_SINGLE_INSTR_MSK
#define AD713X_INT_CONFIG_B_SINGLE_INSTR_MSK
Definition: ad713x.h:154
CRC_8
@ CRC_8
Definition: ad713x.h:613
ad713x_mag_phase_clk_delay
int32_t ad713x_mag_phase_clk_delay(struct ad713x_dev *dev, bool clk_delay_en)
Magnitude and phase matching calibration clock delay enable for all channels at 2 clock delay....
Definition: ad713x.c:255
AD713X_REG_CHAN_DIG_FILTER_SEL
#define AD713X_REG_CHAN_DIG_FILTER_SEL
Definition: ad713x.h:88
ad713x_dev
AD713x driver handler structure.
Definition: ad713x.h:680
LOW_POWER
@ LOW_POWER
Definition: ad713x.h:583
ad713x_spi_write_mask
int32_t ad713x_spi_write_mask(struct ad713x_dev *dev, uint8_t reg_addr, uint32_t mask, uint8_t data)
SPI write to device using a mask.
Definition: ad713x.c:149
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ad713x_supported_dev_ids
ad713x_supported_dev_ids
ID of devices supported by the driver.
Definition: ad713x.h:570
ad713x_mag_phase_clk_delay
int32_t ad713x_mag_phase_clk_delay(struct ad713x_dev *dev, bool clk_delay_en)
Magnitude and phase matching calibration clock delay enable for all channels at 2 clock delay....
Definition: ad713x.c:255
AD713X_REG_CHIP_TYPE
#define AD713X_REG_CHIP_TYPE
Definition: ad713x.h:63
ad713x_init_param::format
enum ad713x_doutx_format format
Definition: ad713x.h:738
AD713X_DATA_PACKET_CONFIG_FRAME_MODE
#define AD713X_DATA_PACKET_CONFIG_FRAME_MODE(x)
Definition: ad713x.h:248
ad713x_dev::gpio_cs_sync
struct no_os_spi_desc * gpio_cs_sync
Definition: ad713x.h:694
ad713x_dev::adc_data_len
enum ad713x_adc_data_len adc_data_len
Definition: ad713x.h:698
CH3
@ CH3
Definition: ad713x.h:658
ad713x_init
int32_t ad713x_init(struct ad713x_dev **device, struct ad713x_init_param *init_param)
Initialize the device.
Definition: ad713x.c:551
AD713X_REG_READ
#define AD713X_REG_READ(x)
Definition: ad713x.h:560
ad713x_ref_gain_correction_en
int32_t ad713x_ref_gain_correction_en(struct ad713x_dev *dev, bool enable)
Enable/Disable reference gain correction.
Definition: ad713x.c:368
ad713x_init_param::spi_common_dev
struct no_os_spi_desc * spi_common_dev
Definition: ad713x.h:743
no_os_spi_remove
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
ad713x_init_param::dclkmode_free_ngated
bool dclkmode_free_ngated
Definition: ad713x.h:727
no_os_spi_desc::platform_ops
const struct no_os_spi_platform_ops * platform_ops
Definition: no_os_spi.h:208
no_os_gpio.h
Header file of GPIO Interface.
ID_AD7136
@ ID_AD7136
Definition: ad713x.h:573
AD713X_DEV_CONFIG1_CLKOUT_EN_MSK
#define AD713X_DEV_CONFIG1_CLKOUT_EN_MSK
Definition: ad713x.h:241
no_os_spi_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:198
DUAL_CH_DC
@ DUAL_CH_DC
Definition: ad713x.h:624
ad713x_init_param::gpio_resetn
struct no_os_gpio_init_param * gpio_resetn
Definition: ad713x.h:719
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
ID_AD7132
@ ID_AD7132
Definition: ad713x.h:571
no_os_util.h
Header file of utility functions.
ad713x_set_power_mode
int32_t ad713x_set_power_mode(struct ad713x_dev *dev, enum ad713x_power_mode mode)
Device power mode control.
Definition: ad713x.c:174
ad713x_spi_reg_dump
int32_t ad713x_spi_reg_dump(struct ad713x_dev *dev)
Print all registers values for the AD4134 device. Register map has gaps, reg dump function specific f...
Definition: ad713x.c:664
AD713X_CHIP_TYPE_BITS_MODE
#define AD713X_CHIP_TYPE_BITS_MODE(x)
Definition: ad713x.h:169
AD713X_REG_MPC_CONFIG
#define AD713X_REG_MPC_CONFIG
Definition: ad713x.h:96
SINGLE_CH_DC
@ SINGLE_CH_DC
Definition: ad713x.h:622
no_os_spi_desc::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:202
AD713X_DIG_INT_CONFIG_FORMAT_MODE
#define AD713X_DIG_INT_CONFIG_FORMAT_MODE(x)
Definition: ad713x.h:260
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
ad713x_init
int32_t ad713x_init(struct ad713x_dev **device, struct ad713x_init_param *init_param)
Initialize the device.
Definition: ad713x.c:551
INVALID
@ INVALID
Definition: ad713x.h:600
CH2
@ CH2
Definition: ad713x.h:656
ad713x_init_param::mode_master_nslave
bool mode_master_nslave
Definition: ad713x.h:725
ad713x_dev::gpio_pnd
struct no_os_gpio_desc * gpio_pnd
Definition: ad713x.h:692
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75