|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
AXP192 PMIC Unified Interface. More...
#include <PmicAXP192.hpp>
Public Member Functions | |
| PmicAXP192 () | |
| bool | begin (SensorCommCustom::CustomCallback callback, SensorCommCustomHal::CustomHalCallback hal_cb, uint8_t addr) |
| Initialise the AXP192 with custom communication callbacks. | |
| void | end () |
| Deinitialize PMIC and release resources. | |
| PmicCapability::Capability | getCapabilities () const override |
| Get supported capabilities bitmask. | |
| const PmicConfig & | getConfig () const override |
| Get PMIC configuration structure. | |
| PmicPowerBase & | getPower () override |
| Access the power management interface. | |
| PmicChargerBase * | getCharger () override |
| Access the charger interface. | |
| PmicAdcBase & | getAdc () override |
| Access the ADC interface. | |
| PmicGpioBase * | getGpio () override |
| Get GPIO interface. | |
| PmicLedBase & | getLed () override |
| Access the LED interface. | |
| PmicChannelBase * | getChannel () override |
| Access the power channel control interface. | |
| PmicIrqBase * | getIrq () override |
| Get interrupt interface. | |
| const char * | getChipName () const override |
| Get the chip name string. | |
| AXP1xxIrq< axp192_regs > & | irq () |
| Access the IRQ subsystem. | |
| AXP1xxCharger< axp192_regs > & | charger () |
| Access the charger subsystem. | |
| AXP1xxLed< axp192_regs > & | led () |
| Access the LED module. | |
| AXP192Gpio & | gpio () |
| Access the GPIO interface. | |
| AXP1xxPwron< axp192_regs > & | pwron () |
| Access the power-on control subsystem. | |
| AXP1xxTimer< axp192_regs > & | timer () |
| Access the countdown timer subsystem. | |
| AXP192Adc & | adc () |
| Access the chip-specific ADC interface. | |
| AXP192Core & | core () |
| Access the core communication object. | |
| uint16_t | getStatus () |
| Read combined status registers (STATUS + MODE_CHGSTATUS) | |
| bool | isVbusGood () |
| Check if VBUS power is present and good. | |
| bool | isBatteryConnect () |
| Check if a battery is connected. | |
| bool | isCharging () |
| Check if the battery is currently charging. | |
| uint8_t | getChipID () |
| Read the AXP192 chip identification register. | |
| void | shutdown () |
| Shut down the AXP192 (soft power-off) | |
| void | reset () |
| Reset the AXP192. | |
Public Member Functions inherited from PmicBase | |
| virtual | ~PmicBase ()=default |
| Virtual destructor. | |
AXP192 PMIC Unified Interface.
Top-level driver that composes all AXP192 functional blocks and exposes them through a consistent API. Supports begin() with Arduino Wire, ESP-IDF I2C legacy, ESP-IDF I2C new driver, or custom communication wrappers.
Definition at line 92 of file PmicAXP192.hpp.
|
inline |
Definition at line 95 of file PmicAXP192.hpp.
|
inline |
Access the chip-specific ADC interface.
Definition at line 330 of file PmicAXP192.hpp.
|
inlinevirtual |
Initialise the AXP192 with custom communication callbacks.
| callback | Custom I2C read/write callback |
| hal_cb | Custom HAL callback |
| addr | I2C slave address |
Implements PmicBase.
Definition at line 152 of file PmicAXP192.hpp.
References I2CDeviceWithHal::begin().
Referenced by setup().
|
inline |
Access the charger subsystem.
Definition at line 285 of file PmicAXP192.hpp.
|
inline |
Access the core communication object.
Definition at line 339 of file PmicAXP192.hpp.
|
inlinevirtual |
Deinitialize PMIC and release resources.
Implements PmicBase.
Definition at line 159 of file PmicAXP192.hpp.
|
inlineoverridevirtual |
Access the ADC interface.
Implements PmicBase.
Definition at line 230 of file PmicAXP192.hpp.
|
inlineoverridevirtual |
Get supported capabilities bitmask.
Implements PmicBase.
Definition at line 167 of file PmicAXP192.hpp.
References PmicCapability::PmicSupportAdc, PmicCapability::PmicSupportChannel, PmicCapability::PmicSupportCharger, PmicCapability::PmicSupportGpio, PmicCapability::PmicSupportIrq, PmicCapability::PmicSupportLed, PmicCapability::PmicSupportPower, and PmicCapability::PmicSupportPowerBtn.
|
inlineoverridevirtual |
Access the power channel control interface.
Reimplemented from PmicBase.
Definition at line 253 of file PmicAXP192.hpp.
Referenced by setup().
|
inlineoverridevirtual |
Access the charger interface.
Reimplemented from PmicBase.
Definition at line 221 of file PmicAXP192.hpp.
|
inline |
Read the AXP192 chip identification register.
Definition at line 387 of file PmicAXP192.hpp.
References axp192_regs::bmu::IC_TYPE, and SensorCommWrapper::readReg().
|
inlineoverridevirtual |
Get the chip name string.
Implements PmicBase.
Definition at line 267 of file PmicAXP192.hpp.
|
inlineoverridevirtual |
Get PMIC configuration structure.
Implements PmicBase.
Definition at line 183 of file PmicAXP192.hpp.
References PmicConfig::chipName, PmicCapability::PmicSupportAdc, PmicCapability::PmicSupportChannel, PmicCapability::PmicSupportCharger, PmicCapability::PmicSupportGpio, PmicCapability::PmicSupportIrq, PmicCapability::PmicSupportLed, PmicCapability::PmicSupportPower, and PmicCapability::PmicSupportPowerBtn.
|
inlineoverridevirtual |
Get GPIO interface.
Reimplemented from PmicBase.
Definition at line 235 of file PmicAXP192.hpp.
|
inlineoverridevirtual |
Get interrupt interface.
Reimplemented from PmicBase.
Definition at line 258 of file PmicAXP192.hpp.
|
inlineoverridevirtual |
Access the LED interface.
Implements PmicBase.
Definition at line 244 of file PmicAXP192.hpp.
|
inlineoverridevirtual |
Access the power management interface.
Implements PmicBase.
Definition at line 212 of file PmicAXP192.hpp.
|
inline |
Read combined status registers (STATUS + MODE_CHGSTATUS)
Definition at line 348 of file PmicAXP192.hpp.
References axp192_regs::bmu::MODE_CHGSTATUS, SensorCommWrapper::readReg(), and axp192_regs::bmu::STATUS.
|
inline |
Access the GPIO interface.
Definition at line 303 of file PmicAXP192.hpp.
|
inline |
Access the IRQ subsystem.
Definition at line 276 of file PmicAXP192.hpp.
|
inline |
Check if a battery is connected.
Definition at line 369 of file PmicAXP192.hpp.
References SensorCommWrapper::getRegBit(), and axp192_regs::bmu::MODE_CHGSTATUS.
|
inline |
Check if the battery is currently charging.
Definition at line 378 of file PmicAXP192.hpp.
References AXP1xxCharger< Regs >::isCharging().
|
inline |
Check if VBUS power is present and good.
Definition at line 360 of file PmicAXP192.hpp.
References SensorCommWrapper::getRegBit(), and axp192_regs::bmu::STATUS.
|
inline |
Access the LED module.
Definition at line 294 of file PmicAXP192.hpp.
Referenced by setup().
|
inline |
Access the power-on control subsystem.
Definition at line 312 of file PmicAXP192.hpp.
|
inline |
Reset the AXP192.
Triggers a system reset by setting the PEK reset bit in OFF_CTL.
Definition at line 410 of file PmicAXP192.hpp.
References axp192_regs::pmu::OFF_CTL, and SensorCommWrapper::setRegBit().
|
inline |
Shut down the AXP192 (soft power-off)
Sets the OFF bit to put the PMIC into shutdown mode. The system will remain off until the power key is pressed or VBUS is reapplied.
Definition at line 400 of file PmicAXP192.hpp.
References axp192_regs::pmu::OFF_CTL, and SensorCommWrapper::setRegBit().
|
inline |
Access the countdown timer subsystem.
Definition at line 321 of file PmicAXP192.hpp.