axp173 0.1.2

Device-agnostic X-Powers AXP173 power management IC driver
Documentation

axp173

What is this?

This is a embedded-hal driver for X-Powers' Power Management IC AXP173.

It's device-agnostic and uses embedded-hal's Write/WriteRead for I2C communication.

Usage

  1. Add dependency to Cargo.toml:

    cargo add axp173
    
  2. Instantiate and init the device:

    // ... declare and configure your I2c peripheral ...
    
    // Init AXP173 PMIC
    let axp173 = axp173::Axp173::new(i2c);
    axp173.init()?;
    Ok(axp173)
    
  3. Configure the PMIC

    todo!()
    

Details and examples

TODO

Status

What is done and tested and what is not yet:

  • Coulomb counter reading
  • Coulomb counter control
  • DC/DC settings
  • IRQs
  • ADC readings
  • AXP173 on-chip buffer
    • Reading
    • Checking default values
    • Writing
  • AXP173 LDO2, LDO3, LDO4 enable/disable
  • LDO voltage setup
  • VBUS presence
  • Battery presence
  • Battery charging status
  • Charging current setup
  • Charging regulated voltage setup
  • Internal ADC settings:
    • Sample rate
    • Enable/Disable various ADC channels (batt. voltage, current, etc.)
  • Button settings