drivers: adc: adc_ads1119: Fix configuration register access.

The adc_ads1119 driver is unable to overwrite the configuration register,
the chip therefore always works with its default settings. Register access
macros are fixed by this commit.

Fixes: #70091

Signed-off-by: Jan Kubiznak <jan.kubiznak@deveritec.com>
This commit is contained in:
Jan Kubiznak 2024-03-12 17:29:42 +01:00 committed by Carles Cufí
commit ba90f160b9

View file

@ -21,11 +21,11 @@
LOG_MODULE_REGISTER(ADS1119, CONFIG_ADC_LOG_LEVEL);
#define ADS1119_CONFIG_VREF(x) ((x) & BIT(0))
#define ADS1119_CONFIG_CM(x) ((x) & BIT(1))
#define ADS1119_CONFIG_DR(x) ((x) & (BIT_MASK(2) << 2))
#define ADS1119_CONFIG_GAIN(x) ((x) & BIT(4))
#define ADS1119_CONFIG_MUX(x) ((x) & (BIT_MASK(3) << 5))
#define ADS1119_CONFIG_VREF(x) (FIELD_PREP(BIT(0), x))
#define ADS1119_CONFIG_CM(x) (FIELD_PREP(BIT(1), x))
#define ADS1119_CONFIG_DR(x) (FIELD_PREP(BIT_MASK(2) << 2, x))
#define ADS1119_CONFIG_GAIN(x) (FIELD_PREP(BIT(4), x))
#define ADS1119_CONFIG_MUX(x) (FIELD_PREP(BIT_MASK(3) << 5, x))
#define ADS1119_STATUS_MASK_ID BIT_MASK(7)
#define ADS1119_STATUS_MASK_READY BIT(7)