2 releases
new 0.1.1 | Mar 8, 2025 |
---|---|
0.1.0 | Jan 20, 2025 |
#434 in Embedded development
122 downloads per month
23KB
657 lines
A Rust driver for the Texas Instruments INA233 power monitor. Currently incomplete, with support for basic (continuous) readings only.
For usage details and explanatory notes, see the documentation.
Overview
let i2c: Bus = todo!(/* Setup I2C */);
// Setup a device:
const ADDRESS: u8 = 0x40;
let shunt_resistance = ElectricalResistance::new::<milliohm>(5.0);
let maximum_current = ElectricCurrent::new::<ampere>(1.0);
let mut device = Ina233::<_, ADDRESS>::new(i2c, shunt_resistance, maximum_current)?;
// Get latest readings:
device.voltage()?;
device.current()?;
Dependencies
~1.6–2.2MB
~45K SLoC