no-OS
Loading...
Searching...
No Matches
ad717x.h
Go to the documentation of this file.
1/**************************************************************************/
35
36#ifndef __AD717X_H__
37#define __AD717X_H__
38
39#include <stdint.h>
40#include "no_os_spi.h"
41#include "no_os_util.h"
42#include <stdbool.h>
43
44/* Total Number of Setups in the AD717x-AD411x family */
45#define AD717x_MAX_SETUPS 8
46/* Maximum number of channels in the AD717x-AD411x family */
47#define AD717x_MAX_CHANNELS 16
48
49/*
50 *@enum ad717x_mode
51 *@details ADC Modes of Operation
52**/
54 CONTINUOUS, /* Continuous Mode- Default */
55 SINGLE, /* Single Mode */
56 STANDBY, /* Stand-by Mode */
57 POWER_DOWN, /* Power Down Mode */
58 INTERNAL_OFFSET_CALIB, /* Internal Offset Calibration*/
59 INTERNAL_GAIN_CALIB, /* Internal Gain Calibration */
60 SYS_OFFSET_CALIB, /* System Offset Calibraion */
61 SYS_GAIN_CALIB /* System Gain Calibration */
62};
63
64/*
65 *@enum ad717x_reference_source
66 *@details Type of ADC Reference
67**/
69 EXTERNAL_REF = 0x0, /* External Reference REF+/-*/
70 INTERNAL_REF = 0x2, /* Internal 2.5V Reference */
71 AVDD_AVSS = 0x3 /* AVDD - AVSS */
72};
73
74/*
75 *@enum ad717x_analog_input_pairs
76 *@details Analog Input Pairs to channels for the AD411X Family
77**/
102
103/*
104 *@enum ad717x_analog_input
105 *@details Positive/Negative Analog Input to channels for the AD717x Family
106**/
108 AIN0 = 0x0,
109 AIN1 = 0x1,
110 AIN2 = 0x2,
111 AIN3 = 0x3,
112 AIN4 = 0x4,
117 REF_P = 0x15,
118 REF_M = 0x16
119};
120
121/*
122 *@union ad717x_analog_inputs
123 *@details Types of Analog Inputs
124**/
132
133/*
134 *@enum ad717x_device_type
135 *@details AD717x-AD411x Device definitions
136**/
152
153/*
154 *@struct ad717x_channel_setup
155 *@details Channel setup
156**/
163
164/*
165 *@enum ad717x_enhfilt
166 *@details Post filter for enhanced rejection
167**/
174
175/*
176 *@enum ad717x_order
177 *@details Order of digital filter
178**/
181 sinc3 = 0x3
182};
183
184/*
185 *@enum ad717x_odr
186 *@details Output data rate
187**/
197 sps_5208 = 0x8,
198 sps_2957 = 0x9,
199 sps_1007 = 0xA,
200 sps_503 = 0xB,
201 sps_381 = 0xC,
202 sps_200 = 0xD,
203 sps_100 = 0xE,
204 sps_59 = 0xF,
205 sps_49 = 0x10,
206 sps_20 = 0x11,
207 sps_16 = 0x12,
208 sps_10 = 0x13,
209 sps_5 = 0x14,
210 sps_2p5 = 0x15,
211 sps_1p25 = 0x16
212};
213
214/*
215 *@struct ad717x_filtcon
216 *@details Filter configuration
217**/
225
226/*
227 *@struct ad717x_channel_map
228 *@details Channel mapping
229**/
235
241
243typedef struct {
244 int32_t addr;
245 int32_t value;
246 int32_t size;
248
249/*
250 * The structure describes the device and is used with the ad717x driver.
251 * @slave_select_id: The ID of the Slave Select to be passed to the SPI calls.
252 * @regs: A reference to the register list of the device that the user must
253 * provide when calling the Setup() function.
254 * @num_regs: The length of the register list.
255 * @userCRC: Error check type to use on SPI transfers.
256 */
257typedef struct {
258 /* SPI */
260 /* Device Settings */
262 uint8_t num_regs;
264 /* Active Device */
266 /* Reference enable */
267 bool ref_en;
268 /* Number of channels */
270 /* Setups */
272 /* Channel Mapping*/
274 /* Gain */
276 /* Filter */
278 /* ADC Mode */
280} ad717x_dev;
281
282typedef struct {
283 /* SPI */
285 /* Device Settings */
287 uint8_t num_regs;
288 /* Active Device */
290 /* Reference Enable */
291 bool ref_en;
292 /* Number of Channels */
294 /* Number of Setups */
295 uint8_t num_setups;
296 /* Channel Mapping */
298 /* Setups */
300 /* Gain */
302 /* Filter Configuration */
304 /* ADC Mode */
307
308/* AD717X Register Map */
309#define AD717X_COMM_REG 0x00
310#define AD717X_STATUS_REG 0x00
311#define AD717X_ADCMODE_REG 0x01
312#define AD717X_IFMODE_REG 0x02
313#define AD717X_REGCHECK_REG 0x03
314#define AD717X_DATA_REG 0x04
315#define AD717X_GPIOCON_REG 0x06
316#define AD717X_ID_REG 0x07
317#define AD717X_CHMAP0_REG 0x10
318#define AD717X_CHMAP1_REG 0x11
319#define AD717X_CHMAP2_REG 0x12
320#define AD717X_CHMAP3_REG 0x13
321#define AD717X_CHMAP4_REG 0x14
322#define AD717X_CHMAP5_REG 0x15
323#define AD717X_CHMAP6_REG 0x16
324#define AD717X_CHMAP7_REG 0x17
325#define AD717X_CHMAP8_REG 0x18
326#define AD717X_CHMAP9_REG 0x19
327#define AD717X_CHMAP10_REG 0x1A
328#define AD717X_CHMAP11_REG 0x1B
329#define AD717X_CHMAP12_REG 0x1C
330#define AD717X_CHMAP13_REG 0x1D
331#define AD717X_CHMAP14_REG 0x1E
332#define AD717X_CHMAP15_REG 0x1F
333#define AD717X_SETUPCON0_REG 0x20
334#define AD717X_SETUPCON1_REG 0x21
335#define AD717X_SETUPCON2_REG 0x22
336#define AD717X_SETUPCON3_REG 0x23
337#define AD717X_SETUPCON4_REG 0x24
338#define AD717X_SETUPCON5_REG 0x25
339#define AD717X_SETUPCON6_REG 0x26
340#define AD717X_SETUPCON7_REG 0x27
341#define AD717X_FILTCON0_REG 0x28
342#define AD717X_FILTCON1_REG 0x29
343#define AD717X_FILTCON2_REG 0x2A
344#define AD717X_FILTCON3_REG 0x2B
345#define AD717X_FILTCON4_REG 0x2C
346#define AD717X_FILTCON5_REG 0x2D
347#define AD717X_FILTCON6_REG 0x2E
348#define AD717X_FILTCON7_REG 0x2F
349#define AD717X_OFFSET0_REG 0x30
350#define AD717X_OFFSET1_REG 0x31
351#define AD717X_OFFSET2_REG 0x32
352#define AD717X_OFFSET3_REG 0x33
353#define AD717X_OFFSET4_REG 0x34
354#define AD717X_OFFSET5_REG 0x35
355#define AD717X_OFFSET6_REG 0x36
356#define AD717X_OFFSET7_REG 0x37
357#define AD717X_GAIN0_REG 0x38
358#define AD717X_GAIN1_REG 0x39
359#define AD717X_GAIN2_REG 0x3A
360#define AD717X_GAIN3_REG 0x3B
361#define AD717X_GAIN4_REG 0x3C
362#define AD717X_GAIN5_REG 0x3D
363#define AD717X_GAIN6_REG 0x3E
364#define AD717X_GAIN7_REG 0x3F
365
366/* Communication Register bits */
367#define AD717X_COMM_REG_WEN (0 << 7)
368#define AD717X_COMM_REG_WR (0 << 6)
369#define AD717X_COMM_REG_RD (1 << 6)
370#define AD717X_COMM_REG_RA(x) ((x) & 0x3F)
371
372/* Status Register bits */
373#define AD717X_STATUS_REG_RDY (1 << 7)
374#define AD717X_STATUS_REG_ADC_ERR (1 << 6)
375#define AD717X_STATUS_REG_CRC_ERR (1 << 5)
376#define AD717X_STATUS_REG_REG_ERR (1 << 4)
377#define AD717X_STATUS_REG_CH(x) ((x) & 0x0F)
378
379/* ADC Mode Register bits */
380#define AD717X_ADCMODE_REG_REF_EN (1 << 15)
381#define AD717X_ADCMODE_SING_CYC (1 << 13)
382#define AD717X_ADCMODE_REG_DELAY(x) (((x) & 0x7) << 8)
383#define AD717X_ADCMODE_REG_MODE(x) (((x) & 0x7) << 4)
384#define AD717X_ADCMODE_REG_CLKSEL(x) (((x) & 0x3) << 2)
385
386/* ADC Mode Register additional bits for AD7172-2, AD7172-4, AD4111 and AD4112 */
387#define AD717X_ADCMODE_REG_HIDE_DELAY (1 << 14)
388
389/* Interface Mode Register bits */
390#define AD717X_IFMODE_REG_ALT_SYNC (1 << 12)
391#define AD717X_IFMODE_REG_IOSTRENGTH (1 << 11)
392#define AD717X_IFMODE_REG_DOUT_RESET (1 << 8)
393#define AD717X_IFMODE_REG_CONT_READ (1 << 7)
394#define AD717X_IFMODE_REG_DATA_STAT (1 << 6)
395#define AD717X_IFMODE_REG_REG_CHECK (1 << 5)
396#define AD717X_IFMODE_REG_XOR_EN (0x01 << 2)
397#define AD717X_IFMODE_REG_CRC_EN (0x02 << 2)
398#define AD717X_IFMODE_REG_XOR_STAT(x) (((x) & AD717X_IFMODE_REG_XOR_EN) == AD717X_IFMODE_REG_XOR_EN)
399#define AD717X_IFMODE_REG_CRC_STAT(x) (((x) & AD717X_IFMODE_REG_CRC_EN) == AD717X_IFMODE_REG_CRC_EN)
400#define AD717X_IFMODE_REG_DATA_WL16 (1 << 0)
401
402/* Interface Mode Register additional bits for AD717x family, not for AD411x */
403#define AD717X_IFMODE_REG_HIDE_DELAY (1 << 10)
404
405/* GPIO Configuration Register bits */
406#define AD717X_GPIOCON_REG_MUX_IO (1 << 12)
407#define AD717X_GPIOCON_REG_SYNC_EN (1 << 11)
408#define AD717X_GPIOCON_REG_ERR_EN(x) (((x) & 0x3) << 9)
409#define AD717X_GPIOCON_REG_ERR_DAT (1 << 8)
410#define AD717X_GPIOCON_REG_IP_EN1 (1 << 5)
411#define AD717X_GPIOCON_REG_IP_EN0 (1 << 4)
412#define AD717X_GPIOCON_REG_OP_EN1 (1 << 3)
413#define AD717X_GPIOCON_REG_OP_EN0 (1 << 2)
414#define AD717X_GPIOCON_REG_DATA1 (1 << 1)
415#define AD717X_GPIOCON_REG_DATA0 (1 << 0)
416
417/* GPIO Configuration Register additional bits for AD7172-4, AD7173-8 */
418#define AD717X_GPIOCON_REG_GP_DATA3 (1 << 7)
419#define AD717X_GPIOCON_REG_GP_DATA2 (1 << 6)
420#define AD717X_GPIOCON_REG_GP_DATA1 (1 << 1)
421#define AD717X_GPIOCON_REG_GP_DATA0 (1 << 0)
422
423/* GPIO Configuration Register additional bits for AD7173-8 */
424#define AD717X_GPIOCON_REG_PDSW (1 << 14)
425#define AD717X_GPIOCON_REG_OP_EN2_3 (1 << 13)
426
427/* GPIO Configuration Register additional bits for AD4111, AD4112, AD4114, AD4115 */
428#define AD4111_GPIOCON_REG_OP_EN0_1 (1 << 13)
429#define AD4111_GPIOCON_REG_DATA1 (1 << 7)
430#define AD4111_GPIOCON_REG_DATA0 (1 << 6)
431
432/* GPIO Configuration Register additional bits for AD4116 */
433#define AD4116_GPIOCON_REG_OP_EN2_3 (1 << 13)
434#define AD4116_GPIOCON_REG_DATA3 (1 << 7)
435#define AD4116_GPIOCON_REG_DATA2 (1 << 6)
436
437/* GPIO Configuration Register additional bits for AD4111 */
438#define AD4111_GPIOCON_REG_OW_EN (1 << 12)
439
440/* Channel Map Register 0-3 bits */
441#define AD717X_CHMAP_REG_CH_EN (1 << 15)
442#define AD717X_CHMAP_REG_SETUP_SEL(x) (((x) & 0x7) << 12)
443#define AD717X_CHMAP_REG_AINPOS(x) (((x) & 0x1F) << 5)
444#define AD717X_CHMAP_REG_AINNEG(x) (((x) & 0x1F) << 0)
445
446/* Channel Map Register additional bits for AD4111, AD4112, AD4114, AD4115, AD4116 */
447#define AD4111_CHMAP_REG_INPUT(x) (((x) & 0x3FF) << 0)
448
449/* Setup Configuration Register 0-3 bits */
450#define AD717X_SETUP_CONF_REG_BI_UNIPOLAR (1 << 12)
451#define AD717X_SETUP_CONF_REG_REF_SEL(x) (((x) & 0x3) << 4)
452
453/* Setup Configuration Register additional bits for AD7173-8 */
454#define AD717X_SETUP_CONF_REG_REF_BUF(x) (((x) & 0x3) << 10)
455#define AD717X_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
456#define AD717X_SETUP_CONF_REG_BURNOUT_EN (1 << 7)
457#define AD717X_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
458
459/* Setup Configuration Register additional bits for AD7172-2, AD7172-4, AD7175-2 */
460#define AD717X_SETUP_CONF_REG_REFBUF_P (1 << 11)
461#define AD717X_SETUP_CONF_REG_REFBUF_N (1 << 10)
462#define AD717X_SETUP_CONF_REG_AINBUF_P (1 << 9)
463#define AD717X_SETUP_CONF_REG_AINBUF_N (1 << 8)
464
465/* Setup Configuration Register additional bits for AD4111, AD4112, AD4114, AD4115, AD4116 */
466#define AD4111_SETUP_CONF_REG_REFPOS_BUF (1 << 11)
467#define AD4111_SETUP_CONF_REG_REFNEG_BUF (1 << 10)
468#define AD4111_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
469#define AD4111_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
470
471/* Filter Configuration Register 0-3 bits */
472#define AD717X_FILT_CONF_REG_SINC3_MAP (1 << 15)
473#define AD717X_FILT_CONF_REG_ENHFILTEN (1 << 11)
474#define AD717X_FILT_CONF_REG_ENHFILT(x) (((x) & 0x7) << 8)
475#define AD717X_FILT_CONF_REG_ORDER(x) (((x) & 0x3) << 5)
476#define AD717X_FILT_CONF_REG_ODR(x) (((x) & 0x1F) << 0)
477
478/* ID register mask for relevant bits */
479#define AD717X_ID_REG_MASK 0xFFF0
480/* AD7172-2 ID */
481#define AD7172_2_ID_REG_VALUE 0x00D0
482/* AD7172-4 ID */
483#define AD7172_4_ID_REG_VALUE 0x2050
484/* AD7173-8 ID */
485#define AD7173_8_ID_REG_VALUE 0x30D0
486/* AD7175-2 ID */
487#define AD7175_2_ID_REG_VALUE 0x0CD0
488/* AD7175-8 ID */
489#define AD7175_8_ID_REG_VALUE 0x3CD0
490/* AD7176-2 ID */
491#define AD7176_2_ID_REG_VALUE 0x0C90
492/* AD7177-2 ID */
493#define AD7177_2_ID_REG_VALUE 0x4FD0
494/* AD4111, AD4112 IDs */
495#define AD411X_ID_REG_VALUE 0x30D0
496/* AD4113, AD4114, AD4115 IDs */
497#define AD4113_4_5_ID_REG_VALUE 0x31D0
498/* AD4116 ID */
499#define AD4116_ID_REG_VALUE 0x34D0
500
501#define AD717X_CRC8_POLYNOMIAL_REPRESENTATION 0x07 /* x8 + x2 + x + 1 */
502/* Timeout for ADC Conversion */
503#define AD717X_CONV_TIMEOUT 10000
504
505#define AD717x_CHANNEL_INPUT_MASK NO_OS_GENMASK(9,0)
506#define AD717X_CHMAP_REG_SETUP_SEL_MSK NO_OS_GENMASK(14,12)
507#define AD717X_CHMAP_REG_AINPOS_MSK NO_OS_GENMASK(9,5)
508#define AD717X_CHMAP_REG_AINNEG_MSK NO_OS_GENMASK(4,0)
509#define AD717X_ADCMODE_REG_MODE_MSK NO_OS_GENMASK(6,4)
510#define AD717X_SETUP_CONF_REG_REF_SEL_MSK NO_OS_GENMASK(5,4)
511#define AD717x_ODR_MSK NO_OS_GENMASK(4,0)
512
515 uint8_t reg_address);
516
519 uint8_t addr);
520
523 uint8_t);
524
527
530 uint32_t timeout);
531
534 int32_t* pData);
535
539
541uint8_t AD717X_ComputeCRC8(uint8_t* pBuf,
542 uint8_t bufSize);
543
545uint8_t AD717X_ComputeXOR8(uint8_t * pBuf,
546 uint8_t bufSize);
547
550
554
556int32_t AD717X_remove(ad717x_dev *dev);
557
558/* Enable/Disable Channels */
559int ad717x_set_channel_status(ad717x_dev *device, uint8_t channel_id,
560 bool channel_status);
561/* Set ADC Mode */
563
564/* Configure Analog inputs to channel */
565int ad717x_connect_analog_input(ad717x_dev *device, uint8_t channel_id,
566 union ad717x_analog_inputs analog_input);
567
568/* Assign setup to channel */
569int ad717x_assign_setup(ad717x_dev *device, uint8_t channel_id,
570 uint8_t setup);
571
572/* Assign polarity to setup*/
574 uint8_t setup_id);
575
576/* Assign reference source to setup */
578 enum ad717x_reference_source ref_source, uint8_t setup_id);
579
580/* Enable/Disable input and reference buffers to setup */
582 bool refbuf_en, uint8_t setup_id);
583
584/* Perform single conversion and read sample */
585int ad717x_single_read(ad717x_dev* device, uint8_t id,
586 int32_t *adc_raw_data);
587
588/* Configure device ODR */
589int32_t ad717x_configure_device_odr(ad717x_dev *dev, uint8_t filtcon_id,
590 uint8_t odr_sel);
591
592#endif /* __AD717X_H__ */
uint32_t timeout
Definition ad413x.c:46
@ bipolar
Definition ad5446.h:64
@ AVDD_AVSS
Definition ad7124.h:389
@ INTERNAL_REF
Definition ad7124.h:387
ad717x_enhfilt
Definition ad717x.h:168
@ sps27_db47_ms36p7
Definition ad717x.h:169
@ sps25_db62_ms40
Definition ad717x.h:170
@ sps20_db86_ms50
Definition ad717x.h:171
@ sps16p6_db82_ms60
Definition ad717x.h:172
int ad717x_enable_buffers(ad717x_dev *device, bool inbuf_en, bool refbuf_en, uint8_t setup_id)
int32_t AD717X_ReadRegister(ad717x_dev *device, uint8_t addr)
Reads the value of the specified register.
Definition ad717x.c:409
uint8_t AD717X_ComputeCRC8(uint8_t *pBuf, uint8_t bufSize)
Computes the CRC checksum for a data buffer.
Definition ad717x.c:664
ad717x_st_reg * AD717X_GetReg(ad717x_dev *device, uint8_t reg_address)
Searches through the list of registers of the driver instance and retrieves a pointer to the register...
Definition ad717x.c:381
ad717x_analog_input
Definition ad717x.h:107
@ AVDD_AVSS_M
Definition ad717x.h:116
@ REF_M
Definition ad717x.h:118
@ TEMP_SENSOR_M
Definition ad717x.h:114
@ TEMP_SENSOR_P
Definition ad717x.h:113
@ AVDD_AVSS_P
Definition ad717x.h:115
@ AIN2
Definition ad717x.h:110
@ AIN4
Definition ad717x.h:112
@ AIN0
Definition ad717x.h:108
@ AIN3
Definition ad717x.h:111
@ REF_P
Definition ad717x.h:117
@ AIN1
Definition ad717x.h:109
ad717x_odr
Definition ad717x.h:188
@ sps_10417
Definition ad717x.h:196
@ sps_31250_a
Definition ad717x.h:189
@ sps_31250_d
Definition ad717x.h:192
@ sps_59
Definition ad717x.h:204
@ sps_2p5
Definition ad717x.h:210
@ sps_31250_f
Definition ad717x.h:194
@ sps_16
Definition ad717x.h:207
@ sps_10
Definition ad717x.h:208
@ sps_100
Definition ad717x.h:203
@ sps_381
Definition ad717x.h:201
@ sps31250_e
Definition ad717x.h:193
@ sps_49
Definition ad717x.h:205
@ sps_5
Definition ad717x.h:209
@ sps_1007
Definition ad717x.h:199
@ sps_15625
Definition ad717x.h:195
@ sps_2957
Definition ad717x.h:198
@ sps_200
Definition ad717x.h:202
@ sps_1p25
Definition ad717x.h:211
@ sps_20
Definition ad717x.h:206
@ sps_503
Definition ad717x.h:200
@ sps31250_b
Definition ad717x.h:190
@ sps_31250_c
Definition ad717x.h:191
@ sps_5208
Definition ad717x.h:197
int32_t ad717x_configure_device_odr(ad717x_dev *dev, uint8_t filtcon_id, uint8_t odr_sel)
Configure ODR for the device.
Definition ad717x.c:744
int32_t AD717X_ComputeDataregSize(ad717x_dev *device)
Computes data register read size to account for bit number and status read.
Definition ad717x.c:623
ad717x_order
Definition ad717x.h:179
@ sinc5_sinc1
Definition ad717x.h:180
@ sinc3
Definition ad717x.h:181
ad717x_crc_mode
Definition ad717x.h:236
@ AD717X_DISABLE
Definition ad717x.h:237
@ AD717X_USE_CRC
Definition ad717x.h:238
@ AD717X_USE_XOR
Definition ad717x.h:239
int32_t AD717X_remove(ad717x_dev *dev)
Free the resources allocated by AD717X_Init().
Definition ad717x.c:903
int ad717x_connect_analog_input(ad717x_dev *device, uint8_t channel_id, union ad717x_analog_inputs analog_input)
Set Analog Inputs to channel.
Definition ad717x.c:120
#define AD717x_MAX_CHANNELS
Definition ad717x.h:47
int32_t AD717X_UpdateCRCSetting(ad717x_dev *device)
Updates the CRC settings.
Definition ad717x.c:714
uint8_t AD717X_ComputeXOR8(uint8_t *pBuf, uint8_t bufSize)
Computes the XOR checksum for a data buffer.
Definition ad717x.c:694
ad717x_reference_source
Definition ad717x.h:68
@ EXTERNAL_REF
Definition ad717x.h:69
int32_t AD717X_WriteRegister(ad717x_dev *device, uint8_t)
Writes the value of the specified register.
Definition ad717x.c:481
int ad717x_single_read(ad717x_dev *device, uint8_t id, int32_t *adc_raw_data)
Perform Single Conversion.
Definition ad717x.c:344
int32_t AD717X_WaitForReady(ad717x_dev *device, uint32_t timeout)
Waits until a new conversion result is available.
Definition ad717x.c:555
int ad717x_set_channel_status(ad717x_dev *device, uint8_t channel_id, bool channel_status)
Set channel status - Enable/Disable.
Definition ad717x.c:55
ad717x_device_type
Definition ad717x.h:137
@ ID_AD7175_8
Definition ad717x.h:148
@ ID_AD7175_2
Definition ad717x.h:147
@ ID_AD4113
Definition ad717x.h:140
@ ID_AD4112
Definition ad717x.h:139
@ ID_AD4115
Definition ad717x.h:142
@ ID_AD4111
Definition ad717x.h:138
@ ID_AD7173_8
Definition ad717x.h:146
@ ID_AD7172_2
Definition ad717x.h:144
@ ID_AD7176_2
Definition ad717x.h:149
@ ID_AD4114
Definition ad717x.h:141
@ ID_AD7172_4
Definition ad717x.h:145
@ ID_AD4116
Definition ad717x.h:143
@ ID_AD7177_2
Definition ad717x.h:150
int32_t AD717X_Reset(ad717x_dev *device)
Resets the device.
Definition ad717x.c:531
int ad717x_set_polarity(ad717x_dev *device, bool bipolar, uint8_t setup_id)
Set Polarity.
Definition ad717x.c:219
ad717x_analog_input_pairs
Definition ad717x.h:78
@ VIN6_VIN7
Definition ad717x.h:91
@ VIN4_VINCOM
Definition ad717x.h:88
@ VIN1_VIN0
Definition ad717x.h:81
@ VIN3_VINCOM
Definition ad717x.h:86
@ IIN1P_IIN1M
Definition ad717x.h:97
@ VIN3_VIN2
Definition ad717x.h:85
@ REFERENCE
Definition ad717x.h:100
@ VIN7_VIN6
Definition ad717x.h:93
@ VIN4_VIN5
Definition ad717x.h:87
@ VIN1_VINCOM
Definition ad717x.h:82
@ VIN5_VIN4
Definition ad717x.h:89
@ IIN2P_IIN2M
Definition ad717x.h:96
@ IIN0P_IIN0M
Definition ad717x.h:98
@ VIN5_VINCOM
Definition ad717x.h:90
@ VIN6_VINCOM
Definition ad717x.h:92
@ VIN0_VINCOM
Definition ad717x.h:80
@ VIN0_VIN1
Definition ad717x.h:79
@ VIN2_VIN3
Definition ad717x.h:83
@ VIN7_VINCOM
Definition ad717x.h:94
@ VIN2_VINCOM
Definition ad717x.h:84
@ TEMPERATURE_SENSOR
Definition ad717x.h:99
@ IIN3P_IIN3M
Definition ad717x.h:95
int ad717x_assign_setup(ad717x_dev *device, uint8_t channel_id, uint8_t setup)
Assign Setup to Channel.
Definition ad717x.c:189
int32_t AD717X_ReadData(ad717x_dev *device, int32_t *pData)
Reads the conversion result from the device.
Definition ad717x.c:590
int ad717x_set_adc_mode(ad717x_dev *device, enum ad717x_mode mode)
Set ADC Mode.
Definition ad717x.c:89
int ad717x_set_reference_source(ad717x_dev *device, enum ad717x_reference_source ref_source, uint8_t setup_id)
Select the reference source.
Definition ad717x.c:252
#define AD717x_MAX_SETUPS
Definition ad717x.h:45
int32_t AD717X_Init(ad717x_dev **device, ad717x_init_param init_param)
Initializes the AD717X.
Definition ad717x.c:779
ad717x_mode
Definition ad717x.h:53
@ SYS_GAIN_CALIB
Definition ad717x.h:61
@ POWER_DOWN
Definition ad717x.h:57
@ SINGLE
Definition ad717x.h:55
@ INTERNAL_OFFSET_CALIB
Definition ad717x.h:58
@ SYS_OFFSET_CALIB
Definition ad717x.h:60
@ CONTINUOUS
Definition ad717x.h:54
@ INTERNAL_GAIN_CALIB
Definition ad717x.h:59
@ STANDBY
Definition ad717x.h:56
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Header file of SPI Interface.
Header file of utility functions.
Definition ad717x.h:230
uint8_t setup_sel
Definition ad717x.h:232
union ad717x_analog_inputs analog_inputs
Definition ad717x.h:233
bool channel_enable
Definition ad717x.h:231
Definition ad717x.h:157
bool ref_buff
Definition ad717x.h:159
enum ad717x_reference_source ref_source
Definition ad717x.h:161
bool input_buff
Definition ad717x.h:160
bool bi_unipolar
Definition ad717x.h:158
Definition ad717x.h:257
struct ad717x_channel_map chan_map[AD717x_MAX_CHANNELS]
Definition ad717x.h:273
bool ref_en
Definition ad717x.h:267
struct ad717x_channel_setup setups[AD717x_MAX_SETUPS]
Definition ad717x.h:271
uint8_t num_regs
Definition ad717x.h:262
uint8_t num_channels
Definition ad717x.h:269
struct ad717x_filtcon filter_configuration[AD717x_MAX_SETUPS]
Definition ad717x.h:277
enum ad717x_mode mode
Definition ad717x.h:279
enum ad717x_device_type active_device
Definition ad717x.h:265
uint32_t pga[AD717x_MAX_SETUPS]
Definition ad717x.h:275
ad717x_crc_mode useCRC
Definition ad717x.h:263
struct no_os_spi_desc * spi_desc
Definition ad717x.h:259
ad717x_st_reg * regs
Definition ad717x.h:261
Definition ad717x.h:218
bool enhfilten
Definition ad717x.h:220
enum ad717x_odr odr
Definition ad717x.h:223
bool sinc3_map
Definition ad717x.h:219
enum ad717x_enhfilt enhfilt
Definition ad717x.h:221
enum ad717x_order oder
Definition ad717x.h:222
Definition ad717x.h:282
uint8_t num_setups
Definition ad717x.h:295
struct ad717x_channel_setup setups[AD717x_MAX_SETUPS]
Definition ad717x.h:299
struct ad717x_filtcon filter_configuration[AD717x_MAX_SETUPS]
Definition ad717x.h:303
uint32_t pga[AD717x_MAX_SETUPS]
Definition ad717x.h:301
enum ad717x_mode mode
Definition ad717x.h:305
uint8_t num_channels
Definition ad717x.h:293
enum ad717x_device_type active_device
Definition ad717x.h:289
struct ad717x_channel_map chan_map[AD717x_MAX_CHANNELS]
Definition ad717x.h:297
uint8_t num_regs
Definition ad717x.h:287
struct no_os_spi_init_param spi_init
Definition ad717x.h:284
bool ref_en
Definition ad717x.h:291
ad717x_st_reg * regs
Definition ad717x.h:286
Definition ad717x.h:243
int32_t size
Definition ad717x.h:246
int32_t value
Definition ad717x.h:245
int32_t addr
Definition ad717x.h:244
Definition ad9361_util.h:63
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128
Definition ad717x.h:125
enum ad717x_analog_input neg_analog_input
Definition ad717x.h:129
struct ad717x_analog_inputs::@057143034074145237226116354202256355070303126330 ainp
enum ad717x_analog_input_pairs analog_input_pairs
Definition ad717x.h:126
enum ad717x_analog_input pos_analog_input
Definition ad717x.h:128