no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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**/
151
152/*
153 *@struct ad717x_channel_setup
154 *@details Channel setup
155**/
162
163/*
164 *@enum ad717x_enhfilt
165 *@details Post filter for enhanced rejection
166**/
173
174/*
175 *@enum ad717x_order
176 *@details Order of digital filter
177**/
180 sinc3 = 0x3
181};
182
183/*
184 *@enum ad717x_odr
185 *@details Output data rate
186**/
196 sps_5208 = 0x8,
197 sps_2957 = 0x9,
198 sps_1007 = 0xA,
199 sps_503 = 0xB,
200 sps_381 = 0xC,
201 sps_200 = 0xD,
202 sps_100 = 0xE,
203 sps_59 = 0xF,
204 sps_49 = 0x10,
205 sps_20 = 0x11,
206 sps_16 = 0x12,
207 sps_10 = 0x13,
208 sps_5 = 0x14,
209 sps_2p5 = 0x15,
210 sps_1p25 = 0x16
211};
212
213/*
214 *@struct ad717x_filtcon
215 *@details Filter configuration
216**/
224
225/*
226 *@struct ad717x_channel_map
227 *@details Channel mapping
228**/
234
240
242typedef struct {
243 int32_t addr;
244 int32_t value;
245 int32_t size;
247
248/*
249 * The structure describes the device and is used with the ad717x driver.
250 * @slave_select_id: The ID of the Slave Select to be passed to the SPI calls.
251 * @regs: A reference to the register list of the device that the user must
252 * provide when calling the Setup() function.
253 * @num_regs: The length of the register list.
254 * @userCRC: Error check type to use on SPI transfers.
255 */
256typedef struct {
257 /* SPI */
259 /* Device Settings */
261 uint8_t num_regs;
263 /* Active Device */
265 /* Reference enable */
266 bool ref_en;
267 /* Number of channels */
269 /* Setups */
271 /* Channel Mapping*/
273 /* Gain */
275 /* Filter */
277 /* ADC Mode */
279} ad717x_dev;
280
281typedef struct {
282 /* SPI */
284 /* Device Settings */
286 uint8_t num_regs;
287 /* Active Device */
289 /* Reference Enable */
290 bool ref_en;
291 /* Number of Channels */
293 /* Number of Setups */
294 uint8_t num_setups;
295 /* Channel Mapping */
297 /* Setups */
299 /* Gain */
301 /* Filter Configuration */
303 /* ADC Mode */
306
307/* AD717X Register Map */
308#define AD717X_COMM_REG 0x00
309#define AD717X_STATUS_REG 0x00
310#define AD717X_ADCMODE_REG 0x01
311#define AD717X_IFMODE_REG 0x02
312#define AD717X_REGCHECK_REG 0x03
313#define AD717X_DATA_REG 0x04
314#define AD717X_GPIOCON_REG 0x06
315#define AD717X_ID_REG 0x07
316#define AD717X_CHMAP0_REG 0x10
317#define AD717X_CHMAP1_REG 0x11
318#define AD717X_CHMAP2_REG 0x12
319#define AD717X_CHMAP3_REG 0x13
320#define AD717X_CHMAP4_REG 0x14
321#define AD717X_CHMAP5_REG 0x15
322#define AD717X_CHMAP6_REG 0x16
323#define AD717X_CHMAP7_REG 0x17
324#define AD717X_CHMAP8_REG 0x18
325#define AD717X_CHMAP9_REG 0x19
326#define AD717X_CHMAP10_REG 0x1A
327#define AD717X_CHMAP11_REG 0x1B
328#define AD717X_CHMAP12_REG 0x1C
329#define AD717X_CHMAP13_REG 0x1D
330#define AD717X_CHMAP14_REG 0x1E
331#define AD717X_CHMAP15_REG 0x1F
332#define AD717X_SETUPCON0_REG 0x20
333#define AD717X_SETUPCON1_REG 0x21
334#define AD717X_SETUPCON2_REG 0x22
335#define AD717X_SETUPCON3_REG 0x23
336#define AD717X_SETUPCON4_REG 0x24
337#define AD717X_SETUPCON5_REG 0x25
338#define AD717X_SETUPCON6_REG 0x26
339#define AD717X_SETUPCON7_REG 0x27
340#define AD717X_FILTCON0_REG 0x28
341#define AD717X_FILTCON1_REG 0x29
342#define AD717X_FILTCON2_REG 0x2A
343#define AD717X_FILTCON3_REG 0x2B
344#define AD717X_FILTCON4_REG 0x2C
345#define AD717X_FILTCON5_REG 0x2D
346#define AD717X_FILTCON6_REG 0x2E
347#define AD717X_FILTCON7_REG 0x2F
348#define AD717X_OFFSET0_REG 0x30
349#define AD717X_OFFSET1_REG 0x31
350#define AD717X_OFFSET2_REG 0x32
351#define AD717X_OFFSET3_REG 0x33
352#define AD717X_OFFSET4_REG 0x34
353#define AD717X_OFFSET5_REG 0x35
354#define AD717X_OFFSET6_REG 0x36
355#define AD717X_OFFSET7_REG 0x37
356#define AD717X_GAIN0_REG 0x38
357#define AD717X_GAIN1_REG 0x39
358#define AD717X_GAIN2_REG 0x3A
359#define AD717X_GAIN3_REG 0x3B
360#define AD717X_GAIN4_REG 0x3C
361#define AD717X_GAIN5_REG 0x3D
362#define AD717X_GAIN6_REG 0x3E
363#define AD717X_GAIN7_REG 0x3F
364
365/* Communication Register bits */
366#define AD717X_COMM_REG_WEN (0 << 7)
367#define AD717X_COMM_REG_WR (0 << 6)
368#define AD717X_COMM_REG_RD (1 << 6)
369#define AD717X_COMM_REG_RA(x) ((x) & 0x3F)
370
371/* Status Register bits */
372#define AD717X_STATUS_REG_RDY (1 << 7)
373#define AD717X_STATUS_REG_ADC_ERR (1 << 6)
374#define AD717X_STATUS_REG_CRC_ERR (1 << 5)
375#define AD717X_STATUS_REG_REG_ERR (1 << 4)
376#define AD717X_STATUS_REG_CH(x) ((x) & 0x0F)
377
378/* ADC Mode Register bits */
379#define AD717X_ADCMODE_REG_REF_EN (1 << 15)
380#define AD717X_ADCMODE_SING_CYC (1 << 13)
381#define AD717X_ADCMODE_REG_DELAY(x) (((x) & 0x7) << 8)
382#define AD717X_ADCMODE_REG_MODE(x) (((x) & 0x7) << 4)
383#define AD717X_ADCMODE_REG_CLKSEL(x) (((x) & 0x3) << 2)
384
385/* ADC Mode Register additional bits for AD7172-2, AD7172-4, AD4111 and AD4112 */
386#define AD717X_ADCMODE_REG_HIDE_DELAY (1 << 14)
387
388/* Interface Mode Register bits */
389#define AD717X_IFMODE_REG_ALT_SYNC (1 << 12)
390#define AD717X_IFMODE_REG_IOSTRENGTH (1 << 11)
391#define AD717X_IFMODE_REG_DOUT_RESET (1 << 8)
392#define AD717X_IFMODE_REG_CONT_READ (1 << 7)
393#define AD717X_IFMODE_REG_DATA_STAT (1 << 6)
394#define AD717X_IFMODE_REG_REG_CHECK (1 << 5)
395#define AD717X_IFMODE_REG_XOR_EN (0x01 << 2)
396#define AD717X_IFMODE_REG_CRC_EN (0x02 << 2)
397#define AD717X_IFMODE_REG_XOR_STAT(x) (((x) & AD717X_IFMODE_REG_XOR_EN) == AD717X_IFMODE_REG_XOR_EN)
398#define AD717X_IFMODE_REG_CRC_STAT(x) (((x) & AD717X_IFMODE_REG_CRC_EN) == AD717X_IFMODE_REG_CRC_EN)
399#define AD717X_IFMODE_REG_DATA_WL16 (1 << 0)
400
401/* Interface Mode Register additional bits for AD717x family, not for AD411x */
402#define AD717X_IFMODE_REG_HIDE_DELAY (1 << 10)
403
404/* GPIO Configuration Register bits */
405#define AD717X_GPIOCON_REG_MUX_IO (1 << 12)
406#define AD717X_GPIOCON_REG_SYNC_EN (1 << 11)
407#define AD717X_GPIOCON_REG_ERR_EN(x) (((x) & 0x3) << 9)
408#define AD717X_GPIOCON_REG_ERR_DAT (1 << 8)
409#define AD717X_GPIOCON_REG_IP_EN1 (1 << 5)
410#define AD717X_GPIOCON_REG_IP_EN0 (1 << 4)
411#define AD717X_GPIOCON_REG_OP_EN1 (1 << 3)
412#define AD717X_GPIOCON_REG_OP_EN0 (1 << 2)
413#define AD717X_GPIOCON_REG_DATA1 (1 << 1)
414#define AD717X_GPIOCON_REG_DATA0 (1 << 0)
415
416/* GPIO Configuration Register additional bits for AD7172-4, AD7173-8 */
417#define AD717X_GPIOCON_REG_GP_DATA3 (1 << 7)
418#define AD717X_GPIOCON_REG_GP_DATA2 (1 << 6)
419#define AD717X_GPIOCON_REG_GP_DATA1 (1 << 1)
420#define AD717X_GPIOCON_REG_GP_DATA0 (1 << 0)
421
422/* GPIO Configuration Register additional bits for AD7173-8 */
423#define AD717X_GPIOCON_REG_PDSW (1 << 14)
424#define AD717X_GPIOCON_REG_OP_EN2_3 (1 << 13)
425
426/* GPIO Configuration Register additional bits for AD4111, AD4112, AD4114, AD4115 */
427#define AD4111_GPIOCON_REG_OP_EN0_1 (1 << 13)
428#define AD4111_GPIOCON_REG_DATA1 (1 << 7)
429#define AD4111_GPIOCON_REG_DATA0 (1 << 6)
430
431/* GPIO Configuration Register additional bits for AD4116 */
432#define AD4116_GPIOCON_REG_OP_EN2_3 (1 << 13)
433#define AD4116_GPIOCON_REG_DATA3 (1 << 7)
434#define AD4116_GPIOCON_REG_DATA2 (1 << 6)
435
436/* GPIO Configuration Register additional bits for AD4111 */
437#define AD4111_GPIOCON_REG_OW_EN (1 << 12)
438
439/* Channel Map Register 0-3 bits */
440#define AD717X_CHMAP_REG_CH_EN (1 << 15)
441#define AD717X_CHMAP_REG_SETUP_SEL(x) (((x) & 0x7) << 12)
442#define AD717X_CHMAP_REG_AINPOS(x) (((x) & 0x1F) << 5)
443#define AD717X_CHMAP_REG_AINNEG(x) (((x) & 0x1F) << 0)
444
445/* Channel Map Register additional bits for AD4111, AD4112, AD4114, AD4115, AD4116 */
446#define AD4111_CHMAP_REG_INPUT(x) (((x) & 0x3FF) << 0)
447
448/* Setup Configuration Register 0-3 bits */
449#define AD717X_SETUP_CONF_REG_BI_UNIPOLAR (1 << 12)
450#define AD717X_SETUP_CONF_REG_REF_SEL(x) (((x) & 0x3) << 4)
451
452/* Setup Configuration Register additional bits for AD7173-8 */
453#define AD717X_SETUP_CONF_REG_REF_BUF(x) (((x) & 0x3) << 10)
454#define AD717X_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
455#define AD717X_SETUP_CONF_REG_BURNOUT_EN (1 << 7)
456#define AD717X_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
457
458/* Setup Configuration Register additional bits for AD7172-2, AD7172-4, AD7175-2 */
459#define AD717X_SETUP_CONF_REG_REFBUF_P (1 << 11)
460#define AD717X_SETUP_CONF_REG_REFBUF_N (1 << 10)
461#define AD717X_SETUP_CONF_REG_AINBUF_P (1 << 9)
462#define AD717X_SETUP_CONF_REG_AINBUF_N (1 << 8)
463
464/* Setup Configuration Register additional bits for AD4111, AD4112, AD4114, AD4115, AD4116 */
465#define AD4111_SETUP_CONF_REG_REFPOS_BUF (1 << 11)
466#define AD4111_SETUP_CONF_REG_REFNEG_BUF (1 << 10)
467#define AD4111_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
468#define AD4111_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
469
470/* Filter Configuration Register 0-3 bits */
471#define AD717X_FILT_CONF_REG_SINC3_MAP (1 << 15)
472#define AD717X_FILT_CONF_REG_ENHFILTEN (1 << 11)
473#define AD717X_FILT_CONF_REG_ENHFILT(x) (((x) & 0x7) << 8)
474#define AD717X_FILT_CONF_REG_ORDER(x) (((x) & 0x3) << 5)
475#define AD717X_FILT_CONF_REG_ODR(x) (((x) & 0x1F) << 0)
476
477/* ID register mask for relevant bits */
478#define AD717X_ID_REG_MASK 0xFFF0
479/* AD7172-2 ID */
480#define AD7172_2_ID_REG_VALUE 0x00D0
481/* AD7172-4 ID */
482#define AD7172_4_ID_REG_VALUE 0x2050
483/* AD7173-8 ID */
484#define AD7173_8_ID_REG_VALUE 0x30D0
485/* AD7175-2 ID */
486#define AD7175_2_ID_REG_VALUE 0x0CD0
487/* AD7175-8 ID */
488#define AD7175_8_ID_REG_VALUE 0x3CD0
489/* AD7176-2 ID */
490#define AD7176_2_ID_REG_VALUE 0x0C90
491/* AD7177-2 ID */
492#define AD7177_2_ID_REG_VALUE 0x4FD0
493/* AD4111, AD4112 IDs */
494#define AD411X_ID_REG_VALUE 0x30D0
495/* AD4114, AD4115 IDs */
496#define AD4114_5_ID_REG_VALUE 0x31D0
497/* AD4116 ID */
498#define AD4116_ID_REG_VALUE 0x34D0
499
500#define AD717X_CRC8_POLYNOMIAL_REPRESENTATION 0x07 /* x8 + x2 + x + 1 */
501/* Timeout for ADC Conversion */
502#define AD717X_CONV_TIMEOUT 10000
503
504#define AD717x_CHANNEL_INPUT_MASK NO_OS_GENMASK(9,0)
505#define AD717X_CHMAP_REG_SETUP_SEL_MSK NO_OS_GENMASK(14,12)
506#define AD717X_CHMAP_REG_AINPOS_MSK NO_OS_GENMASK(9,5)
507#define AD717X_CHMAP_REG_AINNEG_MSK NO_OS_GENMASK(4,0)
508#define AD717X_ADCMODE_REG_MODE_MSK NO_OS_GENMASK(6,4)
509#define AD717X_SETUP_CONF_REG_REF_SEL_MSK NO_OS_GENMASK(5,4)
510#define AD717x_ODR_MSK NO_OS_GENMASK(4,0)
511
514 uint8_t reg_address);
515
518 uint8_t addr);
519
522 uint8_t);
523
526
529 uint32_t timeout);
530
533 int32_t* pData);
534
538
540uint8_t AD717X_ComputeCRC8(uint8_t* pBuf,
541 uint8_t bufSize);
542
544uint8_t AD717X_ComputeXOR8(uint8_t * pBuf,
545 uint8_t bufSize);
546
549
553
555int32_t AD717X_remove(ad717x_dev *dev);
556
557/* Enable/Disable Channels */
558int ad717x_set_channel_status(ad717x_dev *device, uint8_t channel_id,
559 bool channel_status);
560/* Set ADC Mode */
562
563/* Configure Analog inputs to channel */
564int ad717x_connect_analog_input(ad717x_dev *device, uint8_t channel_id,
565 union ad717x_analog_inputs analog_input);
566
567/* Assign setup to channel */
568int ad717x_assign_setup(ad717x_dev *device, uint8_t channel_id,
569 uint8_t setup);
570
571/* Assign polarity to setup*/
573 uint8_t setup_id);
574
575/* Assign reference source to setup */
577 enum ad717x_reference_source ref_source, uint8_t setup_id);
578
579/* Enable/Disable input and reference buffers to setup */
581 bool refbuf_en, uint8_t setup_id);
582
583/* Perform single conversion and read sample */
584int ad717x_single_read(ad717x_dev* device, uint8_t id,
585 int32_t *adc_raw_data);
586
587/* Configure device ODR */
588int32_t ad717x_configure_device_odr(ad717x_dev *dev, uint8_t filtcon_id,
589 uint8_t odr_sel);
590
591#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:167
@ sps27_db47_ms36p7
Definition ad717x.h:168
@ sps25_db62_ms40
Definition ad717x.h:169
@ sps20_db86_ms50
Definition ad717x.h:170
@ sps16p6_db82_ms60
Definition ad717x.h:171
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:408
uint8_t AD717X_ComputeCRC8(uint8_t *pBuf, uint8_t bufSize)
Computes the CRC checksum for a data buffer.
Definition ad717x.c:660
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:380
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:187
@ sps_10417
Definition ad717x.h:195
@ sps_31250_a
Definition ad717x.h:188
@ sps_31250_d
Definition ad717x.h:191
@ sps_59
Definition ad717x.h:203
@ sps_2p5
Definition ad717x.h:209
@ sps_31250_f
Definition ad717x.h:193
@ sps_16
Definition ad717x.h:206
@ sps_10
Definition ad717x.h:207
@ sps_100
Definition ad717x.h:202
@ sps_381
Definition ad717x.h:200
@ sps31250_e
Definition ad717x.h:192
@ sps_49
Definition ad717x.h:204
@ sps_5
Definition ad717x.h:208
@ sps_1007
Definition ad717x.h:198
@ sps_15625
Definition ad717x.h:194
@ sps_2957
Definition ad717x.h:197
@ sps_200
Definition ad717x.h:201
@ sps_1p25
Definition ad717x.h:210
@ sps_20
Definition ad717x.h:205
@ sps_503
Definition ad717x.h:199
@ sps31250_b
Definition ad717x.h:189
@ sps_31250_c
Definition ad717x.h:190
@ sps_5208
Definition ad717x.h:196
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:740
int32_t AD717X_ComputeDataregSize(ad717x_dev *device)
Computes data register read size to account for bit number and status read.
Definition ad717x.c:622
ad717x_order
Definition ad717x.h:178
@ sinc5_sinc1
Definition ad717x.h:179
@ sinc3
Definition ad717x.h:180
ad717x_crc_mode
Definition ad717x.h:235
@ AD717X_DISABLE
Definition ad717x.h:236
@ AD717X_USE_CRC
Definition ad717x.h:237
@ AD717X_USE_XOR
Definition ad717x.h:238
int32_t AD717X_remove(ad717x_dev *dev)
Free the resources allocated by AD717X_Init().
Definition ad717x.c:899
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:710
uint8_t AD717X_ComputeXOR8(uint8_t *pBuf, uint8_t bufSize)
Computes the XOR checksum for a data buffer.
Definition ad717x.c:690
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:480
int ad717x_single_read(ad717x_dev *device, uint8_t id, int32_t *adc_raw_data)
Perform Single Conversion.
Definition ad717x.c:343
int32_t AD717X_WaitForReady(ad717x_dev *device, uint32_t timeout)
Waits until a new conversion result is available.
Definition ad717x.c:554
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:147
@ ID_AD7175_2
Definition ad717x.h:146
@ ID_AD4112
Definition ad717x.h:139
@ ID_AD4115
Definition ad717x.h:141
@ ID_AD4111
Definition ad717x.h:138
@ ID_AD7173_8
Definition ad717x.h:145
@ ID_AD7172_2
Definition ad717x.h:143
@ ID_AD7176_2
Definition ad717x.h:148
@ ID_AD4114
Definition ad717x.h:140
@ ID_AD7172_4
Definition ad717x.h:144
@ ID_AD4116
Definition ad717x.h:142
@ ID_AD7177_2
Definition ad717x.h:149
int32_t AD717X_Reset(ad717x_dev *device)
Resets the device.
Definition ad717x.c:530
int ad717x_set_polarity(ad717x_dev *device, bool bipolar, uint8_t setup_id)
Set Polarity.
Definition ad717x.c:218
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:188
int32_t AD717X_ReadData(ad717x_dev *device, int32_t *pData)
Reads the conversion result from the device.
Definition ad717x.c:589
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:251
#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:775
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:229
uint8_t setup_sel
Definition ad717x.h:231
union ad717x_analog_inputs analog_inputs
Definition ad717x.h:232
bool channel_enable
Definition ad717x.h:230
Definition ad717x.h:156
bool ref_buff
Definition ad717x.h:158
enum ad717x_reference_source ref_source
Definition ad717x.h:160
bool input_buff
Definition ad717x.h:159
bool bi_unipolar
Definition ad717x.h:157
Definition ad717x.h:256
struct ad717x_channel_map chan_map[AD717x_MAX_CHANNELS]
Definition ad717x.h:272
bool ref_en
Definition ad717x.h:266
struct ad717x_channel_setup setups[AD717x_MAX_SETUPS]
Definition ad717x.h:270
uint8_t num_regs
Definition ad717x.h:261
uint8_t num_channels
Definition ad717x.h:268
struct ad717x_filtcon filter_configuration[AD717x_MAX_SETUPS]
Definition ad717x.h:276
enum ad717x_mode mode
Definition ad717x.h:278
enum ad717x_device_type active_device
Definition ad717x.h:264
uint32_t pga[AD717x_MAX_SETUPS]
Definition ad717x.h:274
ad717x_crc_mode useCRC
Definition ad717x.h:262
struct no_os_spi_desc * spi_desc
Definition ad717x.h:258
ad717x_st_reg * regs
Definition ad717x.h:260
Definition ad717x.h:217
bool enhfilten
Definition ad717x.h:219
enum ad717x_odr odr
Definition ad717x.h:222
bool sinc3_map
Definition ad717x.h:218
enum ad717x_enhfilt enhfilt
Definition ad717x.h:220
enum ad717x_order oder
Definition ad717x.h:221
Definition ad717x.h:281
uint8_t num_setups
Definition ad717x.h:294
struct ad717x_channel_setup setups[AD717x_MAX_SETUPS]
Definition ad717x.h:298
struct ad717x_filtcon filter_configuration[AD717x_MAX_SETUPS]
Definition ad717x.h:302
uint32_t pga[AD717x_MAX_SETUPS]
Definition ad717x.h:300
enum ad717x_mode mode
Definition ad717x.h:304
uint8_t num_channels
Definition ad717x.h:292
enum ad717x_device_type active_device
Definition ad717x.h:288
struct ad717x_channel_map chan_map[AD717x_MAX_CHANNELS]
Definition ad717x.h:296
uint8_t num_regs
Definition ad717x.h:286
struct no_os_spi_init_param spi_init
Definition ad717x.h:283
bool ref_en
Definition ad717x.h:290
ad717x_st_reg * regs
Definition ad717x.h:285
Definition ad717x.h:242
int32_t size
Definition ad717x.h:245
int32_t value
Definition ad717x.h:244
int32_t addr
Definition ad717x.h:243
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