Go to the documentation of this file.
51 #define AD717x_MAX_SETUPS 8
53 #define AD717x_MAX_CHANNELS 16
318 #define AD717X_COMM_REG 0x00
319 #define AD717X_STATUS_REG 0x00
320 #define AD717X_ADCMODE_REG 0x01
321 #define AD717X_IFMODE_REG 0x02
322 #define AD717X_REGCHECK_REG 0x03
323 #define AD717X_DATA_REG 0x04
324 #define AD717X_GPIOCON_REG 0x06
325 #define AD717X_ID_REG 0x07
326 #define AD717X_CHMAP0_REG 0x10
327 #define AD717X_CHMAP1_REG 0x11
328 #define AD717X_CHMAP2_REG 0x12
329 #define AD717X_CHMAP3_REG 0x13
330 #define AD717X_CHMAP4_REG 0x14
331 #define AD717X_CHMAP5_REG 0x15
332 #define AD717X_CHMAP6_REG 0x16
333 #define AD717X_CHMAP7_REG 0x17
334 #define AD717X_CHMAP8_REG 0x18
335 #define AD717X_CHMAP9_REG 0x19
336 #define AD717X_CHMAP10_REG 0x1A
337 #define AD717X_CHMAP11_REG 0x1B
338 #define AD717X_CHMAP12_REG 0x1C
339 #define AD717X_CHMAP13_REG 0x1D
340 #define AD717X_CHMAP14_REG 0x1E
341 #define AD717X_CHMAP15_REG 0x1F
342 #define AD717X_SETUPCON0_REG 0x20
343 #define AD717X_SETUPCON1_REG 0x21
344 #define AD717X_SETUPCON2_REG 0x22
345 #define AD717X_SETUPCON3_REG 0x23
346 #define AD717X_SETUPCON4_REG 0x24
347 #define AD717X_SETUPCON5_REG 0x25
348 #define AD717X_SETUPCON6_REG 0x26
349 #define AD717X_SETUPCON7_REG 0x27
350 #define AD717X_FILTCON0_REG 0x28
351 #define AD717X_FILTCON1_REG 0x29
352 #define AD717X_FILTCON2_REG 0x2A
353 #define AD717X_FILTCON3_REG 0x2B
354 #define AD717X_FILTCON4_REG 0x2C
355 #define AD717X_FILTCON5_REG 0x2D
356 #define AD717X_FILTCON6_REG 0x2E
357 #define AD717X_FILTCON7_REG 0x2F
358 #define AD717X_OFFSET0_REG 0x30
359 #define AD717X_OFFSET1_REG 0x31
360 #define AD717X_OFFSET2_REG 0x32
361 #define AD717X_OFFSET3_REG 0x33
362 #define AD717X_OFFSET4_REG 0x34
363 #define AD717X_OFFSET5_REG 0x35
364 #define AD717X_OFFSET6_REG 0x36
365 #define AD717X_OFFSET7_REG 0x37
366 #define AD717X_GAIN0_REG 0x38
367 #define AD717X_GAIN1_REG 0x39
368 #define AD717X_GAIN2_REG 0x3A
369 #define AD717X_GAIN3_REG 0x3B
370 #define AD717X_GAIN4_REG 0x3C
371 #define AD717X_GAIN5_REG 0x3D
372 #define AD717X_GAIN6_REG 0x3E
373 #define AD717X_GAIN7_REG 0x3F
376 #define AD717X_COMM_REG_WEN (0 << 7)
377 #define AD717X_COMM_REG_WR (0 << 6)
378 #define AD717X_COMM_REG_RD (1 << 6)
379 #define AD717X_COMM_REG_RA(x) ((x) & 0x3F)
382 #define AD717X_STATUS_REG_RDY (1 << 7)
383 #define AD717X_STATUS_REG_ADC_ERR (1 << 6)
384 #define AD717X_STATUS_REG_CRC_ERR (1 << 5)
385 #define AD717X_STATUS_REG_REG_ERR (1 << 4)
386 #define AD717X_STATUS_REG_CH(x) ((x) & 0x0F)
389 #define AD717X_ADCMODE_REG_REF_EN (1 << 15)
390 #define AD717X_ADCMODE_SING_CYC (1 << 13)
391 #define AD717X_ADCMODE_REG_DELAY(x) (((x) & 0x7) << 8)
392 #define AD717X_ADCMODE_REG_MODE(x) (((x) & 0x7) << 4)
393 #define AD717X_ADCMODE_REG_CLKSEL(x) (((x) & 0x3) << 2)
396 #define AD717X_ADCMODE_REG_HIDE_DELAY (1 << 14)
399 #define AD717X_IFMODE_REG_ALT_SYNC (1 << 12)
400 #define AD717X_IFMODE_REG_IOSTRENGTH (1 << 11)
401 #define AD717X_IFMODE_REG_DOUT_RESET (1 << 8)
402 #define AD717X_IFMODE_REG_CONT_READ (1 << 7)
403 #define AD717X_IFMODE_REG_DATA_STAT (1 << 6)
404 #define AD717X_IFMODE_REG_REG_CHECK (1 << 5)
405 #define AD717X_IFMODE_REG_XOR_EN (0x01 << 2)
406 #define AD717X_IFMODE_REG_CRC_EN (0x02 << 2)
407 #define AD717X_IFMODE_REG_XOR_STAT(x) (((x) & AD717X_IFMODE_REG_XOR_EN) == AD717X_IFMODE_REG_XOR_EN)
408 #define AD717X_IFMODE_REG_CRC_STAT(x) (((x) & AD717X_IFMODE_REG_CRC_EN) == AD717X_IFMODE_REG_CRC_EN)
409 #define AD717X_IFMODE_REG_DATA_WL16 (1 << 0)
412 #define AD717X_IFMODE_REG_HIDE_DELAY (1 << 10)
415 #define AD717X_GPIOCON_REG_MUX_IO (1 << 12)
416 #define AD717X_GPIOCON_REG_SYNC_EN (1 << 11)
417 #define AD717X_GPIOCON_REG_ERR_EN(x) (((x) & 0x3) << 9)
418 #define AD717X_GPIOCON_REG_ERR_DAT (1 << 8)
419 #define AD717X_GPIOCON_REG_IP_EN1 (1 << 5)
420 #define AD717X_GPIOCON_REG_IP_EN0 (1 << 4)
421 #define AD717X_GPIOCON_REG_OP_EN1 (1 << 3)
422 #define AD717X_GPIOCON_REG_OP_EN0 (1 << 2)
423 #define AD717X_GPIOCON_REG_DATA1 (1 << 1)
424 #define AD717X_GPIOCON_REG_DATA0 (1 << 0)
427 #define AD717X_GPIOCON_REG_GP_DATA3 (1 << 7)
428 #define AD717X_GPIOCON_REG_GP_DATA2 (1 << 6)
429 #define AD717X_GPIOCON_REG_GP_DATA1 (1 << 1)
430 #define AD717X_GPIOCON_REG_GP_DATA0 (1 << 0)
433 #define AD717X_GPIOCON_REG_PDSW (1 << 14)
434 #define AD717X_GPIOCON_REG_OP_EN2_3 (1 << 13)
437 #define AD4111_GPIOCON_REG_OP_EN0_1 (1 << 13)
438 #define AD4111_GPIOCON_REG_DATA1 (1 << 7)
439 #define AD4111_GPIOCON_REG_DATA0 (1 << 6)
442 #define AD4116_GPIOCON_REG_OP_EN2_3 (1 << 13)
443 #define AD4116_GPIOCON_REG_DATA3 (1 << 7)
444 #define AD4116_GPIOCON_REG_DATA2 (1 << 6)
447 #define AD4111_GPIOCON_REG_OW_EN (1 << 12)
450 #define AD717X_CHMAP_REG_CH_EN (1 << 15)
451 #define AD717X_CHMAP_REG_SETUP_SEL(x) (((x) & 0x7) << 12)
452 #define AD717X_CHMAP_REG_AINPOS(x) (((x) & 0x1F) << 5)
453 #define AD717X_CHMAP_REG_AINNEG(x) (((x) & 0x1F) << 0)
456 #define AD4111_CHMAP_REG_INPUT(x) (((x) & 0x3FF) << 0)
459 #define AD717X_SETUP_CONF_REG_BI_UNIPOLAR (1 << 12)
460 #define AD717X_SETUP_CONF_REG_REF_SEL(x) (((x) & 0x3) << 4)
463 #define AD717X_SETUP_CONF_REG_REF_BUF(x) (((x) & 0x3) << 10)
464 #define AD717X_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
465 #define AD717X_SETUP_CONF_REG_BURNOUT_EN (1 << 7)
466 #define AD717X_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
469 #define AD717X_SETUP_CONF_REG_REFBUF_P (1 << 11)
470 #define AD717X_SETUP_CONF_REG_REFBUF_N (1 << 10)
471 #define AD717X_SETUP_CONF_REG_AINBUF_P (1 << 9)
472 #define AD717X_SETUP_CONF_REG_AINBUF_N (1 << 8)
475 #define AD4111_SETUP_CONF_REG_REFPOS_BUF (1 << 11)
476 #define AD4111_SETUP_CONF_REG_REFNEG_BUF (1 << 10)
477 #define AD4111_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
478 #define AD4111_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
481 #define AD717X_FILT_CONF_REG_SINC3_MAP (1 << 15)
482 #define AD717X_FILT_CONF_REG_ENHFILTEN (1 << 11)
483 #define AD717X_FILT_CONF_REG_ENHFILT(x) (((x) & 0x7) << 8)
484 #define AD717X_FILT_CONF_REG_ORDER(x) (((x) & 0x3) << 5)
485 #define AD717X_FILT_CONF_REG_ODR(x) (((x) & 0x1F) << 0)
488 #define AD717X_ID_REG_MASK 0xFFF0
490 #define AD7172_2_ID_REG_VALUE 0x00D0
492 #define AD7172_4_ID_REG_VALUE 0x2050
494 #define AD7173_8_ID_REG_VALUE 0x30D0
496 #define AD7175_2_ID_REG_VALUE 0x0CD0
498 #define AD7175_8_ID_REG_VALUE 0x3CD0
500 #define AD7176_2_ID_REG_VALUE 0x0C90
502 #define AD7177_2_ID_REG_VALUE 0x4FD0
504 #define AD411X_ID_REG_VALUE 0x30D0
506 #define AD4114_5_ID_REG_VALUE 0x31D0
508 #define AD4116_ID_REG_VALUE 0x34D0
513 #define AD717X_CRC8_POLYNOMIAL_REPRESENTATION 0x07
515 #define AD717X_CONV_TIMEOUT 10000
517 #define AD717x_CHANNEL_INPUT_MASK NO_OS_GENMASK(9,0)
518 #define AD717X_CHMAP_REG_SETUP_SEL_MSK NO_OS_GENMASK(14,12)
519 #define AD717X_CHMAP_REG_AINPOS_MSK NO_OS_GENMASK(9,5)
520 #define AD717X_CHMAP_REG_AINNEG_MSK NO_OS_GENMASK(4,0)
521 #define AD717X_ADCMODE_REG_MODE_MSK NO_OS_GENMASK(6,4)
522 #define AD717X_SETUP_CONF_REG_REF_SEL_MSK NO_OS_GENMASK(5,4)
523 #define AD717x_ODR_MSK NO_OS_GENMASK(4,0)
531 uint8_t reg_address);
576 bool channel_status);
598 bool refbuf_en, uint8_t setup_id);
602 int32_t *adc_raw_data);
int32_t value
Definition: ad717x.h:250
#define AD717X_CRC8_POLYNOMIAL_REPRESENTATION
Definition: ad717x.h:513
@ sps_2957
Definition: ad717x.h:203
@ AIN2
Definition: ad717x.h:116
#define AD717X_ADCMODE_REG_MODE(x)
Definition: ad717x.h:392
enum ad717x_device_type active_device
Definition: ad717x.h:270
@ AVDD_AVSS_P
Definition: ad717x.h:121
@ ID_AD7177_2
Definition: ad717x.h:155
uint32_t timeout
Definition: ad413x.c:49
ad717x_st_reg * regs
Definition: ad717x.h:291
int ad717x_enable_input_buffer(ad717x_dev *device, bool inbuf_en, bool refbuf_en, uint8_t setup_id)
Enable Input Buffer.
Definition: ad717x.c:302
@ AD717X_USE_XOR
Definition: ad717x.h:244
@ IIN2P_IIN2M
Definition: ad717x.h:102
@ sps_31250_a
Definition: ad717x.h:194
#define AD717X_SETUP_CONF_REG_REF_SEL(x)
Definition: ad717x.h:460
uint8_t AD717X_ComputeXOR8(uint8_t *pBuf, uint8_t bufSize)
Computes the XOR checksum for a data buffer.
Definition: ad717x.c:693
#define AD717X_FILTCON0_REG
Definition: ad717x.h:350
#define AD717x_MAX_CHANNELS
Definition: ad717x.h:53
int ad717x_assign_setup(ad717x_dev *device, uint8_t channel_id, uint8_t setup)
Assign Setup to Channel.
Definition: ad717x.c:191
#define AD717X_SETUP_CONF_REG_AINBUF_N
Definition: ad717x.h:472
ad717x_analog_input_pairs
Definition: ad717x.h:84
@ VIN5_VIN4
Definition: ad717x.h:95
@ sps_381
Definition: ad717x.h:206
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
#define INVALID_VAL
Definition: ad717x.c:46
@ sinc5_sinc1
Definition: ad717x.h:185
int ad717x_single_read(ad717x_dev *device, uint8_t id, int32_t *adc_raw_data)
Perform Single Conversion.
Definition: ad717x.c:346
@ VIN0_VIN1
Definition: ad717x.h:85
enum ad717x_enhfilt enhfilt
Definition: ad717x.h:226
uint8_t num_regs
Definition: ad717x.h:292
Header file of SPI Interface.
@ sps_503
Definition: ad717x.h:205
@ ID_AD7173_8
Definition: ad717x.h:151
int32_t AD717X_ReadData(ad717x_dev *device, int32_t *pData)
Reads the conversion result from the device.
Definition: ad717x.c:592
@ VIN5_VINCOM
Definition: ad717x.h:96
@ ID_AD4111
Definition: ad717x.h:144
bool sinc3_map
Definition: ad717x.h:224
int32_t size
Definition: ad717x.h:251
int32_t AD717X_UpdateCRCSetting(ad717x_dev *device)
Updates the CRC settings.
Definition: ad717x.c:713
ad717x_mode
Definition: ad717x.h:59
#define AD717X_SETUP_CONF_REG_REF_SEL_MSK
Definition: ad717x.h:522
@ sps31250_b
Definition: ad717x.h:195
enum ad717x_reference_source ref_source
Definition: ad717x.h:166
#define AD717X_IFMODE_REG_DATA_STAT
Definition: ad717x.h:403
@ ID_AD4116
Definition: ad717x.h:148
#define AD717X_ID_REG
Definition: ad717x.h:325
int ad717x_set_adc_mode(ad717x_dev *device, enum ad717x_mode adc_mode)
Set ADC Mode.
Definition: ad717x.c:92
@ sps_20
Definition: ad717x.h:211
@ VIN0_VINCOM
Definition: ad717x.h:86
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:743
#define AD717X_IFMODE_REG_XOR_STAT(x)
Definition: ad717x.h:407
@ TEMP_SENSOR_P
Definition: ad717x.h:119
@ sps_59
Definition: ad717x.h:209
#define AD717x_ODR_MSK
Definition: ad717x.h:523
@ VIN6_VIN7
Definition: ad717x.h:97
@ AVDD_AVSS
Definition: ad717x.h:77
@ sps_16
Definition: ad717x.h:212
@ SYS_GAIN_CALIB
Definition: ad717x.h:67
uint8_t AD717X_ComputeCRC8(uint8_t *pBuf, uint8_t bufSize)
Computes the CRC checksum for a data buffer.
Definition: ad717x.c:663
Definition: ad9361_util.h:69
@ sps_5
Definition: ad717x.h:214
enum ad717x_odr odr
Definition: ad717x.h:228
#define AD717X_CHMAP_REG_CH_EN
Definition: ad717x.h:450
#define AD717X_STATUS_REG_RDY
Definition: ad717x.h:382
#define AD717X_CHMAP_REG_SETUP_SEL_MSK
Definition: ad717x.h:518
int ad717x_set_polarity(ad717x_dev *device, bool bipolar, uint8_t setup_id)
Set Polarity.
Definition: ad717x.c:221
#define AD717X_SETUP_CONF_REG_REFBUF_P
Definition: ad717x.h:469
@ sps_10417
Definition: ad717x.h:201
#define AD717X_CHMAP_REG_SETUP_SEL(x)
Definition: ad717x.h:451
@ sps_31250_d
Definition: ad717x.h:197
ad717x_crc_mode
Definition: ad717x.h:241
@ ID_AD7175_8
Definition: ad717x.h:153
int32_t AD717X_ReadData(ad717x_dev *device, int32_t *pData)
Reads the conversion result from the device.
Definition: ad717x.c:592
@ AIN0
Definition: ad717x.h:114
uint8_t AD717X_ComputeCRC8(uint8_t *pBuf, uint8_t bufSize)
Computes the CRC checksum for a data buffer.
Definition: ad717x.c:663
int32_t AD717X_Init(ad717x_dev **device, ad717x_init_param init_param)
Initializes the AD717X.
Definition: ad717x.c:778
enum ad7616_mode mode
Definition: ad7616.h:226
@ POWER_DOWN
Definition: ad717x.h:63
#define AD4111_CHMAP_REG_INPUT(x)
Definition: ad717x.h:456
int32_t AD717X_ReadRegister(ad717x_dev *device, uint8_t addr)
Reads the value of the specified register.
Definition: ad717x.c:411
@ INTERNAL_REF
Definition: ad717x.h:76
@ sps16p6_db82_ms60
Definition: ad717x.h:177
int ad717x_set_adc_mode(ad717x_dev *device, enum ad717x_mode mode)
Set ADC Mode.
Definition: ad717x.c:92
#define AD717X_ADCMODE_REG_REF_EN
Definition: ad717x.h:389
@ sps_49
Definition: ad717x.h:210
int32_t AD717X_ComputeDataregSize(ad717x_dev *device)
Computes data register read size to account for bit number and status read.
Definition: ad717x.c:625
@ ID_AD7172_4
Definition: ad717x.h:150
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:254
uint8_t num_channels
Definition: ad717x.h:274
uint8_t setup_sel
Definition: ad717x.h:237
#define AD717x_CHANNEL_INPUT_MASK
Definition: ad717x.h:517
@ sps_2p5
Definition: ad717x.h:215
int ad717x_set_channel_status(ad717x_dev *device, uint8_t channel_id, bool channel_status)
Set channel status - Enable/Disable.
Definition: ad717x.c:58
@ ID_AD7175_2
Definition: ad717x.h:152
@ SINGLE
Definition: ad717x.h:61
@ CONTINUOUS
Definition: ad717x.h:60
#define AD717X_CHMAP_REG_AINPOS_MSK
Definition: ad717x.h:519
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:123
int ad717x_assign_setup(ad717x_dev *device, uint8_t channel_id, uint8_t setup)
Assign Setup to Channel.
Definition: ad717x.c:191
#define AD717X_COMM_REG_RA(x)
Definition: ad717x.h:379
@ IIN0P_IIN0M
Definition: ad717x.h:104
uint8_t num_setups
Definition: ad717x.h:300
@ TEMP_SENSOR_M
Definition: ad717x.h:120
ad717x_reference_source
Definition: ad717x.h:74
@ sps_100
Definition: ad717x.h:208
ad717x_enhfilt
Definition: ad717x.h:173
uint8_t num_regs
Definition: ad717x.h:267
#define AD717X_SETUP_CONF_REG_AINBUF_P
Definition: ad717x.h:471
struct no_os_spi_desc * spi_desc
Definition: ad717x.h:264
int32_t AD717X_ComputeDataregSize(ad717x_dev *device)
Computes data register read size to account for bit number and status read.
Definition: ad717x.c:625
@ sps31250_e
Definition: ad717x.h:198
ad717x_device_type
Definition: ad717x.h:143
ad717x_analog_input
Definition: ad717x.h:113
#define AD717X_CHMAP_REG_AINNEG_MSK
Definition: ad717x.h:520
bool ref_en
Definition: ad717x.h:296
bool channel_enable
Definition: ad717x.h:236
#define AD717X_ADCMODE_REG
Definition: ad717x.h:320
int32_t AD717X_UpdateCRCSetting(ad717x_dev *device)
Updates the CRC settings.
Definition: ad717x.c:713
@ AIN4
Definition: ad717x.h:118
@ ID_AD4114
Definition: ad717x.h:146
#define AD717x_MAX_SETUPS
Definition: ad717x.h:51
@ VIN1_VIN0
Definition: ad717x.h:87
ad717x_st_reg * regs
Definition: ad717x.h:266
@ VIN4_VINCOM
Definition: ad717x.h:94
@ sps25_db62_ms40
Definition: ad717x.h:175
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:123
@ REF_P
Definition: ad717x.h:123
#define AD717X_IFMODE_REG_CRC_STAT(x)
Definition: ad717x.h:408
@ TEMPERATURE_SENSOR
Definition: ad717x.h:105
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
uint8_t AD717X_ComputeXOR8(uint8_t *pBuf, uint8_t bufSize)
Computes the XOR checksum for a data buffer.
Definition: ad717x.c:693
#define AD717X_SETUP_CONF_REG_BI_UNIPOLAR
Definition: ad717x.h:459
@ VIN1_VINCOM
Definition: ad717x.h:88
@ EXTERNAL_REF
Definition: ad717x.h:75
int32_t AD717X_remove(ad717x_dev *dev)
Free the resources allocated by AD717X_Init().
Definition: ad717x.c:902
struct no_os_spi_init_param spi_init
Definition: common_data.c:120
@ ID_AD4112
Definition: ad717x.h:145
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:383
bool ref_en
Definition: ad717x.h:272
#define AD717X_SETUPCON0_REG
Definition: ad717x.h:342
int ad717x_single_read(ad717x_dev *device, uint8_t id, int32_t *adc_raw_data)
Perform Single Conversion.
Definition: ad717x.c:346
#define AD717X_CHMAP0_REG
Definition: ad717x.h:326
#define AD717X_GPIOCON_REG
Definition: ad717x.h:324
@ AD717X_USE_CRC
Definition: ad717x.h:243
#define AD717X_COMM_REG_RD
Definition: ad717x.h:378
#define AD717X_FILT_CONF_REG_ODR(x)
Definition: ad717x.h:485
@ REFERENCE
Definition: ad717x.h:106
@ AIN1
Definition: ad717x.h:115
ad717x_crc_mode useCRC
Definition: ad717x.h:268
@ VIN7_VINCOM
Definition: ad717x.h:100
@ VIN6_VINCOM
Definition: ad717x.h:98
#define AD717X_COMM_REG_WEN
Definition: ad717x.h:376
@ VIN7_VIN6
Definition: ad717x.h:99
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:254
#define COMM_ERR
Definition: ad717x.c:47
@ VIN2_VINCOM
Definition: ad717x.h:90
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
@ INTERNAL_OFFSET_CALIB
Definition: ad717x.h:64
@ INTERNAL_REF
Definition: ad7124.h:379
int ad717x_set_channel_status(ad717x_dev *device, uint8_t channel_id, bool channel_status)
Set channel status - Enable/Disable.
Definition: ad717x.c:58
int32_t addr
Definition: ad717x.h:249
@ sps_5208
Definition: ad717x.h:202
#define AD717X_CHMAP_REG_AINPOS(x)
Definition: ad717x.h:452
AD717X header file. Devices: AD7172-2, AD7172-4, AD7173-8, AD7175-2, AD7175-8, AD7176-2,...
union ad717x_analog_inputs analog_inputs
Definition: ad717x.h:238
#define AD717X_OFFSET0_REG
Definition: ad717x.h:358
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
int32_t AD717X_remove(ad717x_dev *dev)
Free the resources allocated by AD717X_Init().
Definition: ad717x.c:902
#define AD717X_STATUS_REG
Definition: ad717x.h:319
@ VIN3_VINCOM
Definition: ad717x.h:92
@ sinc3
Definition: ad717x.h:186
#define AD717X_DATA_REG
Definition: ad717x.h:323
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:743
bool enhfilten
Definition: ad717x.h:225
@ INTERNAL_GAIN_CALIB
Definition: ad717x.h:65
@ sps_1007
Definition: ad717x.h:204
@ VIN3_VIN2
Definition: ad717x.h:91
int32_t AD717X_WriteRegister(ad717x_dev *device, uint8_t addr)
Writes the value of the specified register.
Definition: ad717x.c:483
#define AD717X_COMM_REG_WR
Definition: ad717x.h:377
ad717x_odr
Definition: ad717x.h:193
@ ID_AD7172_2
Definition: ad717x.h:149
@ VIN2_VIN3
Definition: ad717x.h:89
uint8_t num_channels
Definition: ad717x.h:298
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int32_t AD717X_WaitForReady(ad717x_dev *device, uint32_t timeout)
Waits until a new conversion result is available.
Definition: ad717x.c:557
#define AD717X_SETUP_CONF_REG_REFBUF_N
Definition: ad717x.h:470
@ bipolar
Definition: ad5446.h:71
int32_t AD717X_Init(ad717x_dev **device, ad717x_init_param init_param)
Initializes the AD717X.
Definition: ad717x.c:778
#define AD7177_2_ID_REG_VALUE
Definition: ad717x.h:502
#define AD717X_IFMODE_REG
Definition: ad717x.h:321
int32_t AD717X_ReadRegister(ad717x_dev *device, uint8_t addr)
Reads the value of the specified register.
Definition: ad717x.c:411
int32_t AD717X_Reset(ad717x_dev *device)
Resets the device.
Definition: ad717x.c:533
@ IIN3P_IIN3M
Definition: ad717x.h:101
int32_t AD717X_WaitForReady(ad717x_dev *device, uint32_t timeout)
Waits until a new conversion result is available.
Definition: ad717x.c:557
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
@ AIN3
Definition: ad717x.h:117
ad717x_order
Definition: ad717x.h:184
@ sps_15625
Definition: ad717x.h:200
#define AD717X_CHMAP_REG_AINNEG(x)
Definition: ad717x.h:453
@ sps_31250_c
Definition: ad717x.h:196
@ sps27_db47_ms36p7
Definition: ad717x.h:174
#define AD717X_IFMODE_REG_DATA_WL16
Definition: ad717x.h:409
@ sps_10
Definition: ad717x.h:213
@ IIN1P_IIN1M
Definition: ad717x.h:103
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
int32_t AD717X_WriteRegister(ad717x_dev *device, uint8_t)
Writes the value of the specified register.
Definition: ad717x.c:483
@ VIN4_VIN5
Definition: ad717x.h:93
@ SYS_OFFSET_CALIB
Definition: ad717x.h:66
@ sps20_db86_ms50
Definition: ad717x.h:176
Header file of utility functions.
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:383
@ ID_AD7176_2
Definition: ad717x.h:154
@ sps_200
Definition: ad717x.h:207
#define TIMEOUT
Definition: ad717x.c:48
@ sps_31250_f
Definition: ad717x.h:199
#define AD717X_CONV_TIMEOUT
Definition: ad717x.h:515
#define AD717X_ID_REG_MASK
Definition: ad717x.h:488
int ad717x_set_polarity(ad717x_dev *device, bool bipolar, uint8_t setup_id)
Set Polarity.
Definition: ad717x.c:221
int32_t AD717X_Reset(ad717x_dev *device)
Resets the device.
Definition: ad717x.c:533
@ ID_AD4115
Definition: ad717x.h:147
bool input_buff
Definition: ad717x.h:165
@ REF_M
Definition: ad717x.h:124
@ sps_1p25
Definition: ad717x.h:216
#define AD717X_ADCMODE_REG_MODE_MSK
Definition: ad717x.h:521
@ AVDD_AVSS_M
Definition: ad717x.h:122
@ AD717X_DISABLE
Definition: ad717x.h:242
@ STANDBY
Definition: ad717x.h:62
bool ref_buff
Definition: ad717x.h:164
enum ad717x_order oder
Definition: ad717x.h:227
int ad717x_enable_buffers(ad717x_dev *device, bool inbuf_en, bool refbuf_en, uint8_t setup_id)
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
bool bi_unipolar
Definition: ad717x.h:163