Expand description
Texas Instruments INA219 high-side current, voltage, and power monitor.
The INA219 measures the voltage across a shunt resistor and the bus voltage, and, once its calibration register is programmed, computes current and power on the chip. This module builds the calibration value and decodes each register into a physical quantity, following the datasheet’s equations and its worked design example, so a solar-battery or microgrid node reads amps and watts directly.
Currents, voltages, and powers are returned in integer micro-units (microvolts, microamps, microwatts) so the conversions stay exact without floating point.
Modules§
- register
- The INA219 register addresses.
Constants§
- CONFIG_
RESET - The power-on value of the configuration register (0x399F): 32 V bus range, gain /8, 12-bit ADCs, and continuous shunt-and-bus conversion.
Functions§
- bus_
millivolts - Decodes the bus voltage register to millivolts.
- bus_
register - Builds the bus voltage register a monitor reports for a bus voltage.
- calibration
- Computes the calibration register value for a chosen current resolution and shunt.
- conversion_
ready - Returns whether the bus voltage register’s conversion-ready (CNVR) flag is set.
- current_
microamps - Decodes the current register to microamps for a given current LSB.
- current_
register - Builds the current register a monitor reports for a current.
- math_
overflow - Returns whether the bus voltage register’s math-overflow (OVF) flag is set.
- minimum_
current_ lsb_ microamps - Returns the smallest current LSB, in microamps, that still spans a full-scale current.
- power_
microwatts - Decodes the power register to microwatts for a given current LSB.
- power_
register - Builds the power register a monitor reports for a power.
- shunt_
microvolts - Decodes the shunt voltage register to microvolts.
- shunt_
register - Builds the shunt voltage register a monitor reports for a shunt voltage.