Go to the documentation of this file.
58 #define AD717x_MAX_SETUPS 8
60 #define AD717x_MAX_CHANNELS 16
325 #define AD717X_COMM_REG 0x00
326 #define AD717X_STATUS_REG 0x00
327 #define AD717X_ADCMODE_REG 0x01
328 #define AD717X_IFMODE_REG 0x02
329 #define AD717X_REGCHECK_REG 0x03
330 #define AD717X_DATA_REG 0x04
331 #define AD717X_GPIOCON_REG 0x06
332 #define AD717X_ID_REG 0x07
333 #define AD717X_CHMAP0_REG 0x10
334 #define AD717X_CHMAP1_REG 0x11
335 #define AD717X_CHMAP2_REG 0x12
336 #define AD717X_CHMAP3_REG 0x13
337 #define AD717X_CHMAP4_REG 0x14
338 #define AD717X_CHMAP5_REG 0x15
339 #define AD717X_CHMAP6_REG 0x16
340 #define AD717X_CHMAP7_REG 0x17
341 #define AD717X_CHMAP8_REG 0x18
342 #define AD717X_CHMAP9_REG 0x19
343 #define AD717X_CHMAP10_REG 0x1A
344 #define AD717X_CHMAP11_REG 0x1B
345 #define AD717X_CHMAP12_REG 0x1C
346 #define AD717X_CHMAP13_REG 0x1D
347 #define AD717X_CHMAP14_REG 0x1E
348 #define AD717X_CHMAP15_REG 0x1F
349 #define AD717X_SETUPCON0_REG 0x20
350 #define AD717X_SETUPCON1_REG 0x21
351 #define AD717X_SETUPCON2_REG 0x22
352 #define AD717X_SETUPCON3_REG 0x23
353 #define AD717X_SETUPCON4_REG 0x24
354 #define AD717X_SETUPCON5_REG 0x25
355 #define AD717X_SETUPCON6_REG 0x26
356 #define AD717X_SETUPCON7_REG 0x27
357 #define AD717X_FILTCON0_REG 0x28
358 #define AD717X_FILTCON1_REG 0x29
359 #define AD717X_FILTCON2_REG 0x2A
360 #define AD717X_FILTCON3_REG 0x2B
361 #define AD717X_FILTCON4_REG 0x2C
362 #define AD717X_FILTCON5_REG 0x2D
363 #define AD717X_FILTCON6_REG 0x2E
364 #define AD717X_FILTCON7_REG 0x2F
365 #define AD717X_OFFSET0_REG 0x30
366 #define AD717X_OFFSET1_REG 0x31
367 #define AD717X_OFFSET2_REG 0x32
368 #define AD717X_OFFSET3_REG 0x33
369 #define AD717X_OFFSET4_REG 0x34
370 #define AD717X_OFFSET5_REG 0x35
371 #define AD717X_OFFSET6_REG 0x36
372 #define AD717X_OFFSET7_REG 0x37
373 #define AD717X_GAIN0_REG 0x38
374 #define AD717X_GAIN1_REG 0x39
375 #define AD717X_GAIN2_REG 0x3A
376 #define AD717X_GAIN3_REG 0x3B
377 #define AD717X_GAIN4_REG 0x3C
378 #define AD717X_GAIN5_REG 0x3D
379 #define AD717X_GAIN6_REG 0x3E
380 #define AD717X_GAIN7_REG 0x3F
383 #define AD717X_COMM_REG_WEN (0 << 7)
384 #define AD717X_COMM_REG_WR (0 << 6)
385 #define AD717X_COMM_REG_RD (1 << 6)
386 #define AD717X_COMM_REG_RA(x) ((x) & 0x3F)
389 #define AD717X_STATUS_REG_RDY (1 << 7)
390 #define AD717X_STATUS_REG_ADC_ERR (1 << 6)
391 #define AD717X_STATUS_REG_CRC_ERR (1 << 5)
392 #define AD717X_STATUS_REG_REG_ERR (1 << 4)
393 #define AD717X_STATUS_REG_CH(x) ((x) & 0x0F)
396 #define AD717X_ADCMODE_REG_REF_EN (1 << 15)
397 #define AD717X_ADCMODE_SING_CYC (1 << 13)
398 #define AD717X_ADCMODE_REG_DELAY(x) (((x) & 0x7) << 8)
399 #define AD717X_ADCMODE_REG_MODE(x) (((x) & 0x7) << 4)
400 #define AD717X_ADCMODE_REG_CLKSEL(x) (((x) & 0x3) << 2)
403 #define AD717X_ADCMODE_REG_HIDE_DELAY (1 << 14)
406 #define AD717X_IFMODE_REG_ALT_SYNC (1 << 12)
407 #define AD717X_IFMODE_REG_IOSTRENGTH (1 << 11)
408 #define AD717X_IFMODE_REG_DOUT_RESET (1 << 8)
409 #define AD717X_IFMODE_REG_CONT_READ (1 << 7)
410 #define AD717X_IFMODE_REG_DATA_STAT (1 << 6)
411 #define AD717X_IFMODE_REG_REG_CHECK (1 << 5)
412 #define AD717X_IFMODE_REG_XOR_EN (0x01 << 2)
413 #define AD717X_IFMODE_REG_CRC_EN (0x02 << 2)
414 #define AD717X_IFMODE_REG_XOR_STAT(x) (((x) & AD717X_IFMODE_REG_XOR_EN) == AD717X_IFMODE_REG_XOR_EN)
415 #define AD717X_IFMODE_REG_CRC_STAT(x) (((x) & AD717X_IFMODE_REG_CRC_EN) == AD717X_IFMODE_REG_CRC_EN)
416 #define AD717X_IFMODE_REG_DATA_WL16 (1 << 0)
419 #define AD717X_IFMODE_REG_HIDE_DELAY (1 << 10)
422 #define AD717X_GPIOCON_REG_MUX_IO (1 << 12)
423 #define AD717X_GPIOCON_REG_SYNC_EN (1 << 11)
424 #define AD717X_GPIOCON_REG_ERR_EN(x) (((x) & 0x3) << 9)
425 #define AD717X_GPIOCON_REG_ERR_DAT (1 << 8)
426 #define AD717X_GPIOCON_REG_IP_EN1 (1 << 5)
427 #define AD717X_GPIOCON_REG_IP_EN0 (1 << 4)
428 #define AD717X_GPIOCON_REG_OP_EN1 (1 << 3)
429 #define AD717X_GPIOCON_REG_OP_EN0 (1 << 2)
430 #define AD717X_GPIOCON_REG_DATA1 (1 << 1)
431 #define AD717X_GPIOCON_REG_DATA0 (1 << 0)
434 #define AD717X_GPIOCON_REG_GP_DATA3 (1 << 7)
435 #define AD717X_GPIOCON_REG_GP_DATA2 (1 << 6)
436 #define AD717X_GPIOCON_REG_GP_DATA1 (1 << 1)
437 #define AD717X_GPIOCON_REG_GP_DATA0 (1 << 0)
440 #define AD717X_GPIOCON_REG_PDSW (1 << 14)
441 #define AD717X_GPIOCON_REG_OP_EN2_3 (1 << 13)
444 #define AD4111_GPIOCON_REG_OP_EN0_1 (1 << 13)
445 #define AD4111_GPIOCON_REG_DATA1 (1 << 7)
446 #define AD4111_GPIOCON_REG_DATA0 (1 << 6)
449 #define AD4116_GPIOCON_REG_OP_EN2_3 (1 << 13)
450 #define AD4116_GPIOCON_REG_DATA3 (1 << 7)
451 #define AD4116_GPIOCON_REG_DATA2 (1 << 6)
454 #define AD4111_GPIOCON_REG_OW_EN (1 << 12)
457 #define AD717X_CHMAP_REG_CH_EN (1 << 15)
458 #define AD717X_CHMAP_REG_SETUP_SEL(x) (((x) & 0x7) << 12)
459 #define AD717X_CHMAP_REG_AINPOS(x) (((x) & 0x1F) << 5)
460 #define AD717X_CHMAP_REG_AINNEG(x) (((x) & 0x1F) << 0)
463 #define AD4111_CHMAP_REG_INPUT(x) (((x) & 0x3FF) << 0)
466 #define AD717X_SETUP_CONF_REG_BI_UNIPOLAR (1 << 12)
467 #define AD717X_SETUP_CONF_REG_REF_SEL(x) (((x) & 0x3) << 4)
470 #define AD717X_SETUP_CONF_REG_REF_BUF(x) (((x) & 0x3) << 10)
471 #define AD717X_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
472 #define AD717X_SETUP_CONF_REG_BURNOUT_EN (1 << 7)
473 #define AD717X_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
476 #define AD717X_SETUP_CONF_REG_REFBUF_P (1 << 11)
477 #define AD717X_SETUP_CONF_REG_REFBUF_N (1 << 10)
478 #define AD717X_SETUP_CONF_REG_AINBUF_P (1 << 9)
479 #define AD717X_SETUP_CONF_REG_AINBUF_N (1 << 8)
482 #define AD4111_SETUP_CONF_REG_REFPOS_BUF (1 << 11)
483 #define AD4111_SETUP_CONF_REG_REFNEG_BUF (1 << 10)
484 #define AD4111_SETUP_CONF_REG_AIN_BUF(x) (((x) & 0x3) << 8)
485 #define AD4111_SETUP_CONF_REG_BUFCHOPMAX (1 << 6)
488 #define AD717X_FILT_CONF_REG_SINC3_MAP (1 << 15)
489 #define AD717X_FILT_CONF_REG_ENHFILTEN (1 << 11)
490 #define AD717X_FILT_CONF_REG_ENHFILT(x) (((x) & 0x7) << 8)
491 #define AD717X_FILT_CONF_REG_ORDER(x) (((x) & 0x3) << 5)
492 #define AD717X_FILT_CONF_REG_ODR(x) (((x) & 0x1F) << 0)
495 #define AD717X_ID_REG_MASK 0xFFF0
497 #define AD7172_2_ID_REG_VALUE 0x00D0
499 #define AD7172_4_ID_REG_VALUE 0x2050
501 #define AD7173_8_ID_REG_VALUE 0x30D0
503 #define AD7175_2_ID_REG_VALUE 0x0CD0
505 #define AD7175_8_ID_REG_VALUE 0x3CD0
507 #define AD7176_2_ID_REG_VALUE 0x0C90
509 #define AD7177_2_ID_REG_VALUE 0x4FD0
511 #define AD411X_ID_REG_VALUE 0x30D0
513 #define AD4114_5_ID_REG_VALUE 0x31D0
515 #define AD4116_ID_REG_VALUE 0x34D0
520 #define AD717X_CRC8_POLYNOMIAL_REPRESENTATION 0x07
522 #define AD717X_CONV_TIMEOUT 10000
524 #define AD717x_CHANNEL_INPUT_MASK NO_OS_GENMASK(9,0)
525 #define AD717X_CHMAP_REG_SETUP_SEL_MSK NO_OS_GENMASK(14,12)
526 #define AD717X_CHMAP_REG_AINPOS_MSK NO_OS_GENMASK(9,5)
527 #define AD717X_CHMAP_REG_AINNEG_MSK NO_OS_GENMASK(4,0)
528 #define AD717X_ADCMODE_REG_MODE_MSK NO_OS_GENMASK(6,4)
529 #define AD717X_SETUP_CONF_REG_REF_SEL_MSK NO_OS_GENMASK(5,4)
530 #define AD717x_ODR_MSK NO_OS_GENMASK(4,0)
538 uint8_t reg_address);
583 bool channel_status);
605 bool refbuf_en, uint8_t setup_id);
609 int32_t *adc_raw_data);
int32_t value
Definition: ad717x.h:257
#define AD717X_CRC8_POLYNOMIAL_REPRESENTATION
Definition: ad717x.h:520
@ sps_2957
Definition: ad717x.h:210
@ AIN2
Definition: ad717x.h:123
#define AD717X_ADCMODE_REG_MODE(x)
Definition: ad717x.h:399
enum ad717x_device_type active_device
Definition: ad717x.h:277
@ AVDD_AVSS_P
Definition: ad717x.h:128
@ ID_AD7177_2
Definition: ad717x.h:162
uint32_t timeout
Definition: ad413x.c:55
ad717x_st_reg * regs
Definition: ad717x.h:298
int ad717x_enable_input_buffer(ad717x_dev *device, bool inbuf_en, bool refbuf_en, uint8_t setup_id)
Enable Input Buffer.
Definition: ad717x.c:309
@ AD717X_USE_XOR
Definition: ad717x.h:251
@ IIN2P_IIN2M
Definition: ad717x.h:109
@ sps_31250_a
Definition: ad717x.h:201
#define AD717X_SETUP_CONF_REG_REF_SEL(x)
Definition: ad717x.h:467
uint8_t AD717X_ComputeXOR8(uint8_t *pBuf, uint8_t bufSize)
Computes the XOR checksum for a data buffer.
Definition: ad717x.c:700
#define AD717X_FILTCON0_REG
Definition: ad717x.h:357
#define AD717x_MAX_CHANNELS
Definition: ad717x.h:60
int ad717x_assign_setup(ad717x_dev *device, uint8_t channel_id, uint8_t setup)
Assign Setup to Channel.
Definition: ad717x.c:198
#define AD717X_SETUP_CONF_REG_AINBUF_N
Definition: ad717x.h:479
ad717x_analog_input_pairs
Definition: ad717x.h:91
@ VIN5_VIN4
Definition: ad717x.h:102
@ sps_381
Definition: ad717x.h:213
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:165
#define INVALID_VAL
Definition: ad717x.c:53
@ sinc5_sinc1
Definition: ad717x.h:192
int ad717x_single_read(ad717x_dev *device, uint8_t id, int32_t *adc_raw_data)
Perform Single Conversion.
Definition: ad717x.c:353
@ VIN0_VIN1
Definition: ad717x.h:92
enum ad717x_enhfilt enhfilt
Definition: ad717x.h:233
uint8_t num_regs
Definition: ad717x.h:299
Header file of SPI Interface.
@ sps_503
Definition: ad717x.h:212
@ ID_AD7173_8
Definition: ad717x.h:158
int32_t AD717X_ReadData(ad717x_dev *device, int32_t *pData)
Reads the conversion result from the device.
Definition: ad717x.c:599
@ VIN5_VINCOM
Definition: ad717x.h:103
@ ID_AD4111
Definition: ad717x.h:151
bool sinc3_map
Definition: ad717x.h:231
int32_t size
Definition: ad717x.h:258
int32_t AD717X_UpdateCRCSetting(ad717x_dev *device)
Updates the CRC settings.
Definition: ad717x.c:720
ad717x_mode
Definition: ad717x.h:66
#define AD717X_SETUP_CONF_REG_REF_SEL_MSK
Definition: ad717x.h:529
@ sps31250_b
Definition: ad717x.h:202
enum ad717x_reference_source ref_source
Definition: ad717x.h:173
#define AD717X_IFMODE_REG_DATA_STAT
Definition: ad717x.h:410
@ ID_AD4116
Definition: ad717x.h:155
#define AD717X_ID_REG
Definition: ad717x.h:332
int ad717x_set_adc_mode(ad717x_dev *device, enum ad717x_mode adc_mode)
Set ADC Mode.
Definition: ad717x.c:99
@ sps_20
Definition: ad717x.h:218
@ VIN0_VINCOM
Definition: ad717x.h:93
struct no_os_spi_init_param spi_init
Definition: common_data.c:64
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:750
#define AD717X_IFMODE_REG_XOR_STAT(x)
Definition: ad717x.h:414
@ TEMP_SENSOR_P
Definition: ad717x.h:126
@ sps_59
Definition: ad717x.h:216
#define AD717x_ODR_MSK
Definition: ad717x.h:530
@ VIN6_VIN7
Definition: ad717x.h:104
@ AVDD_AVSS
Definition: ad717x.h:84
@ sps_16
Definition: ad717x.h:219
@ SYS_GAIN_CALIB
Definition: ad717x.h:74
uint8_t AD717X_ComputeCRC8(uint8_t *pBuf, uint8_t bufSize)
Computes the CRC checksum for a data buffer.
Definition: ad717x.c:670
Definition: ad9361_util.h:75
@ sps_5
Definition: ad717x.h:221
enum ad717x_odr odr
Definition: ad717x.h:235
#define AD717X_CHMAP_REG_CH_EN
Definition: ad717x.h:457
#define AD717X_STATUS_REG_RDY
Definition: ad717x.h:389
#define AD717X_CHMAP_REG_SETUP_SEL_MSK
Definition: ad717x.h:525
int ad717x_set_polarity(ad717x_dev *device, bool bipolar, uint8_t setup_id)
Set Polarity.
Definition: ad717x.c:228
#define AD717X_SETUP_CONF_REG_REFBUF_P
Definition: ad717x.h:476
@ sps_10417
Definition: ad717x.h:208
#define AD717X_CHMAP_REG_SETUP_SEL(x)
Definition: ad717x.h:458
@ sps_31250_d
Definition: ad717x.h:204
ad717x_crc_mode
Definition: ad717x.h:248
@ ID_AD7175_8
Definition: ad717x.h:160
int32_t AD717X_ReadData(ad717x_dev *device, int32_t *pData)
Reads the conversion result from the device.
Definition: ad717x.c:599
@ AIN0
Definition: ad717x.h:121
uint8_t AD717X_ComputeCRC8(uint8_t *pBuf, uint8_t bufSize)
Computes the CRC checksum for a data buffer.
Definition: ad717x.c:670
int32_t AD717X_Init(ad717x_dev **device, ad717x_init_param init_param)
Initializes the AD717X.
Definition: ad717x.c:785
enum ad7616_mode mode
Definition: ad7616.h:232
@ POWER_DOWN
Definition: ad717x.h:70
#define AD4111_CHMAP_REG_INPUT(x)
Definition: ad717x.h:463
int32_t AD717X_ReadRegister(ad717x_dev *device, uint8_t addr)
Reads the value of the specified register.
Definition: ad717x.c:418
@ INTERNAL_REF
Definition: ad717x.h:83
@ sps16p6_db82_ms60
Definition: ad717x.h:184
int ad717x_set_adc_mode(ad717x_dev *device, enum ad717x_mode mode)
Set ADC Mode.
Definition: ad717x.c:99
#define AD717X_ADCMODE_REG_REF_EN
Definition: ad717x.h:396
@ sps_49
Definition: ad717x.h:217
int32_t AD717X_ComputeDataregSize(ad717x_dev *device)
Computes data register read size to account for bit number and status read.
Definition: ad717x.c:632
@ ID_AD7172_4
Definition: ad717x.h:157
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:261
uint8_t num_channels
Definition: ad717x.h:281
uint8_t setup_sel
Definition: ad717x.h:244
#define AD717x_CHANNEL_INPUT_MASK
Definition: ad717x.h:524
@ sps_2p5
Definition: ad717x.h:222
int ad717x_set_channel_status(ad717x_dev *device, uint8_t channel_id, bool channel_status)
Set channel status - Enable/Disable.
Definition: ad717x.c:65
@ ID_AD7175_2
Definition: ad717x.h:159
@ SINGLE
Definition: ad717x.h:68
@ CONTINUOUS
Definition: ad717x.h:67
#define AD717X_CHMAP_REG_AINPOS_MSK
Definition: ad717x.h:526
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:130
int ad717x_assign_setup(ad717x_dev *device, uint8_t channel_id, uint8_t setup)
Assign Setup to Channel.
Definition: ad717x.c:198
#define AD717X_COMM_REG_RA(x)
Definition: ad717x.h:386
@ IIN0P_IIN0M
Definition: ad717x.h:111
uint8_t num_setups
Definition: ad717x.h:307
@ TEMP_SENSOR_M
Definition: ad717x.h:127
ad717x_reference_source
Definition: ad717x.h:81
@ sps_100
Definition: ad717x.h:215
ad717x_enhfilt
Definition: ad717x.h:180
uint8_t num_regs
Definition: ad717x.h:274
#define AD717X_SETUP_CONF_REG_AINBUF_P
Definition: ad717x.h:478
struct no_os_spi_desc * spi_desc
Definition: ad717x.h:271
int32_t AD717X_ComputeDataregSize(ad717x_dev *device)
Computes data register read size to account for bit number and status read.
Definition: ad717x.c:632
@ sps31250_e
Definition: ad717x.h:205
ad717x_device_type
Definition: ad717x.h:150
ad717x_analog_input
Definition: ad717x.h:120
#define AD717X_CHMAP_REG_AINNEG_MSK
Definition: ad717x.h:527
bool ref_en
Definition: ad717x.h:303
bool channel_enable
Definition: ad717x.h:243
#define AD717X_ADCMODE_REG
Definition: ad717x.h:327
int32_t AD717X_UpdateCRCSetting(ad717x_dev *device)
Updates the CRC settings.
Definition: ad717x.c:720
@ AIN4
Definition: ad717x.h:125
@ ID_AD4114
Definition: ad717x.h:153
#define AD717x_MAX_SETUPS
Definition: ad717x.h:58
@ VIN1_VIN0
Definition: ad717x.h:94
ad717x_st_reg * regs
Definition: ad717x.h:273
@ VIN4_VINCOM
Definition: ad717x.h:101
@ sps25_db62_ms40
Definition: ad717x.h:182
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:130
@ REF_P
Definition: ad717x.h:130
#define AD717X_IFMODE_REG_CRC_STAT(x)
Definition: ad717x.h:415
@ TEMPERATURE_SENSOR
Definition: ad717x.h:112
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
uint8_t AD717X_ComputeXOR8(uint8_t *pBuf, uint8_t bufSize)
Computes the XOR checksum for a data buffer.
Definition: ad717x.c:700
#define AD717X_SETUP_CONF_REG_BI_UNIPOLAR
Definition: ad717x.h:466
@ VIN1_VINCOM
Definition: ad717x.h:95
@ EXTERNAL_REF
Definition: ad717x.h:82
int32_t AD717X_remove(ad717x_dev *dev)
Free the resources allocated by AD717X_Init().
Definition: ad717x.c:909
@ ID_AD4112
Definition: ad717x.h:152
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:390
bool ref_en
Definition: ad717x.h:279
#define AD717X_SETUPCON0_REG
Definition: ad717x.h:349
int ad717x_single_read(ad717x_dev *device, uint8_t id, int32_t *adc_raw_data)
Perform Single Conversion.
Definition: ad717x.c:353
#define AD717X_CHMAP0_REG
Definition: ad717x.h:333
#define AD717X_GPIOCON_REG
Definition: ad717x.h:331
@ AD717X_USE_CRC
Definition: ad717x.h:250
#define AD717X_COMM_REG_RD
Definition: ad717x.h:385
#define AD717X_FILT_CONF_REG_ODR(x)
Definition: ad717x.h:492
@ REFERENCE
Definition: ad717x.h:113
@ AIN1
Definition: ad717x.h:122
ad717x_crc_mode useCRC
Definition: ad717x.h:275
@ VIN7_VINCOM
Definition: ad717x.h:107
@ VIN6_VINCOM
Definition: ad717x.h:105
#define AD717X_COMM_REG_WEN
Definition: ad717x.h:383
@ VIN7_VIN6
Definition: ad717x.h:106
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:261
#define COMM_ERR
Definition: ad717x.c:54
@ VIN2_VINCOM
Definition: ad717x.h:97
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:49
@ INTERNAL_OFFSET_CALIB
Definition: ad717x.h:71
@ INTERNAL_REF
Definition: ad7124.h:386
int ad717x_set_channel_status(ad717x_dev *device, uint8_t channel_id, bool channel_status)
Set channel status - Enable/Disable.
Definition: ad717x.c:65
int32_t addr
Definition: ad717x.h:256
@ sps_5208
Definition: ad717x.h:209
#define AD717X_CHMAP_REG_AINPOS(x)
Definition: ad717x.h:459
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:245
#define AD717X_OFFSET0_REG
Definition: ad717x.h:365
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:75
int32_t AD717X_remove(ad717x_dev *dev)
Free the resources allocated by AD717X_Init().
Definition: ad717x.c:909
#define AD717X_STATUS_REG
Definition: ad717x.h:326
@ VIN3_VINCOM
Definition: ad717x.h:99
@ sinc3
Definition: ad717x.h:193
#define AD717X_DATA_REG
Definition: ad717x.h:330
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:750
bool enhfilten
Definition: ad717x.h:232
@ INTERNAL_GAIN_CALIB
Definition: ad717x.h:72
@ sps_1007
Definition: ad717x.h:211
@ VIN3_VIN2
Definition: ad717x.h:98
int32_t AD717X_WriteRegister(ad717x_dev *device, uint8_t addr)
Writes the value of the specified register.
Definition: ad717x.c:490
#define AD717X_COMM_REG_WR
Definition: ad717x.h:384
ad717x_odr
Definition: ad717x.h:200
@ ID_AD7172_2
Definition: ad717x.h:156
@ VIN2_VIN3
Definition: ad717x.h:96
uint8_t num_channels
Definition: ad717x.h:305
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
int32_t AD717X_WaitForReady(ad717x_dev *device, uint32_t timeout)
Waits until a new conversion result is available.
Definition: ad717x.c:564
#define AD717X_SETUP_CONF_REG_REFBUF_N
Definition: ad717x.h:477
@ bipolar
Definition: ad5446.h:79
int32_t AD717X_Init(ad717x_dev **device, ad717x_init_param init_param)
Initializes the AD717X.
Definition: ad717x.c:785
#define AD7177_2_ID_REG_VALUE
Definition: ad717x.h:509
#define AD717X_IFMODE_REG
Definition: ad717x.h:328
int32_t AD717X_ReadRegister(ad717x_dev *device, uint8_t addr)
Reads the value of the specified register.
Definition: ad717x.c:418
int32_t AD717X_Reset(ad717x_dev *device)
Resets the device.
Definition: ad717x.c:540
@ IIN3P_IIN3M
Definition: ad717x.h:108
int32_t AD717X_WaitForReady(ad717x_dev *device, uint32_t timeout)
Waits until a new conversion result is available.
Definition: ad717x.c:564
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:122
@ AIN3
Definition: ad717x.h:124
ad717x_order
Definition: ad717x.h:191
@ sps_15625
Definition: ad717x.h:207
#define AD717X_CHMAP_REG_AINNEG(x)
Definition: ad717x.h:460
@ sps_31250_c
Definition: ad717x.h:203
@ sps27_db47_ms36p7
Definition: ad717x.h:181
#define AD717X_IFMODE_REG_DATA_WL16
Definition: ad717x.h:416
@ sps_10
Definition: ad717x.h:220
@ IIN1P_IIN1M
Definition: ad717x.h:110
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:58
int32_t AD717X_WriteRegister(ad717x_dev *device, uint8_t)
Writes the value of the specified register.
Definition: ad717x.c:490
@ VIN4_VIN5
Definition: ad717x.h:100
@ SYS_OFFSET_CALIB
Definition: ad717x.h:73
@ sps20_db86_ms50
Definition: ad717x.h:183
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:390
@ ID_AD7176_2
Definition: ad717x.h:161
@ sps_200
Definition: ad717x.h:214
#define TIMEOUT
Definition: ad717x.c:55
@ sps_31250_f
Definition: ad717x.h:206
#define AD717X_CONV_TIMEOUT
Definition: ad717x.h:522
#define AD717X_ID_REG_MASK
Definition: ad717x.h:495
int ad717x_set_polarity(ad717x_dev *device, bool bipolar, uint8_t setup_id)
Set Polarity.
Definition: ad717x.c:228
int32_t AD717X_Reset(ad717x_dev *device)
Resets the device.
Definition: ad717x.c:540
@ ID_AD4115
Definition: ad717x.h:154
bool input_buff
Definition: ad717x.h:172
@ REF_M
Definition: ad717x.h:131
@ sps_1p25
Definition: ad717x.h:223
#define AD717X_ADCMODE_REG_MODE_MSK
Definition: ad717x.h:528
@ AVDD_AVSS_M
Definition: ad717x.h:129
@ AD717X_DISABLE
Definition: ad717x.h:249
@ STANDBY
Definition: ad717x.h:69
bool ref_buff
Definition: ad717x.h:171
enum ad717x_order oder
Definition: ad717x.h:234
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:131
bool bi_unipolar
Definition: ad717x.h:170