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
: -
Instantiate and init the device:
// ... declare and configure your I2c peripheral ... // Init AXP173 PMIC let axp173 = new; axp173.init?; Ok
-
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