Commit Graph

4 Commits

Author SHA1 Message Date
Thomas Watson 2f5be28378 AP_BattMonitor: INA3221: reallocate parameter indices
Hasn't been released yet so let's not add more conflicts.
2024-12-14 15:42:31 +11:00
Thomas Watson fb9119fac8 AP_BattMonitor: create table of used backend paramater indices
Hopefully makes it less likely for conflicts to happen and makes it
easier to find free indices.
2024-12-14 15:42:31 +11:00
Thomas Watson 190c3aa7ab AP_BattMonitor: INA3221: fix up based on real experience
* correctly validate channel parameter and improve other parameter
access

* dynamically enable channels to avoid spending time converting unused
channels

* implement tracking of reading health

* correct reading scaling by using datasheet values

* accumulate measured current to track used mAh and Wh

* make configurable using #defines (and hwdef) for integrators

* correctly separate and lock frontend and backend state. Note that
_state of frontend can only be accessed in `read()` method.
2024-12-02 10:10:01 -06:00
Peter Barker 5bc3b629f4 AP_BattMonitor: add support for ina3221 triple-channel current/voltage sensor 2024-12-02 10:10:01 -06:00