44#define MAX_INA3221_COUNT 6
45#define INA3221_UPDATE_RATE 100
47#define INA3221_CHANNEL_1 0
48#define INA3221_CHANNEL_2 1
49#define INA3221_CHANNEL_3 2
57#define INA3221_CONFIG 0x00
58#define INA3221_SHUNT_VOLTAGE 0x01
59#define INA3221_BUS_VOLTAGE 0x02
60#define INA3221_CRITICAL_ALERT_LIMIT 0x07
61#define INA3221_WARNING_ALERT_LIMIT 0x08
62#define INA3221_SHUNT_VOLTAGE_SUM 0x0D
63#define INA3221_SHUNT_VOLTAGE_SUM_LIMIT 0x0E
64#define INA3221_MASK_ENABLE 0x0F
65#define INA3221_POWER_UPPER_VALID 0x10
66#define INA3221_POWER_VALID_LOWER_LIMIT 0x11
67#define INA3221_MANUFACTURER_ID 0xFE
68#define INA3221_DIE_ID 0xFF
75#define INA3221_MODE_POWER_DOWN 0x0
76#define INA3221_MODE_SHUNT_TRIG 0x1
77#define INA3221_MODE_BUS_TRIG 0x2
78#define INA3221_MODE_SHUNT_BUS_TRIG 0x3
79#define INA3221_MODE_SHUNT_CONT 0x5
80#define INA3221_MODE_BUS_CONT 0x6
81#define INA3221_MODE_SHUNT_BUS_CONT 0x7
86#define INA3221_VOLTAGE_REGISTERS 6
88#define INA3221_MAX_DELAY 10
90#define INA3221_RSHUNT_DEFAULT 2
96 uint16_t shunt_voltage_conversion_time:3;
97 uint16_t bus_voltage_conversion_time:3;
98 uint16_t averaging_mode:3;
99 uint16_t channel_enable_mode:3;
114 uint16_t shunt_resistor[3];
uint8_t ina3221_read_reg(ina3221_data_t *data, uint8_t reg, uint16_t *read)
Definition ina3221.c:108
#define INA3221_VOLTAGE_REGISTERS
INA3221 Register Count.
Definition ina3221.h:86
void vTaskINA3221(void *Parameters)
Definition ina3221.c:48
TaskHandle_t vTaskINA3221_Handle
Definition ina3221.c:44
uint8_t ina3221_read_voltages(ina3221_data_t *data)
Definition ina3221.c:126
void ina3221_init(void)
Definition ina3221.c:137
Port layer (includes all portable functions headers)
uint32_t rshunt
Definition ina3221.h:121
const ina3221_config_t * config
Definition ina3221.h:120
uint8_t chipid
Definition ina3221.h:118
ina3221_config_reg_t curr_reg_config
Definition ina3221.h:122
uint16_t cfg_word
Definition ina3221.h:110
uint16_t reset
Definition ina3221.h:102
uint16_t bus_voltage_conversion_time
Definition ina3221.h:105
uint16_t mode
Definition ina3221.h:107
uint16_t channel_enable_mode
Definition ina3221.h:103
uint16_t shunt_voltage_conversion_time
Definition ina3221.h:106
uint16_t averaging_mode
Definition ina3221.h:104