14 #ifndef AD7124_SUPPORT_H_
15 #define AD7124_SUPPORT_H_
27 #define AD7124_PGA_GAIN(x) (1 << (x))
30 #define AD7124_ADC_CTRL_REG_POWER_MODE_MSK NO_OS_GENMASK(7,6)
31 #define AD7124_ADC_CTRL_REG_POWER_MODE_RD(x) (((x) >> 6) & 0x3)
32 #define AD7124_ADC_CTRL_REG_MSK NO_OS_GENMASK(5,2)
35 #define AD7124_CH_MAP_REG_SETUP_RD(x) (((x) >> 12) & 0x7)
36 #define AD7124_CH_MAP_REG_AINP_RD(x) (((x) >> 5) & 0x1F)
37 #define AD7124_CH_MAP_REG_AINM_RD(x) (((x) >> 0) & 0x1F)
40 #define AD7124_CFG_REG_PGA_MSK NO_OS_GENMASK(2, 0)
42 #define AD7124_REF_VOLTAGE (2.5)
43 #define AD7124_ADC_N_BITS (24)
46 #define AD7124_IO_CTRL1_REG_IOUT_CH0_MSK NO_OS_GENMASK(3,0)
47 #define AD7124_IO_CTRL1_REG_IOUT0_MSK NO_OS_GENMASK(10,8)
50 #define AD7124_IO_CTRL1_REG_IOUT_CH1_MSK NO_OS_GENMASK(7,4)
51 #define AD7124_IO_CTRL1_REG_IOUT1_MSK NO_OS_GENMASK(13,11)
54 #define AD7124_ERR_REG_ADC_CAL_ERR_RD(x) ((x >> 18) & 0x1)
bool ad7124_get_channel_bipolar(struct ad7124_dev *dev, uint8_t channel)
Definition: ad7124_support.c:62
uint8_t ad7124_get_channel_setup(struct ad7124_dev *dev, uint8_t channel)
Definition: ad7124_support.c:30
uint8_t ad7124_get_channel_pga(struct ad7124_dev *dev, uint8_t channel)
Definition: ad7124_support.c:45
float ad7124_convert_sample_to_voltage(struct ad7124_dev *dev, uint8_t channel, uint32_t sample)
Definition: ad7124_support.c:85
adc_control_modes
Definition: ad7124_support.h:56
@ INTERNAL_FULL_SCALE_CALIBRATE_MODE
Definition: ad7124_support.h:63
@ IDLE_MODE
Definition: ad7124_support.h:61
@ INTERNAL_ZERO_SCALE_CALIBRATE_MODE
Definition: ad7124_support.h:62
@ SINGLE_CONV_MODE
Definition: ad7124_support.h:58
@ STANDBY_MODE
Definition: ad7124_support.h:59
@ POWER_DOWN_MODE
Definition: ad7124_support.h:60
@ CONTINUOUS_CONV_MODE
Definition: ad7124_support.h:57
@ SYSTEM_ZERO_SCALE_CALIBRATE_MODE
Definition: ad7124_support.h:64
@ SYSTEM_FULL_SCALE_CALIBRATE_MODE
Definition: ad7124_support.h:65