28#ifndef INA3221_PARAM_I2C
29#define INA3221_PARAM_I2C (I2C_DEV(0))
32#ifndef INA3221_PARAM_ADDR
33#define INA3221_PARAM_ADDR (INA3221_ADDR_00)
36#ifndef INA3221_PARAM_PIN_WRN
37#define INA3221_PARAM_PIN_WRN (GPIO_UNDEF)
40#ifndef INA3221_PARAM_PIN_CRT
41#define INA3221_PARAM_PIN_CRT (GPIO_UNDEF)
44#ifndef INA3221_PARAM_PIN_PV
45#define INA3221_PARAM_PIN_PV (GPIO_UNDEF)
48#ifndef INA3221_PARAM_PIN_TC
49#define INA3221_PARAM_PIN_TC (GPIO_UNDEF)
52#ifndef INA3221_PARAM_INT_PU_PIN_WRN
53#define INA3221_PARAM_INT_PU_PIN_WRN (0)
56#ifndef INA3221_PARAM_INT_PU_PIN_CRT
57#define INA3221_PARAM_INT_PU_PIN_CRT (0)
60#ifndef INA3221_PARAM_INT_PU_PIN_PV
61#define INA3221_PARAM_INT_PU_PIN_PV (0)
64#ifndef INA3221_PARAM_INT_PU_PIN_TC
65#define INA3221_PARAM_INT_PU_PIN_TC (0)
68#ifndef INA3221_PARAM_CONFIG
69#define INA3221_PARAM_CONFIG ( \
70 INA3221_ENABLE_CH1 | \
71 INA3221_ENABLE_CH2 | \
72 INA3221_ENABLE_CH3 | \
73 INA3221_NUM_SAMPLES_4 | \
74 INA3221_CONV_TIME_BADC_4156US | \
75 INA3221_CONV_TIME_SADC_4156US | \
76 INA3221_MODE_CONTINUOUS_SHUNT_BUS \
80#ifndef INA3221_PARAM_RSHUNT_MOHM_CH1
81#define INA3221_PARAM_RSHUNT_MOHM_CH1 (100)
84#ifndef INA3221_PARAM_RSHUNT_MOHM_CH2
85#define INA3221_PARAM_RSHUNT_MOHM_CH2 (100)
88#ifndef INA3221_PARAM_RSHUNT_MOHM_CH3
89#define INA3221_PARAM_RSHUNT_MOHM_CH3 (100)
93#define INA3221_PARAMS { \
94 .i2c = INA3221_PARAM_I2C, \
95 .addr = INA3221_PARAM_ADDR, \
97 .pin_warn = INA3221_PARAM_PIN_WRN, \
98 .pin_crit = INA3221_PARAM_PIN_CRT, \
99 .pin_tc = INA3221_PARAM_PIN_TC, \
100 .pin_pv = INA3221_PARAM_PIN_PV \
102 .gpio_config = (INA3221_PARAM_INT_PU_PIN_WRN << INA3221_ALERT_WRN) | \
103 (INA3221_PARAM_INT_PU_PIN_CRT << INA3221_ALERT_CRT) | \
104 (INA3221_PARAM_INT_PU_PIN_TC << INA3221_ALERT_TC) | \
105 (INA3221_PARAM_INT_PU_PIN_PV << INA3221_ALERT_PV), \
106 .config = INA3221_PARAM_CONFIG, \
108 INA3221_PARAM_RSHUNT_MOHM_CH1, \
109 INA3221_PARAM_RSHUNT_MOHM_CH2, \
110 INA3221_PARAM_RSHUNT_MOHM_CH3 \
115#ifndef INA3221_SAUL_INFO
116#define INA3221_SAUL_INFO { .name = "INA3221 bus voltage" }, \
117 { .name = "INA3221 current" }, \
118 { .name = "INA3221 power" }, \
119 { .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.