From b507fe960684d23ba23ed2d55b65c66f6431ab8f Mon Sep 17 00:00:00 2001 From: Ken Pettit Date: Sat, 26 Jan 2019 09:59:06 -0600 Subject: [PATCH] drivers/sensors/ina3221.h: Fix errors in register addresses and bitfield values. --- include/nuttx/sensors/ina3221.h | 68 ++++++++++++++++----------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/include/nuttx/sensors/ina3221.h b/include/nuttx/sensors/ina3221.h index 1ef62153e8..c0d1a63e96 100644 --- a/include/nuttx/sensors/ina3221.h +++ b/include/nuttx/sensors/ina3221.h @@ -52,45 +52,45 @@ /* INA3221 Register Definitions ***********************************************/ /* INA3221 Config Register bits */ -#define INA3221_CONFIG_MODE_POWERDOWN 0x000 -#define INA3221_CONFIG_MODE_SHUNT_TRIG 0x001 -#define INA3221_CONFIG_MODE_BUS_TRIG 0x010 -#define INA3221_CONFIG_MODE_BOTH_TRIG 0x011 -#define INA3221_CONFIG_MODE_POWERDOWN_1 0x100 -#define INA3221_CONFIG_MODE_SHUNT_CONT 0x101 -#define INA3221_CONFIG_MODE_BUS_CONT 0x110 -#define INA3221_CONFIG_MODE_BOTH_CONT 0x111 +#define INA3221_CONFIG_MODE_POWERDOWN 0x0 +#define INA3221_CONFIG_MODE_SHUNT_TRIG 0x1 +#define INA3221_CONFIG_MODE_BUS_TRIG 0x2 +#define INA3221_CONFIG_MODE_BOTH_TRIG 0x3 +#define INA3221_CONFIG_MODE_POWERDOWN_1 0x4 +#define INA3221_CONFIG_MODE_SHUNT_CONT 0x5 +#define INA3221_CONFIG_MODE_BUS_CONT 0x6 +#define INA3221_CONFIG_MODE_BOTH_CONT 0x7 -#define INA3221_CONFIG_VSHUNTCT_140_US (0x000 << 3) -#define INA3221_CONFIG_VSHUNTCT_204_US (0x001 << 3) -#define INA3221_CONFIG_VSHUNTCT_332_US (0x010 << 3) -#define INA3221_CONFIG_VSHUNTCT_588_US (0x011 << 3) -#define INA3221_CONFIG_VSHUNTCT_1100_US (0x100 << 3) -#define INA3221_CONFIG_VSHUNTCT_2116_US (0x101 << 3) -#define INA3221_CONFIG_VSHUNTCT_4156_US (0x110 << 3) -#define INA3221_CONFIG_VSHUNTCT_8244_US (0x111 << 3) +#define INA3221_CONFIG_VSHUNTCT_140_US (0x0 << 3) +#define INA3221_CONFIG_VSHUNTCT_204_US (0x1 << 3) +#define INA3221_CONFIG_VSHUNTCT_332_US (0x2 << 3) +#define INA3221_CONFIG_VSHUNTCT_588_US (0x3 << 3) +#define INA3221_CONFIG_VSHUNTCT_1100_US (0x4 << 3) +#define INA3221_CONFIG_VSHUNTCT_2116_US (0x5 << 3) +#define INA3221_CONFIG_VSHUNTCT_4156_US (0x6 << 3) +#define INA3221_CONFIG_VSHUNTCT_8244_US (0x7 << 3) -#define INA3221_CONFIG_VBUSCT_140_US (0x000 << 6) -#define INA3221_CONFIG_VBUSCT_204_US (0x001 << 6) -#define INA3221_CONFIG_VBUSCT_332_US (0x010 << 6) -#define INA3221_CONFIG_VBUSCT_588_US (0x011 << 6) -#define INA3221_CONFIG_VBUSCT_1100_US (0x100 << 6) -#define INA3221_CONFIG_VBUSCT_2116_US (0x101 << 6) -#define INA3221_CONFIG_VBUSCT_4156_US (0x110 << 6) -#define INA3221_CONFIG_VBUSCT_8244_US (0x111 << 6) +#define INA3221_CONFIG_VBUSCT_140_US (0x0 << 6) +#define INA3221_CONFIG_VBUSCT_204_US (0x1 << 6) +#define INA3221_CONFIG_VBUSCT_332_US (0x2 << 6) +#define INA3221_CONFIG_VBUSCT_588_US (0x3 << 6) +#define INA3221_CONFIG_VBUSCT_1100_US (0x4 << 6) +#define INA3221_CONFIG_VBUSCT_2116_US (0x5 << 6) +#define INA3221_CONFIG_VBUSCT_4156_US (0x6 << 6) +#define INA3221_CONFIG_VBUSCT_8244_US (0x7 << 6) -#define INA3221_CONFIG_AVG_NSAMPLES_1 (0x000 << 9) -#define INA3221_CONFIG_AVG_NSAMPLES_4 (0x001 << 9) -#define INA3221_CONFIG_AVG_NSAMPLES_16 (0x010 << 9) -#define INA3221_CONFIG_AVG_NSAMPLES_64 (0x011 << 9) -#define INA3221_CONFIG_AVG_NSAMPLES_128 (0x100 << 9) -#define INA3221_CONFIG_AVG_NSAMPLES_256 (0x101 << 9) -#define INA3221_CONFIG_AVG_NSAMPLES_512 (0x110 << 9) -#define INA3221_CONFIG_AVG_NSAMPLES_1024 (0x111 << 9) +#define INA3221_CONFIG_AVG_NSAMPLES_1 (0x0 << 9) +#define INA3221_CONFIG_AVG_NSAMPLES_4 (0x1 << 9) +#define INA3221_CONFIG_AVG_NSAMPLES_16 (0x2 << 9) +#define INA3221_CONFIG_AVG_NSAMPLES_64 (0x3 << 9) +#define INA3221_CONFIG_AVG_NSAMPLES_128 (0x4 << 9) +#define INA3221_CONFIG_AVG_NSAMPLES_256 (0x5 << 9) +#define INA3221_CONFIG_AVG_NSAMPLES_512 (0x6 << 9) +#define INA3221_CONFIG_AVG_NSAMPLES_1024 (0x7 << 9) -#define INA3221_CONFIG_CH1_EN (1 << 12) +#define INA3221_CONFIG_CH1_EN (1 << 14) #define INA3221_CONFIG_CH2_EN (1 << 13) -#define INA3221_CONFIG_CH3_EN (1 << 14) +#define INA3221_CONFIG_CH3_EN (1 << 12) /**************************************************************************** * Public Types