31#ifndef INA3221_PARAM_I2C
32#define INA3221_PARAM_I2C (I2C_DEV(0))
35#ifndef INA3221_PARAM_ADDR
36#define INA3221_PARAM_ADDR (INA3221_ADDR_00)
39#ifndef INA3221_PARAM_PIN_WRN
40#define INA3221_PARAM_PIN_WRN (GPIO_UNDEF)
43#ifndef INA3221_PARAM_PIN_CRT
44#define INA3221_PARAM_PIN_CRT (GPIO_UNDEF)
47#ifndef INA3221_PARAM_PIN_PV
48#define INA3221_PARAM_PIN_PV (GPIO_UNDEF)
51#ifndef INA3221_PARAM_PIN_TC
52#define INA3221_PARAM_PIN_TC (GPIO_UNDEF)
55#ifndef INA3221_PARAM_INT_PU_PIN_WRN
56#define INA3221_PARAM_INT_PU_PIN_WRN (0)
59#ifndef INA3221_PARAM_INT_PU_PIN_CRT
60#define INA3221_PARAM_INT_PU_PIN_CRT (0)
63#ifndef INA3221_PARAM_INT_PU_PIN_PV
64#define INA3221_PARAM_INT_PU_PIN_PV (0)
67#ifndef INA3221_PARAM_INT_PU_PIN_TC
68#define INA3221_PARAM_INT_PU_PIN_TC (0)
71#ifndef INA3221_PARAM_CONFIG
72#define INA3221_PARAM_CONFIG ( \
73 INA3221_ENABLE_CH1 | \
74 INA3221_ENABLE_CH2 | \
75 INA3221_ENABLE_CH3 | \
76 INA3221_NUM_SAMPLES_4 | \
77 INA3221_CONV_TIME_BADC_4156US | \
78 INA3221_CONV_TIME_SADC_4156US | \
79 INA3221_MODE_CONTINUOUS_SHUNT_BUS \
83#ifndef INA3221_PARAM_RSHUNT_MOHM_CH1
84#define INA3221_PARAM_RSHUNT_MOHM_CH1 (100)
87#ifndef INA3221_PARAM_RSHUNT_MOHM_CH2
88#define INA3221_PARAM_RSHUNT_MOHM_CH2 (100)
91#ifndef INA3221_PARAM_RSHUNT_MOHM_CH3
92#define INA3221_PARAM_RSHUNT_MOHM_CH3 (100)
96#define INA3221_PARAMS { \
97 .i2c = INA3221_PARAM_I2C, \
98 .addr = INA3221_PARAM_ADDR, \
100 .pin_warn = INA3221_PARAM_PIN_WRN, \
101 .pin_crit = INA3221_PARAM_PIN_CRT, \
102 .pin_tc = INA3221_PARAM_PIN_TC, \
103 .pin_pv = INA3221_PARAM_PIN_PV \
105 .gpio_config = (INA3221_PARAM_INT_PU_PIN_WRN << INA3221_ALERT_WRN) | \
106 (INA3221_PARAM_INT_PU_PIN_CRT << INA3221_ALERT_CRT) | \
107 (INA3221_PARAM_INT_PU_PIN_TC << INA3221_ALERT_TC) | \
108 (INA3221_PARAM_INT_PU_PIN_PV << INA3221_ALERT_PV), \
109 .config = INA3221_PARAM_CONFIG, \
111 INA3221_PARAM_RSHUNT_MOHM_CH1, \
112 INA3221_PARAM_RSHUNT_MOHM_CH2, \
113 INA3221_PARAM_RSHUNT_MOHM_CH3 \
118#ifndef INA3221_SAUL_INFO
119#define INA3221_SAUL_INFO { .name = "INA3221 bus voltage" }, \
120 { .name = "INA3221 current" }, \
121 { .name = "INA3221 power" }, \
122 { .name = "INA3221 shunt voltage sum" }
Device driver interface for Texas Instruments INA3221 three-channel, high-side current and bus voltag...
static const ina3221_params_t ina3221_params[]
INA3221 array of device configurations.
#define INA3221_SAUL_INFO
SAUL driver information.
static const saul_reg_info_t ina3221_saul_info[]
INA3221 array of SAUL driver information.
#define INA3221_PARAMS
Default device initialization parameters.
SAUL registry interface definition.
INA3221 device parameters.
Additional data to collect for each entry.