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**/
126
127/*
128 *@enum ad717x_analog_input
129 *@details Positive/Negative Analog Input to channels for the AD717x Family
130**/
132 AIN0 = 0x0,
133 AIN1 = 0x1,
134 AIN2 = 0x2,
135 AIN3 = 0x3,
136 AIN4 = 0x4,
137 AIN5 = 0x5,
138 AIN6 = 0x6,
139 AIN7 = 0x7,
140 AIN8 = 0x8,
141 AIN9 = 0x9,
142 AIN10 = 0xA,
143 AIN11 = 0xB,
144 AIN12 = 0xC,
145 AIN13 = 0xD,
146 AIN14 = 0xE,
147 AIN15 = 0xF,
148 AIN16 = 0x10,
153 REF_P = 0x15,
154 REF_M = 0x16
155};
156
157/*
158 *@union ad717x_analog_inputs
159 *@details Types of Analog Inputs
160**/
168
169/*
170 *@enum ad717x_device_type
171 *@details AD717x-AD411x Device definitions
172**/
188
189/*
190 *@struct ad717x_channel_setup
191 *@details Channel setup
192**/
199
200/*
201 *@enum ad717x_enhfilt
202 *@details Post filter for enhanced rejection
203**/
210
211/*
212 *@enum ad717x_order
213 *@details Order of digital filter
214**/
217 sinc3 = 0x3
218};
219
220/*
221 *@enum ad717x_odr
222 *@details Output data rate
223**/
233 sps_5208 = 0x8,
234 sps_2957 = 0x9,
235 sps_1007 = 0xA,
236 sps_503 = 0xB,
237 sps_381 = 0xC,
238 sps_200 = 0xD,
239 sps_100 = 0xE,
240 sps_59 = 0xF,
241 sps_49 = 0x10,
242 sps_20 = 0x11,
243 sps_16 = 0x12,
244 sps_10 = 0x13,
245 sps_5 = 0x14,
246 sps_2p5 = 0x15,
247 sps_1p25 = 0x16
248};
249
250/*
251 *@struct ad717x_filtcon
252 *@details Filter configuration
253**/
261
262/*
263 *@struct ad717x_channel_map
264 *@details Channel mapping
265**/
271
277
279typedef struct {
280 int32_t addr;
281 int32_t value;
282 int32_t size;
284
285/*
286 * The structure describes the device and is used with the ad717x driver.
287 * @slave_select_id: The ID of the Slave Select to be passed to the SPI calls.
288 * @regs: A reference to the register list of the device that the user must
289 * provide when calling the Setup() function.
290 * @num_regs: The length of the register list.
291 * @userCRC: Error check type to use on SPI transfers.
292 */
293typedef struct {
294 /* SPI */
296 /* Device Settings */
298 uint8_t num_regs;
300 /* Active Device */
302 /* Reference enable */
303 bool ref_en;
304 /* Number of channels */
306 /* Setups */
308 /* Channel Mapping*/
310 /* Gain */
312 /* Filter */
314 /* ADC Mode */
316} ad717x_dev;
317
318typedef struct {
319 /* SPI */
321 /* Device Settings */
323 uint8_t num_regs;
324 /* Active Device */
326 /* Reference Enable */
327 bool ref_en;
328 /* Number of Channels */
330 /* Number of Setups */
331 uint8_t num_setups;
332 /* Channel Mapping */
334 /* Setups */
336 /* Gain */
338 /* Filter Configuration */
340 /* ADC Mode */
343
344/* AD717X Register Map */
345#define AD717X_COMM_REG 0x00
346#define AD717X_STATUS_REG 0x00
347#define AD717X_ADCMODE_REG 0x01
348#define AD717X_IFMODE_REG 0x02
349#define AD717X_REGCHECK_REG 0x03
350#define AD717X_DATA_REG 0x04
351#define AD717X_GPIOCON_REG 0x06
352#define AD717X_ID_REG 0x07
353#define AD717X_CHMAP0_REG 0x10
354#define AD717X_CHMAP1_REG 0x11
355#define AD717X_CHMAP2_REG 0x12
356#define AD717X_CHMAP3_REG 0x13
357#define AD717X_CHMAP4_REG 0x14
358#define AD717X_CHMAP5_REG 0x15
359#define AD717X_CHMAP6_REG 0x16
360#define AD717X_CHMAP7_REG 0x17
361#define AD717X_CHMAP8_REG 0x18
362#define AD717X_CHMAP9_REG 0x19
363#define AD717X_CHMAP10_REG 0x1A
364#define AD717X_CHMAP11_REG 0x1B
365#define AD717X_CHMAP12_REG 0x1C
366#define AD717X_CHMAP13_REG 0x1D
367#define AD717X_CHMAP14_REG 0x1E
368#define AD717X_CHMAP15_REG 0x1F
369#define AD717X_SETUPCON0_REG 0x20
370#define AD717X_SETUPCON1_REG 0x21
371#define AD717X_SETUPCON2_REG 0x22
372#define AD717X_SETUPCON3_REG 0x23
373#define AD717X_SETUPCON4_REG 0x24
374#define AD717X_SETUPCON5_REG 0x25
375#define AD717X_SETUPCON6_REG 0x26
376#define AD717X_SETUPCON7_REG 0x27
377#define AD717X_FILTCON0_REG 0x28
378#define AD717X_FILTCON1_REG 0x29
379#define AD717X_FILTCON2_REG 0x2A
380#define AD717X_FILTCON3_REG 0x2B
381#define AD717X_FILTCON4_REG 0x2C
382#define AD717X_FILTCON5_REG 0x2D
383#define AD717X_FILTCON6_REG 0x2E
384#define AD717X_FILTCON7_REG 0x2F
385#define AD717X_OFFSET0_REG 0x30
386#define AD717X_OFFSET1_REG 0x31
387#define AD717X_OFFSET2_REG 0x32
388#define AD717X_OFFSET3_REG 0x33
389#define AD717X_OFFSET4_REG 0x34
390#define AD717X_OFFSET5_REG 0x35
391#define AD717X_OFFSET6_REG 0x36
392#define AD717X_OFFSET7_REG 0x37
393#define AD717X_GAIN0_REG 0x38
394#define AD717X_GAIN1_REG 0x39
395#define AD717X_GAIN2_REG 0x3A
396#define AD717X_GAIN3_REG 0x3B
397#define AD717X_GAIN4_REG 0x3C
398#define AD717X_GAIN5_REG 0x3D
399#define AD717X_GAIN6_REG 0x3E
400#define AD717X_GAIN7_REG 0x3F
401
402/* Communication Register bits */
403#define AD717X_COMM_REG_WEN (0 << 7)
404#define AD717X_COMM_REG_WR (0 << 6)
405#define AD717X_COMM_REG_RD (1 << 6)
406#define AD717X_COMM_REG_RA(x) ((x) & 0x3F)
407
408/* Status Register bits */
409#define AD717X_STATUS_REG_RDY (1 << 7)
410#define AD717X_STATUS_REG_ADC_ERR (1 << 6)
411#define AD717X_STATUS_REG_CRC_ERR (1 << 5)
412#define AD717X_STATUS_REG_REG_ERR (1 << 4)
413#define AD717X_STATUS_REG_CH(x) ((x) & 0x0F)
414
415/* ADC Mode Register bits */
416#define AD717X_ADCMODE_REG_REF_EN (1 << 15)
417#define AD717X_ADCMODE_SING_CYC (1 << 13)
418#define AD717X_ADCMODE_REG_DELAY(x) (((x) & 0x7) << 8)
419#define AD717X_ADCMODE_REG_MODE(x) (((x) & 0x7) << 4)
420#define AD717X_ADCMODE_REG_CLKSEL(x) (((x) & 0x3) << 2)
421
422/* ADC Mode Register additional bits for AD7172-2, AD7172-4, AD4111 and AD4112 */
423#define AD717X_ADCMODE_REG_HIDE_DELAY (1 << 14)
424
425/* Interface Mode Register bits */
426#define AD717X_IFMODE_REG_ALT_SYNC (1 << 12)
427#define AD717X_IFMODE_REG_IOSTRENGTH (1 << 11)
428#define AD717X_IFMODE_REG_DOUT_RESET (1 << 8)
429#define AD717X_IFMODE_REG_CONT_READ (1 << 7)
430#define AD717X_IFMODE_REG_DATA_STAT (1 << 6)
431#define AD717X_IFMODE_REG_REG_CHECK (1 << 5)
432#define AD717X_IFMODE_REG_XOR_EN (0x01 << 2)
433#define AD717X_IFMODE_REG_CRC_EN (0x02 << 2)
434#define AD717X_IFMODE_REG_XOR_STAT(x) (((x) & AD717X_IFMODE_REG_XOR_EN) == AD717X_IFMODE_REG_XOR_EN)
435#define AD717X_IFMODE_REG_CRC_STAT(x) (((x) & AD717X_IFMODE_REG_CRC_EN) == AD717X_IFMODE_REG_CRC_EN)
436#define AD717X_IFMODE_REG_DATA_WL16 (1 << 0)
437
438/* Interface Mode Register additional bits for AD717x family, not for AD411x */
439#define AD717X_IFMODE_REG_HIDE_DELAY (1 << 10)
440
441/* GPIO Configuration Register bits */
442#define AD717X_GPIOCON_REG_MUX_IO (1 << 12)
443#define AD717X_GPIOCON_REG_SYNC_EN (1 << 11)
444#define AD717X_GPIOCON_REG_ERR_EN(x) (((x) & 0x3) << 9)
445#define AD717X_GPIOCON_REG_ERR_DAT (1 << 8)
446#define AD717X_GPIOCON_REG_IP_EN1 (1 << 5)
447#define AD717X_GPIOCON_REG_IP_EN0 (1 << 4)
448#define AD717X_GPIOCON_REG_OP_EN1 (1 << 3)
449#define AD717X_GPIOCON_REG_OP_EN0 (1 << 2)
450#define AD717X_GPIOCON_REG_DATA1 (1 << 1)
451#define AD717X_GPIOCON_REG_DATA0 (1 << 0)
452
453/* GPIO Configuration Register additional bits for AD7172-4, AD7173-8 */
454#define AD717X_GPIOCON_REG_GP_DATA3 (1 << 7)
455#define AD717X_GPIOCON_REG_GP_DATA2 (1 << 6)
456#define AD717X_GPIOCON_REG_GP_DATA1 (1 << 1)
457#define AD717X_GPIOCON_REG_GP_DATA0 (1 << 0)
458
459/* GPIO Configuration Register additional bits for AD7173-8 */
460#define AD717X_GPIOCON_REG_PDSW (1 << 14)
461#define AD717X_GPIOCON_REG_OP_EN2_3 (1 << 13)
462
463/* GPIO Configuration Register additional bits for AD4111, AD4112, AD4114, AD4115 */
464#define AD4111_GPIOCON_REG_OP_EN0_1 (1 << 13)
465#define AD4111_GPIOCON_REG_DATA1 (1 << 7)
466#define AD4111_GPIOCON_REG_DATA0 (1 << 6)
467
468/* GPIO Configuration Register additional bits for AD4116 */
469#define AD4116_GPIOCON_REG_OP_EN2_3 (1 << 13)
470#define AD4116_GPIOCON_REG_DATA3 (1 << 7)
471#define AD4116_GPIOCON_REG_DATA2 (1 << 6)
472
473/* GPIO Configuration Register additional bits for AD4111 */
474#define AD4111_GPIOCON_REG_OW_EN (1 << 12)
475
476/* Channel Map Register 0-3 bits */
477#define AD717X_CHMAP_REG_CH_EN (1 << 15)
478#define AD717X_CHMAP_REG_SETUP_SEL(x) (((x) & 0x7) << 12)
479#define AD717X_CHMAP_REG_AINPOS(x) (((x) & 0x1F) << 5)
480#define AD717X_CHMAP_REG_AINNEG(x) (((x) & 0x1F) << 0)
481
482/* Channel Map Register additional bits for AD4111, AD4112, AD4114, AD4115, AD4116 */
483#define AD4111_CHMAP_REG_INPUT(x) (((x) & 0x3FF) << 0)
484
485/* Setup Configuration Register 0-3 bits */
486#define AD717X_SETUP_CONF_REG_BI_UNIPOLAR (1 << 12)
487#define AD717X_SETUP_CONF_REG_REF_SEL(x) (((x) & 0x3) << 4)
488
489/* Setup Configuration Register additional bits for AD7173-8 */
490#define AD717X_SETUP_CONF_REG_REF_BUF(x) (((x) & 0x3) << 10)
491#define AD717X_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
492#define AD717X_SETUP_CONF_REG_BURNOUT_EN (1 << 7)
493#define AD717X_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
494
495/* Setup Configuration Register additional bits for AD7172-2, AD7172-4, AD7175-2 */
496#define AD717X_SETUP_CONF_REG_REFBUF_P (1 << 11)
497#define AD717X_SETUP_CONF_REG_REFBUF_N (1 << 10)
498#define AD717X_SETUP_CONF_REG_AINBUF_P (1 << 9)
499#define AD717X_SETUP_CONF_REG_AINBUF_N (1 << 8)
500
501/* Setup Configuration Register additional bits for AD4111, AD4112, AD4114, AD4115, AD4116 */
502#define AD4111_SETUP_CONF_REG_REFPOS_BUF (1 << 11)
503#define AD4111_SETUP_CONF_REG_REFNEG_BUF (1 << 10)
504#define AD4111_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
505#define AD4111_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
506
507/* Filter Configuration Register 0-3 bits */
508#define AD717X_FILT_CONF_REG_SINC3_MAP (1 << 15)
509#define AD717X_FILT_CONF_REG_ENHFILTEN (1 << 11)
510#define AD717X_FILT_CONF_REG_ENHFILT(x) (((x) & 0x7) << 8)
511#define AD717X_FILT_CONF_REG_ORDER(x) (((x) & 0x3) << 5)
512#define AD717X_FILT_CONF_REG_ODR(x) (((x) & 0x1F) << 0)
513
514/* ID register mask for relevant bits */
515#define AD717X_ID_REG_MASK 0xFFF0
516/* AD7172-2 ID */
517#define AD7172_2_ID_REG_VALUE 0x00D0
518/* AD7172-4 ID */
519#define AD7172_4_ID_REG_VALUE 0x2050
520/* AD7173-8 ID */
521#define AD7173_8_ID_REG_VALUE 0x30D0
522/* AD7175-2 ID */
523#define AD7175_2_ID_REG_VALUE 0x0CD0
524/* AD7175-8 ID */
525#define AD7175_8_ID_REG_VALUE 0x3CD0
526/* AD7176-2 ID */
527#define AD7176_2_ID_REG_VALUE 0x0C90
528/* AD7177-2 ID */
529#define AD7177_2_ID_REG_VALUE 0x4FD0
530/* AD4111, AD4112 IDs */
531#define AD411X_ID_REG_VALUE 0x30D0
532/* AD4113, AD4114, AD4115 IDs */
533#define AD4113_4_5_ID_REG_VALUE 0x31D0
534/* AD4116 ID */
535#define AD4116_ID_REG_VALUE 0x34D0
536
537#define AD717X_CRC8_POLYNOMIAL_REPRESENTATION 0x07 /* x8 + x2 + x + 1 */
538/* Timeout for ADC Conversion */
539#define AD717X_CONV_TIMEOUT 10000
540
541#define AD717x_CHANNEL_INPUT_MASK NO_OS_GENMASK(9,0)
542#define AD717X_CHMAP_REG_SETUP_SEL_MSK NO_OS_GENMASK(14,12)
543#define AD717X_CHMAP_REG_AINPOS_MSK NO_OS_GENMASK(9,5)
544#define AD717X_CHMAP_REG_AINNEG_MSK NO_OS_GENMASK(4,0)
545#define AD717X_ADCMODE_REG_MODE_MSK NO_OS_GENMASK(6,4)
546#define AD717X_SETUP_CONF_REG_REF_SEL_MSK NO_OS_GENMASK(5,4)
547#define AD717x_ODR_MSK NO_OS_GENMASK(4,0)
548
551 uint8_t reg_address);
552
555 uint8_t addr);
556
559 uint8_t);
560
563
566 uint32_t timeout);
567
570 int32_t* pData);
571
575
577uint8_t AD717X_ComputeCRC8(uint8_t* pBuf,
578 uint8_t bufSize);
579
581uint8_t AD717X_ComputeXOR8(uint8_t * pBuf,
582 uint8_t bufSize);
583
586
590
592int32_t AD717X_remove(ad717x_dev *dev);
593
594/* Enable/Disable Channels */
595int ad717x_set_channel_status(ad717x_dev *device, uint8_t channel_id,
596 bool channel_status);
597/* Set ADC Mode */
599
600/* Configure Analog inputs to channel */
601int ad717x_connect_analog_input(ad717x_dev *device, uint8_t channel_id,
602 union ad717x_analog_inputs analog_input);
603
604/* Assign setup to channel */
605int ad717x_assign_setup(ad717x_dev *device, uint8_t channel_id,
606 uint8_t setup);
607
608/* Assign polarity to setup*/
610 uint8_t setup_id);
611
612/* Assign reference source to setup */
614 enum ad717x_reference_source ref_source, uint8_t setup_id);
615
616/* Enable/Disable input and reference buffers to setup */
617int ad717x_enable_buffers(ad717x_dev* device, bool inbuf_en,
618 bool refbuf_en, uint8_t setup_id);
619
620/* Perform single conversion and read sample */
621int ad717x_single_read(ad717x_dev* device, uint8_t id,
622 int32_t *adc_raw_data);
623
624/* Configure device ODR */
625int32_t ad717x_configure_device_odr(ad717x_dev *dev, uint8_t filtcon_id,
626 uint8_t odr_sel);
627
628#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:204
@ sps27_db47_ms36p7
Definition ad717x.h:205
@ sps25_db62_ms40
Definition ad717x.h:206
@ sps20_db86_ms50
Definition ad717x.h:207
@ sps16p6_db82_ms60
Definition ad717x.h:208
int ad717x_enable_buffers(ad717x_dev *device, bool inbuf_en, bool refbuf_en, uint8_t setup_id)
Enable input and reference buffers.
Definition ad717x.c:300
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:131
@ AVDD_AVSS_M
Definition ad717x.h:152
@ AIN8
Definition ad717x.h:140
@ REF_M
Definition ad717x.h:154
@ AIN12
Definition ad717x.h:144
@ TEMP_SENSOR_M
Definition ad717x.h:150
@ AIN10
Definition ad717x.h:142
@ AIN5
Definition ad717x.h:137
@ AIN16
Definition ad717x.h:148
@ TEMP_SENSOR_P
Definition ad717x.h:149
@ AVDD_AVSS_P
Definition ad717x.h:151
@ AIN15
Definition ad717x.h:147
@ AIN11
Definition ad717x.h:143
@ AIN2
Definition ad717x.h:134
@ AIN4
Definition ad717x.h:136
@ AIN13
Definition ad717x.h:145
@ AIN14
Definition ad717x.h:146
@ AIN7
Definition ad717x.h:139
@ AIN0
Definition ad717x.h:132
@ AIN6
Definition ad717x.h:138
@ AIN9
Definition ad717x.h:141
@ AIN3
Definition ad717x.h:135
@ REF_P
Definition ad717x.h:153
@ AIN1
Definition ad717x.h:133
ad717x_odr
Definition ad717x.h:224
@ sps_10417
Definition ad717x.h:232
@ sps_31250_a
Definition ad717x.h:225
@ sps_31250_d
Definition ad717x.h:228
@ sps_59
Definition ad717x.h:240
@ sps_2p5
Definition ad717x.h:246
@ sps_31250_f
Definition ad717x.h:230
@ sps_16
Definition ad717x.h:243
@ sps_10
Definition ad717x.h:244
@ sps_100
Definition ad717x.h:239
@ sps_381
Definition ad717x.h:237
@ sps31250_e
Definition ad717x.h:229
@ sps_49
Definition ad717x.h:241
@ sps_5
Definition ad717x.h:245
@ sps_1007
Definition ad717x.h:235
@ sps_15625
Definition ad717x.h:231
@ sps_2957
Definition ad717x.h:234
@ sps_200
Definition ad717x.h:238
@ sps_1p25
Definition ad717x.h:247
@ sps_20
Definition ad717x.h:242
@ sps_503
Definition ad717x.h:236
@ sps31250_b
Definition ad717x.h:226
@ sps_31250_c
Definition ad717x.h:227
@ sps_5208
Definition ad717x.h:233
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:215
@ sinc5_sinc1
Definition ad717x.h:216
@ sinc3
Definition ad717x.h:217
ad717x_crc_mode
Definition ad717x.h:272
@ AD717X_DISABLE
Definition ad717x.h:273
@ AD717X_USE_CRC
Definition ad717x.h:274
@ AD717X_USE_XOR
Definition ad717x.h:275
int32_t AD717X_remove(ad717x_dev *dev)
Free the resources allocated by AD717X_Init().
Definition ad717x.c:904
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:173
@ ID_AD7175_8
Definition ad717x.h:184
@ ID_AD7175_2
Definition ad717x.h:183
@ ID_AD4113
Definition ad717x.h:176
@ ID_AD4112
Definition ad717x.h:175
@ ID_AD4115
Definition ad717x.h:178
@ ID_AD4111
Definition ad717x.h:174
@ ID_AD7173_8
Definition ad717x.h:182
@ ID_AD7172_2
Definition ad717x.h:180
@ ID_AD7176_2
Definition ad717x.h:185
@ ID_AD4114
Definition ad717x.h:177
@ ID_AD7172_4
Definition ad717x.h:181
@ ID_AD4116
Definition ad717x.h:179
@ ID_AD7177_2
Definition ad717x.h:186
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
@ VIN15_VINCOM
Definition ad717x.h:110
@ ADCIN12_ADCIN15
Definition ad717x.h:116
@ ADCIN14_ADCIN15
Definition ad717x.h:118
@ VIN6_VIN7
Definition ad717x.h:91
@ VIN4_VINCOM
Definition ad717x.h:88
@ VIN1_VIN0
Definition ad717x.h:81
@ VIN14_VINCOM
Definition ad717x.h:108
@ VIN14_VIN15
Definition ad717x.h:107
@ VIN3_VINCOM
Definition ad717x.h:86
@ ADCIN13_ADCIN15
Definition ad717x.h:117
@ IIN1P_IIN1M
Definition ad717x.h:121
@ VIN8_VINCOM
Definition ad717x.h:96
@ VIN13_VIN12
Definition ad717x.h:105
@ VIN3_VIN2
Definition ad717x.h:85
@ REFERENCE
Definition ad717x.h:124
@ VIN7_VIN6
Definition ad717x.h:93
@ VIN4_VIN5
Definition ad717x.h:87
@ VIN9_VIN8
Definition ad717x.h:97
@ ADCIN11_ADCIN12
Definition ad717x.h:111
@ VIN1_VINCOM
Definition ad717x.h:82
@ VIN5_VIN4
Definition ad717x.h:89
@ VIN10_VINCOM
Definition ad717x.h:100
@ VIN9_VINCOM
Definition ad717x.h:98
@ IIN2P_IIN2M
Definition ad717x.h:120
@ IIN0P_IIN0M
Definition ad717x.h:122
@ VIN5_VINCOM
Definition ad717x.h:90
@ VIN11_VIN10
Definition ad717x.h:101
@ VIN6_VINCOM
Definition ad717x.h:92
@ VIN0_VINCOM
Definition ad717x.h:80
@ VIN0_VIN1
Definition ad717x.h:79
@ VIN12_VIN13
Definition ad717x.h:103
@ ADCIN14_ADCIN13
Definition ad717x.h:114
@ VIN12_VINCOM
Definition ad717x.h:104
@ VIN2_VIN3
Definition ad717x.h:83
@ VIN11_VINCOM
Definition ad717x.h:102
@ VIN7_VINCOM
Definition ad717x.h:94
@ ADCIN11_ADCIN15
Definition ad717x.h:115
@ VIN8_VIN9
Definition ad717x.h:95
@ VIN2_VINCOM
Definition ad717x.h:84
@ VIN15_VIN14
Definition ad717x.h:109
@ TEMPERATURE_SENSOR
Definition ad717x.h:123
@ ADCIN13_ADCIN14
Definition ad717x.h:113
@ IIN3P_IIN3M
Definition ad717x.h:119
@ VIN10_VIN11
Definition ad717x.h:99
@ ADCIN12_ADCIN11
Definition ad717x.h:112
@ VIN13_VINCOM
Definition ad717x.h:106
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:780
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:106
Header file of SPI Interface.
Header file of utility functions.
Definition ad717x.h:266
uint8_t setup_sel
Definition ad717x.h:268
union ad717x_analog_inputs analog_inputs
Definition ad717x.h:269
bool channel_enable
Definition ad717x.h:267
Definition ad717x.h:193
bool ref_buff
Definition ad717x.h:195
enum ad717x_reference_source ref_source
Definition ad717x.h:197
bool input_buff
Definition ad717x.h:196
bool bi_unipolar
Definition ad717x.h:194
Definition ad717x.h:293
struct ad717x_channel_map chan_map[AD717x_MAX_CHANNELS]
Definition ad717x.h:309
bool ref_en
Definition ad717x.h:303
struct ad717x_channel_setup setups[AD717x_MAX_SETUPS]
Definition ad717x.h:307
uint8_t num_regs
Definition ad717x.h:298
uint8_t num_channels
Definition ad717x.h:305
struct ad717x_filtcon filter_configuration[AD717x_MAX_SETUPS]
Definition ad717x.h:313
enum ad717x_mode mode
Definition ad717x.h:315
enum ad717x_device_type active_device
Definition ad717x.h:301
uint32_t pga[AD717x_MAX_SETUPS]
Definition ad717x.h:311
ad717x_crc_mode useCRC
Definition ad717x.h:299
struct no_os_spi_desc * spi_desc
Definition ad717x.h:295
ad717x_st_reg * regs
Definition ad717x.h:297
Definition ad717x.h:254
bool enhfilten
Definition ad717x.h:256
enum ad717x_odr odr
Definition ad717x.h:259
bool sinc3_map
Definition ad717x.h:255
enum ad717x_enhfilt enhfilt
Definition ad717x.h:257
enum ad717x_order oder
Definition ad717x.h:258
Definition ad717x.h:318
uint8_t num_setups
Definition ad717x.h:331
struct ad717x_channel_setup setups[AD717x_MAX_SETUPS]
Definition ad717x.h:335
struct ad717x_filtcon filter_configuration[AD717x_MAX_SETUPS]
Definition ad717x.h:339
uint32_t pga[AD717x_MAX_SETUPS]
Definition ad717x.h:337
enum ad717x_mode mode
Definition ad717x.h:341
uint8_t num_channels
Definition ad717x.h:329
enum ad717x_device_type active_device
Definition ad717x.h:325
struct ad717x_channel_map chan_map[AD717x_MAX_CHANNELS]
Definition ad717x.h:333
uint8_t num_regs
Definition ad717x.h:323
struct no_os_spi_init_param spi_init
Definition ad717x.h:320
bool ref_en
Definition ad717x.h:327
ad717x_st_reg * regs
Definition ad717x.h:322
Definition ad717x.h:279
int32_t size
Definition ad717x.h:282
int32_t value
Definition ad717x.h:281
int32_t addr
Definition ad717x.h:280
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:161
enum ad717x_analog_input neg_analog_input
Definition ad717x.h:165
struct ad717x_analog_inputs::@057143034074145237226116354202256355070303126330 ainp
enum ad717x_analog_input_pairs analog_input_pairs
Definition ad717x.h:162
enum ad717x_analog_input pos_analog_input
Definition ad717x.h:164