25#ifndef PROTOCORE_INA219_H
26#define PROTOCORE_INA219_H
30#if PROTOCORE_ENABLE_INA219
38#define INA219_REG_CONFIG 0x00
40#define INA219_REG_SHUNT 0x01
42#define INA219_REG_BUS 0x02
44#define INA219_REG_POWER 0x03
46#define INA219_REG_CURRENT 0x04
48#define INA219_REG_CALIBRATION 0x05
65 uint32_t current_lsb_ua;
67} Ina219CalibrationArgs;
73 uint32_t current_lsb_ua;
80 uint32_t current_lsb_ua;
87 uint32_t current_lsb_ua;
101} Ina219ReadShuntUvArgs;
107} Ina219ReadCurrentUaArgs;
113} Ina219ReadPowerUwArgs;
154 Ina219BusMvArgs bus_mv_args;
155 Ina219ShuntUvArgs shunt_uv_args;
156 Ina219CalibrationArgs calibration_args;
157 Ina219CurrentUaArgs current_ua_args;
158 Ina219PowerUwArgs power_uw_args;
159 Ina219BeginArgs begin_args;
160 Ina219ReadBusMvArgs read_bus_mv_args;
161 Ina219ReadShuntUvArgs read_shunt_uv_args;
162 Ina219ReadCurrentUaArgs read_current_ua_args;
163 Ina219ReadPowerUwArgs read_power_uw_args;
170extern Ina219Vars Ina219V;
175 void (*
const bus_mv)(uint8_t *work);
176 void (*
const shunt_uv)(uint8_t *work);
177 void (*
const calibration)(uint8_t *work);
178 void (*
const current_ua)(uint8_t *work);
179 void (*
const power_uw)(uint8_t *work);
180 void (*
const begin)(uint8_t *work);
181 void (*
const read_bus_mv)(uint8_t *work);
182 void (*
const read_shunt_uv)(uint8_t *work);
183 void (*
const read_current_ua)(uint8_t *work);
184 void (*
const read_power_uw)(uint8_t *work);
189void protocore_ina219_bus_mv(uint8_t *work);
190void protocore_ina219_shunt_uv(uint8_t *work);
191void protocore_ina219_calibration(uint8_t *work);
192void protocore_ina219_current_ua(uint8_t *work);
193void protocore_ina219_power_uw(uint8_t *work);
194void protocore_ina219_begin(uint8_t *work);
195void protocore_ina219_read_bus_mv(uint8_t *work);
196void protocore_ina219_read_shunt_uv(uint8_t *work);
197void protocore_ina219_read_current_ua(uint8_t *work);
198void protocore_ina219_read_power_uw(uint8_t *work);
204static const Ina219Ns Ina219 __attribute__((unused)) = {
205 .bus_mv = protocore_ina219_bus_mv,
206 .shunt_uv = protocore_ina219_shunt_uv,
207 .calibration = protocore_ina219_calibration,
208 .current_ua = protocore_ina219_current_ua,
209 .power_uw = protocore_ina219_power_uw,
210 .begin = protocore_ina219_begin,
211 .read_bus_mv = protocore_ina219_read_bus_mv,
212 .read_shunt_uv = protocore_ina219_read_shunt_uv,
213 .read_current_ua = protocore_ina219_read_current_ua,
214 .read_power_uw = protocore_ina219_read_power_uw,
226uint8_t *protocore_ina219_span(
void);
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS