Skip to main content

Module sim

Module sim 

Source
Expand description

An INA219 that is not there.

A current monitor’s current and power registers count in steps the calibration sets, and the calibration comes from the shunt and the largest current a driver is told about. So reporting takes the same shunt and largest current a driver is given with with_shunt, and holds the registers a part across that load reports once calibrated for them. part is the common breakout carrying 500 mA at 12 V, with the 100 mΩ shunt sized for 3.2 A a driver starts with.

Constants§

BUS_MILLIVOLTS
The bus voltage part reports, in millivolts.
MAX_MICROAMPS
The largest current part is sized for, in microamps.
MICROAMPS
The current part reports, in microamps.
SHUNT_MILLIOHMS
The shunt part sits across, in milliohms: the common breakout’s.

Functions§

part
An INA219 answering at an address, carrying MICROAMPS at BUS_MILLIVOLTS through SHUNT_MILLIOHMS.
reporting
An INA219 that reads what it is asked to.