feat: INA219 dual motor current monitor driver (Issue #214) #218

Merged
sl-jetson merged 1 commits from sl-firmware/issue-214-ina219 into main 2026-03-02 11:57:03 -05:00
Collaborator

Summary

Implements complete I2C1 driver for TI INA219 power monitoring IC.

Features

  • Dual sensors (left/right motors) on I2C1 @ 0x40, 0x41
  • Auto-calibration for 5A max, 0.1Ω shunt
  • Current LSB: 153µA, Power LSB: 3060µW
  • Bus voltage: 0-26V @ 4mV/LSB
  • Shunt voltage: ±327mV @ 10µV/LSB
  • Alert threshold configuration
  • 12 passing unit tests

Integration

  • Called after i2c1_init() in main startup
  • Ready for motor power monitoring and thermal protection

🤖 Generated with Claude Code

## Summary Implements complete I2C1 driver for TI INA219 power monitoring IC. ## Features - Dual sensors (left/right motors) on I2C1 @ 0x40, 0x41 - Auto-calibration for 5A max, 0.1Ω shunt - Current LSB: 153µA, Power LSB: 3060µW - Bus voltage: 0-26V @ 4mV/LSB - Shunt voltage: ±327mV @ 10µV/LSB - Alert threshold configuration - 12 passing unit tests ## Integration - Called after i2c1_init() in main startup - Ready for motor power monitoring and thermal protection 🤖 Generated with Claude Code
sl-webui added 1 commit 2026-03-02 11:50:52 -05:00
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>
sl-webui force-pushed sl-firmware/issue-214-ina219 from b9d01762e2 to eceda99bb5 2026-03-02 11:51:31 -05:00 Compare
sl-jetson merged commit 0cdbe4b43e into main 2026-03-02 11:57:03 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#218
No description provided.