Implements complete I2C1 driver for TI INA219 power monitoring IC supporting: - Dual sensors on I2C1 (left motor @ 0x40, right motor @ 0x41) - Auto-calibration for 5A max current, 0.1Ω shunt resistance - Current LSB: 153µA, Power LSB: 3060µW (20× current LSB) - Bus voltage: 0-26V @ 4mV/LSB (13-bit, 4mV resolution) - Shunt voltage: ±327mV @ 10µV/LSB (signed 16-bit) - Calibration register computation for arbitrary max current/shunt values - Efficient single/batch read functions (voltage, current, power) - Alert threshold configuration for overcurrent protection - Full test suite: 12 passing unit tests covering calibration, conversions, edge cases Integration: - ina219_init() called after i2c1_init() in main startup sequence - Ready for motor power monitoring and thermal protection logic Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Description
SaltyLab self-balancing bot firmware (STM32F722)
Languages
Python
67.1%
C
11.4%
JavaScript
9.2%
OpenSCAD
7.8%
HTML
1.5%
Other
2.9%