|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <AXP202PowerEx.hpp>
Public Types | |
| enum class | LDO3Mode : uint8_t { LDO = 0 , DCIN = 1 } |
Public Member Functions | |
| AXP202PowerEx (AXP202Core &core) | |
| void | enableLongPressShutdown () |
| Enable automatic power-off when the power key is held. | |
| void | disableLongPressShutdown () |
| Disable automatic power-off when the power key is held. | |
| bool | setLDO3Mode (LDO3Mode mode) |
| Select the LDO3 regulated output or DCIN pass-through path. | |
| bool | setDCDC2PWMMode (bool pwm) |
| Force DCDC2 to PWM mode (REG 80H bit 2) | |
| bool | isDCDC2PWMMode () |
| bool | setDCDC3PWMMode (bool pwm) |
| Force DCDC3 to PWM mode (REG 80H bit 1) | |
| bool | isDCDC3PWMMode () |
| bool | setAPSWarningLevel1 (uint8_t opt) |
| Set APS warning level 1 voltage (REG 3AH) | |
| uint8_t | getAPSWarningLevel1 () |
| bool | setAPSWarningLevel2 (uint8_t opt) |
| Set APS warning level 2 voltage (REG 3BH) | |
| uint8_t | getAPSWarningLevel2 () |
| bool | enableOverTemperatureShutdown (bool enable) |
| Enable over-temperature shutdown (REG 8FH bit 2) | |
| bool | isOverTemperatureShutdownEnabled () |
| bool | setDCDCFrequency (uint8_t freq) |
| Set DCDC switching frequency (REG 37H) | |
| uint8_t | getDCDCFrequency () |
| bool | enableVBUSDetection (bool enable) |
| Enable VBUS Valid detection (REG 8BH bit 3) | |
| bool | isVBUSDetectionEnabled () |
Definition at line 16 of file AXP202PowerEx.hpp.
|
strong |
| Enumerator | |
|---|---|
| LDO | |
| DCIN | |
Definition at line 19 of file AXP202PowerEx.hpp.
|
inlineexplicit |
Definition at line 24 of file AXP202PowerEx.hpp.
|
inline |
Disable automatic power-off when the power key is held.
Definition at line 39 of file AXP202PowerEx.hpp.
References SensorCommWrapper::clrRegBit(), and axp202_regs::pmu::POK_SET.
|
inline |
Enable automatic power-off when the power key is held.
Definition at line 31 of file AXP202PowerEx.hpp.
References axp202_regs::pmu::POK_SET, and SensorCommWrapper::setRegBit().
|
inline |
Enable over-temperature shutdown (REG 8FH bit 2)
| enable | true to enable shutdown on over-temp |
Definition at line 138 of file AXP202PowerEx.hpp.
References SensorCommWrapper::clrRegBit(), axp202_regs::pmu::HOTOVER_CTL, and SensorCommWrapper::setRegBit().
|
inline |
Enable VBUS Valid detection (REG 8BH bit 3)
| enable | true to enable |
Definition at line 173 of file AXP202PowerEx.hpp.
References SensorCommWrapper::clrRegBit(), SensorCommWrapper::setRegBit(), and axp202_regs::pmu::VBUS_DET_SRP.
|
inline |
Definition at line 109 of file AXP202PowerEx.hpp.
References axp202_regs::pmu::APS_WARNING1, and SensorCommWrapper::readReg().
|
inline |
Definition at line 125 of file AXP202PowerEx.hpp.
References axp202_regs::pmu::APS_WARNING2, and SensorCommWrapper::readReg().
|
inline |
Definition at line 160 of file AXP202PowerEx.hpp.
References axp202_regs::pmu::DCDC_FREQSET, and SensorCommWrapper::readReg().
|
inline |
Definition at line 76 of file AXP202PowerEx.hpp.
References axp202_regs::pmu::DCDC_MODESET, and SensorCommWrapper::getRegBit().
|
inline |
Definition at line 92 of file AXP202PowerEx.hpp.
References axp202_regs::pmu::DCDC_MODESET, and SensorCommWrapper::getRegBit().
|
inline |
Definition at line 144 of file AXP202PowerEx.hpp.
References SensorCommWrapper::getRegBit(), and axp202_regs::pmu::HOTOVER_CTL.
|
inline |
Definition at line 179 of file AXP202PowerEx.hpp.
References SensorCommWrapper::getRegBit(), and axp202_regs::pmu::VBUS_DET_SRP.
|
inline |
Set APS warning level 1 voltage (REG 3AH)
| opt | Raw value. Voltage = 2.8672V + opt * 5.6mV. Range 0-255. |
Definition at line 104 of file AXP202PowerEx.hpp.
References axp202_regs::pmu::APS_WARNING1, and SensorCommWrapper::updateBits().
|
inline |
Set APS warning level 2 voltage (REG 3BH)
| opt | Raw value. Same formula as level 1. |
Definition at line 120 of file AXP202PowerEx.hpp.
References axp202_regs::pmu::APS_WARNING2, and SensorCommWrapper::updateBits().
|
inline |
Force DCDC2 to PWM mode (REG 80H bit 2)
| pwm | true=forced PWM, false=auto PWM/PFM |
Definition at line 70 of file AXP202PowerEx.hpp.
References SensorCommWrapper::clrRegBit(), axp202_regs::pmu::DCDC_MODESET, and SensorCommWrapper::setRegBit().
|
inline |
Force DCDC3 to PWM mode (REG 80H bit 1)
| pwm | true=forced PWM, false=auto PWM/PFM |
Definition at line 86 of file AXP202PowerEx.hpp.
References SensorCommWrapper::clrRegBit(), axp202_regs::pmu::DCDC_MODESET, and SensorCommWrapper::setRegBit().
|
inline |
Set DCDC switching frequency (REG 37H)
| freq | Frequency code. Consult datasheet for valid values. |
Definition at line 155 of file AXP202PowerEx.hpp.
References axp202_regs::pmu::DCDC_FREQSET, and SensorCommWrapper::writeReg().
|
inline |
Select the LDO3 regulated output or DCIN pass-through path.
| mode | LDO for regulated output, DCIN for pass-through |
Definition at line 51 of file AXP202PowerEx.hpp.
References SensorCommWrapper::clrRegBit(), DCIN, LDO, axp202_regs::pmu::LDO3OUT_VOL, and SensorCommWrapper::setRegBit().