Crate lc709203[][src]

Expand description

A platform agnostic Rust driver for the LC709302 battery gauge sensor.

Example usage

// some concrete type implementing I2C access, i.e. the embedded_hal::blocking::i2c::WriteRead
// and embedded_hal::blocking::i2c::Write traits
let i2c = I2C::new();

// create a builder
let lc709203 = lc709203::Builder::default()
    .with_battery_capacity(2500) // battery capacity (specified in mAh) must be set!
    .build(&mut i2c)?; // initialize the lc709203 chip
let battery_voltage = lc709203.cell_voltage_v(&mut i2c)?; // query current battery voltage

Re-exports

pub use device::ChipError;

Modules

Low level device access.

Structs

Builder to configure a LC709203 instance.

Higher level access to the LC709203 chip. Provides interpreted/converted data.

Enums

Battery type to use.

Error during initialization.

Determines which battery voltage should be used to initializes RSOC measurements.

Mode for the temperature registers (cell temperature and ambient temperature).