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
Add dependency to Cargo.toml
:
bash
cargo add axp173
Instantiate and init the device:
```rust
// ... declare and configure your I2c peripheral ...
// Init AXP173 PMIC
let axp173 = axp173::Axp173::new(i2c);
axp173.init()?;
Ok(axp173)
```
Configure the PMIC
rust
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
- [x] AXP173 on-chip buffer
- [x] Reading
- [x] Checking default values
- [x] Writing
- [x] AXP173 LDO2, LDO3, LDO4 enable/disable
- [x] LDO voltage setup
- [x] VBUS presence
- [x] Battery presence
- [x] Battery charging status
- [x] Charging current setup
- [x] Charging regulated voltage setup
- [x] Internal ADC settings:
- [x] Sample rate
- [x] Enable/Disable various ADC channels (batt. voltage, current, etc.)
- [ ] Button settings