|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <AXP2101Power.hpp>
Public Member Functions | |
| AXP2101Power (AXP2101Core &core) | |
| Construct an AXP2101Power instance. | |
| ~AXP2101Power ()=default | |
| bool | setMinimumSystemVoltage (uint32_t mv) override |
| Set the minimum VSYS system voltage (REG 0x14 bits 6:4). | |
| uint32_t | getMinimumSystemVoltage () const override |
| Get the minimum VSYS system voltage (REG 0x14 bits 6:4). | |
| bool | setInputVoltageLimit (uint32_t mv) override |
| Set the VBUS input voltage limit (REG 0x15 bits 3:0). | |
| uint32_t | getInputVoltageLimit () const override |
| Get the VBUS input voltage limit (REG 0x15 bits 3:0). | |
| bool | setInputCurrentLimit (uint32_t mA) override |
| Set the VBUS input current limit (REG 0x16 bits 2:0). | |
| uint32_t | getInputCurrentLimit () const override |
| Get the VBUS input current limit (REG 0x16 bits 2:0). | |
| bool | enableShipMode (bool enable) override |
| Enable or disable ship mode (REG 0x12 bit 3). | |
| bool | isShipModeEnabled () const override |
| Check whether ship mode is currently active (REG 0x12 bit 3). | |
| bool | setSysPowerDownVoltage (uint16_t millivolt) |
| Set the VSYS power-off voltage threshold (REG 0x24 bits 2:0). | |
| uint16_t | getSysPowerDownVoltage () |
| Get the VSYS power-off voltage threshold (REG 0x24 bits 2:0). | |
| void | enableInternalDischarge () |
| Enable internal battery discharge resistor (REG 0x10 bit 5). | |
| void | disableInternalDischarge () |
| Disable internal battery discharge resistor (REG 0x10 bit 5). | |
| void | softShutdown () |
| Initiate a soft shutdown (REG 0x10 bit 0). | |
| void | resetSoC () |
| Trigger a system-on-chip reset (REG 0x10 bit 1). | |
| bool | enableSleep () |
| Enable sleep mode (REG 0x26 bit 0). | |
| bool | disableSleep () |
| Disable sleep mode (REG 0x26 bit 0). | |
| bool | enableWakeup () |
| Enable wakeup function (REG 0x26 bit 1). | |
| bool | disableWakeup () |
| Disable wakeup function (REG 0x26 bit 1). | |
| void | enablePwrOk () |
| Enable PWROK output (REG 0x25 bit 4). | |
| void | disablePwrOk () |
| Disable PWROK output (REG 0x25 bit 4). | |
| void | enablePowerOffDelay () |
| Enable power-off delay (REG 0x25 bit 3). | |
| void | disablePowerOffDelay () |
| Disable power-off delay (REG 0x25 bit 3). | |
| void | enablePowerSequence () |
| Enable power-on sequencing (REG 0x25 bit 2). | |
| void | disablePowerSequence () |
| Disable power-on sequencing (REG 0x25 bit 2). | |
| bool | setPwrOkDelay (uint8_t opt) |
| Set the PWROK delay time (REG 0x25 bits 1:0). | |
| uint8_t | getPwrOkDelay () |
| Get the PWROK delay time (REG 0x25 bits 1:0). | |
| void | enableOverTempShutdown () |
| Enable automatic shutdown on over-temperature (REG 0x22 bit 2). | |
| void | disableOverTempShutdown () |
| Disable automatic shutdown on over-temperature (REG 0x22 bit 2). | |
| void | enableLongPressShutdown () |
| Enable long-press power-off (REG 0x22 bit 1). | |
| void | disableLongPressShutdown () |
| Disable long-press power-off (REG 0x22 bit 1). | |
| void | setLongPressAction (bool restart) |
| Set the long-press power key action (REG 0x22 bit 0). | |
| void | setDCOverVoltageProtection (bool enable) |
| Enable or disable DC over-voltage protection (REG 0x23 bit 5). | |
| bool | isDCOverVoltageProtectionEnabled () |
| Check if DC over-voltage protection is enabled (REG 0x23 bit 5). | |
| void | setDCLowVoltageProtection (uint8_t dc_id, bool enable) |
| Enable or disable under-voltage protection for a DCDC (REG 0x23 bits 0-4). | |
| bool | isDCLowVoltageProtectionEnabled (uint8_t dc_id) |
| Check if under-voltage protection is enabled for a DCDC (REG 0x23 bits 0-4). | |
| uint8_t | getPowerOnStatus () |
| Read the power-on source status register (REG 0x20, read-only). | |
| uint8_t | getPowerOffStatus () |
| Read the power-off source status register (REG 0x21, read-only). | |
| bool | writeGaugeData (uint8_t *data, uint8_t len) |
| Write user data to the fuel-gauge backup registers. | |
| bool | compareGaugeData (uint8_t *data, uint8_t len) |
| Compare data against the fuel-gauge backup registers. | |
| void | setLowBatWarnThreshold (uint8_t percentage) |
| Set the low-battery warning threshold (REG 0x1A bits 7:4). | |
| uint8_t | getLowBatWarnThreshold () |
| Get the low-battery warning threshold (REG 0x1A bits 7:4). | |
| void | setLowBatShutdownThreshold (uint8_t percentage) |
| Set the low-battery shutdown threshold (REG 0x1A bits 3:0). | |
| uint8_t | getLowBatShutdownThreshold () |
| Get the low-battery shutdown threshold (REG 0x1A bits 3:0). | |
| bool | enableDieTempDetection (bool enable) |
| Enable or disable die temperature detection. | |
| bool | isDieTempDetectionEnabled () |
| Check if die temperature detection is enabled. | |
| bool | setDieTempLevel1Threshold (uint8_t opt) |
| Set die over-temperature Level1 threshold (REG 13 bits 2:1). | |
| uint8_t | getDieTempLevel1Threshold () |
| Get die over-temperature Level1 threshold (REG 13 bits 2:1). | |
| bool | setDCDCForcePWM (uint8_t dc_id, bool force) |
| Force a DCDC converter to always-PWM mode (REG 81 bits 2-5). | |
| bool | isDCDCForcePWM (uint8_t dc_id) |
| Check if a DCDC converter is in forced-PWM mode (REG 81 bits 2-5). | |
| bool | setDCDCForceCCM (bool enable) |
| Force all DCDC1-4 to CCM (continuous conduction mode) (REG 80 bit 6). | |
| bool | isDCDCForceCCM () |
| Check if all DCDC1-4 are in forced CCM mode (REG 80 bit 6). | |
| bool | setDVMRampSlow (bool slow) |
| Set DVM voltage ramp rate (REG 80 bit 5). | |
| bool | isDVMRampSlow () |
| Check if DVM ramp is set to slow (REG 80 bit 5). | |
| bool | setFrequencySpreadEnable (bool enable) |
| Enable DCDC frequency spread spectrum (REG 81 bit 7). | |
| bool | isFrequencySpreadEnabled () |
| Check if frequency spread spectrum is enabled (REG 81 bit 7). | |
| bool | setFrequencySpreadRange (bool wide) |
| Set frequency spread range (REG 81 bit 6). | |
| bool | getFrequencySpreadRange () |
| Get the frequency spread range (REG 81 bit 6). | |
| bool | setDCDCUVPDebounce (uint8_t opt) |
| Set DCDC UVP debounce time (REG 81 bits 1:0). | |
| uint8_t | getDCDCUVPDebounce () |
| Get DCDC UVP debounce time (REG 81 bits 1:0). | |
| bool | enableFastPowerOn (bool enable) |
| Enable fast power-on sequence (REG 2B bit 7). | |
| bool | isFastPowerOnEnabled () |
| Check if fast power-on sequence is enabled (REG 2B bit 7). | |
| bool | enableFastWakeup (bool enable) |
| Enable fast wakeup (REG 2B bit 6). | |
| bool | isFastWakeupEnabled () |
| Check if fast wakeup is enabled (REG 2B bit 6). | |
| bool | setFastPowerOnSequence (uint8_t channel, uint8_t seq) |
| Set fast power-on start sequence for a channel (REG 28-2B). | |
| uint8_t | getFastPowerOnSequence (uint8_t channel) |
| Get fast power-on start sequence for a channel (REG 28-2B). | |
Public Member Functions inherited from PmicPowerBase | |
| virtual bool | enableBoost (bool enable) |
| Enable boost functionality. | |
| virtual bool | isBoostEnabled () const |
| Check if boost functionality is enabled. | |
| virtual bool | setBoostVoltage (uint16_t mv) |
| Set the boost voltage. | |
| virtual uint16_t | getBoostVoltage () const |
| Get the boost voltage. | |
| virtual | ~PmicPowerBase ()=default |
| Virtual destructor. | |
Static Public Attributes | |
| static constexpr uint8_t | DCDC1 = 0 |
| static constexpr uint8_t | DCDC2 = 1 |
| static constexpr uint8_t | DCDC3 = 2 |
| static constexpr uint8_t | DCDC4 = 3 |
| static constexpr uint8_t | DCDC5 = 4 |
Definition at line 35 of file AXP2101Power.hpp.
|
explicit |
Construct an AXP2101Power instance.
| core | Reference to the AXP2101Core bus driver. |
Definition at line 39 of file AXP2101Power.cpp.
|
default |
| bool AXP2101Power::compareGaugeData | ( | uint8_t * | data, |
| uint8_t | len | ||
| ) |
Compare data against the fuel-gauge backup registers.
| data | Pointer to the expected data buffer. |
| len | Number of bytes to compare. |
Definition at line 322 of file AXP2101Power.cpp.
References axp2101_regs::gauge::BAT_PARAMS, SensorCommWrapper::clrRegBit(), axp2101_regs::gauge::FUEL_GAUGE_CTRL, i, SensorCommWrapper::readReg(), axp2101_regs::ctrl::RESET_FUEL_GAUGE, and SensorCommWrapper::setRegBit().
Referenced by writeGaugeData().
| void AXP2101Power::disableInternalDischarge | ( | ) |
Disable internal battery discharge resistor (REG 0x10 bit 5).
Definition at line 140 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), and axp2101_regs::ctrl::COMMON_CFG.
| void AXP2101Power::disableLongPressShutdown | ( | ) |
Disable long-press power-off (REG 0x22 bit 1).
Definition at line 245 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), and axp2101_regs::pmu::PWROFF_EN.
| void AXP2101Power::disableOverTempShutdown | ( | ) |
Disable automatic shutdown on over-temperature (REG 0x22 bit 2).
Definition at line 235 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), and axp2101_regs::pmu::PWROFF_EN.
| void AXP2101Power::disablePowerOffDelay | ( | ) |
Disable power-off delay (REG 0x25 bit 3).
Definition at line 196 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), and axp2101_regs::pmu::PWROK_SEQU_CTRL.
| void AXP2101Power::disablePowerSequence | ( | ) |
Disable power-on sequencing (REG 0x25 bit 2).
Definition at line 206 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), and axp2101_regs::pmu::PWROK_SEQU_CTRL.
| void AXP2101Power::disablePwrOk | ( | ) |
Disable PWROK output (REG 0x25 bit 4).
Definition at line 186 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), and axp2101_regs::pmu::PWROK_SEQU_CTRL.
| bool AXP2101Power::disableSleep | ( | ) |
Disable sleep mode (REG 0x26 bit 0).
Definition at line 164 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), and axp2101_regs::pmu::SLEEP_WAKEUP_CTRL.
| bool AXP2101Power::disableWakeup | ( | ) |
Disable wakeup function (REG 0x26 bit 1).
Definition at line 174 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), and axp2101_regs::pmu::SLEEP_WAKEUP_CTRL.
| bool AXP2101Power::enableDieTempDetection | ( | bool | enable | ) |
Enable or disable die temperature detection.
| enable | true to enable (default), false to disable. |
Definition at line 377 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::ctrl::DIE_TEMP_CFG, and SensorCommWrapper::setRegBit().
| bool AXP2101Power::enableFastPowerOn | ( | bool | enable | ) |
Enable fast power-on sequence (REG 2B bit 7).
| enable | true to enable, false to disable (default). |
Definition at line 480 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::pmu::FAST_PWRON_CTRL, and SensorCommWrapper::setRegBit().
| bool AXP2101Power::enableFastWakeup | ( | bool | enable | ) |
Enable fast wakeup (REG 2B bit 6).
| enable | true to enable, false to disable (default). |
Definition at line 491 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::pmu::FAST_PWRON_CTRL, and SensorCommWrapper::setRegBit().
| void AXP2101Power::enableInternalDischarge | ( | ) |
Enable internal battery discharge resistor (REG 0x10 bit 5).
Definition at line 135 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::COMMON_CFG, and SensorCommWrapper::setRegBit().
| void AXP2101Power::enableLongPressShutdown | ( | ) |
Enable long-press power-off (REG 0x22 bit 1).
Definition at line 240 of file AXP2101Power.cpp.
References axp2101_regs::pmu::PWROFF_EN, and SensorCommWrapper::setRegBit().
| void AXP2101Power::enableOverTempShutdown | ( | ) |
Enable automatic shutdown on over-temperature (REG 0x22 bit 2).
Definition at line 230 of file AXP2101Power.cpp.
References axp2101_regs::pmu::PWROFF_EN, and SensorCommWrapper::setRegBit().
| void AXP2101Power::enablePowerOffDelay | ( | ) |
Enable power-off delay (REG 0x25 bit 3).
Definition at line 191 of file AXP2101Power.cpp.
References axp2101_regs::pmu::PWROK_SEQU_CTRL, and SensorCommWrapper::setRegBit().
| void AXP2101Power::enablePowerSequence | ( | ) |
Enable power-on sequencing (REG 0x25 bit 2).
Definition at line 201 of file AXP2101Power.cpp.
References axp2101_regs::pmu::PWROK_SEQU_CTRL, and SensorCommWrapper::setRegBit().
| void AXP2101Power::enablePwrOk | ( | ) |
Enable PWROK output (REG 0x25 bit 4).
Definition at line 181 of file AXP2101Power.cpp.
References axp2101_regs::pmu::PWROK_SEQU_CTRL, and SensorCommWrapper::setRegBit().
|
overridevirtual |
Enable or disable ship mode (REG 0x12 bit 3).
When ship mode is enabled the BATFET is opened, disconnecting the battery from the system for ultra-low-power storage.
| enable | true to enter ship mode (BATFET off), false for normal operation. |
Reimplemented from PmicPowerBase.
Definition at line 100 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::BATFET_CTRL, SensorCommWrapper::clrRegBit(), and SensorCommWrapper::setRegBit().
| bool AXP2101Power::enableSleep | ( | ) |
Enable sleep mode (REG 0x26 bit 0).
Definition at line 159 of file AXP2101Power.cpp.
References SensorCommWrapper::setRegBit(), and axp2101_regs::pmu::SLEEP_WAKEUP_CTRL.
| bool AXP2101Power::enableWakeup | ( | ) |
Enable wakeup function (REG 0x26 bit 1).
Definition at line 169 of file AXP2101Power.cpp.
References SensorCommWrapper::setRegBit(), and axp2101_regs::pmu::SLEEP_WAKEUP_CTRL.
| uint8_t AXP2101Power::getDCDCUVPDebounce | ( | ) |
Get DCDC UVP debounce time (REG 81 bits 1:0).
Definition at line 471 of file AXP2101Power.cpp.
References axp2101_regs::dcdc::FORCE_PWM_CTRL, and SensorCommWrapper::readReg().
| uint8_t AXP2101Power::getDieTempLevel1Threshold | ( | ) |
Get die over-temperature Level1 threshold (REG 13 bits 2:1).
Definition at line 398 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::DIE_TEMP_CFG, and SensorCommWrapper::readReg().
| uint8_t AXP2101Power::getFastPowerOnSequence | ( | uint8_t | channel | ) |
Get fast power-on start sequence for a channel (REG 28-2B).
| channel | Channel index (0-13 for DCDC1-DLDO2). |
Definition at line 537 of file AXP2101Power.cpp.
References axp2101_regs::pmu::FAST_PWRON_CTRL, axp2101_regs::pmu::FAST_PWRON_SET0, axp2101_regs::pmu::FAST_PWRON_SET1, axp2101_regs::pmu::FAST_PWRON_SET2, and SensorCommWrapper::readReg().
| bool AXP2101Power::getFrequencySpreadRange | ( | ) |
Get the frequency spread range (REG 81 bit 6).
Definition at line 460 of file AXP2101Power.cpp.
References axp2101_regs::dcdc::FORCE_PWM_CTRL, and SensorCommWrapper::getRegBit().
|
overridevirtual |
Get the VBUS input current limit (REG 0x16 bits 2:0).
Implements PmicPowerBase.
Definition at line 90 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::INPUT_CURR_LIMIT, and SensorCommWrapper::readReg().
|
overridevirtual |
Get the VBUS input voltage limit (REG 0x15 bits 3:0).
Implements PmicPowerBase.
Definition at line 67 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::INPUT_VOLT_LIMIT, and SensorCommWrapper::readReg().
| uint8_t AXP2101Power::getLowBatShutdownThreshold | ( | ) |
Get the low-battery shutdown threshold (REG 0x1A bits 3:0).
Definition at line 368 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::LOW_BAT_WARN_SET, and SensorCommWrapper::readReg().
| uint8_t AXP2101Power::getLowBatWarnThreshold | ( | ) |
Get the low-battery warning threshold (REG 0x1A bits 7:4).
Definition at line 351 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::LOW_BAT_WARN_SET, and SensorCommWrapper::readReg().
|
overridevirtual |
Get the minimum VSYS system voltage (REG 0x14 bits 6:4).
Implements PmicPowerBase.
Definition at line 52 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::MIN_SYS_VOLTAGE, and SensorCommWrapper::readReg().
| uint8_t AXP2101Power::getPowerOffStatus | ( | ) |
Read the power-off source status register (REG 0x21, read-only).
Definition at line 299 of file AXP2101Power.cpp.
References axp2101_regs::pmu::PWROFF_STATUS, and SensorCommWrapper::readReg().
| uint8_t AXP2101Power::getPowerOnStatus | ( | ) |
Read the power-on source status register (REG 0x20, read-only).
Definition at line 293 of file AXP2101Power.cpp.
References axp2101_regs::pmu::PWRON_STATUS, and SensorCommWrapper::readReg().
| uint8_t AXP2101Power::getPwrOkDelay | ( | ) |
Get the PWROK delay time (REG 0x25 bits 1:0).
Definition at line 221 of file AXP2101Power.cpp.
References axp2101_regs::pmu::PWROK_SEQU_CTRL, and SensorCommWrapper::readReg().
| uint16_t AXP2101Power::getSysPowerDownVoltage | ( | ) |
Get the VSYS power-off voltage threshold (REG 0x24 bits 2:0).
Definition at line 126 of file AXP2101Power.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::pmu::VOFF_SET.
| bool AXP2101Power::isDCDCForceCCM | ( | ) |
Check if all DCDC1-4 are in forced CCM mode (REG 80 bit 6).
Definition at line 427 of file AXP2101Power.cpp.
References SensorCommWrapper::getRegBit(), and axp2101_regs::dcdc::ONOFF_DVM_CTRL.
| bool AXP2101Power::isDCDCForcePWM | ( | uint8_t | dc_id | ) |
Check if a DCDC converter is in forced-PWM mode (REG 81 bits 2-5).
| dc_id | DCDC index (1-4 for DCDC1-DCDC4). DCDC5 has no PWM control. |
Definition at line 415 of file AXP2101Power.cpp.
References axp2101_regs::dcdc::FORCE_PWM_CTRL, and SensorCommWrapper::getRegBit().
| bool AXP2101Power::isDCLowVoltageProtectionEnabled | ( | uint8_t | dc_id | ) |
Check if under-voltage protection is enabled for a DCDC (REG 0x23 bits 0-4).
| dc_id | DCDC index (0-4 for DCDC1-DCDC5). |
Definition at line 285 of file AXP2101Power.cpp.
References axp2101_regs::pmu::DC_OVP_UVP_CTRL, and SensorCommWrapper::getRegBit().
| bool AXP2101Power::isDCOverVoltageProtectionEnabled | ( | ) |
Check if DC over-voltage protection is enabled (REG 0x23 bit 5).
Definition at line 270 of file AXP2101Power.cpp.
References axp2101_regs::pmu::DC_OVP_UVP_CTRL, and SensorCommWrapper::getRegBit().
| bool AXP2101Power::isDieTempDetectionEnabled | ( | ) |
Check if die temperature detection is enabled.
Definition at line 383 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::DIE_TEMP_CFG, and SensorCommWrapper::getRegBit().
| bool AXP2101Power::isDVMRampSlow | ( | ) |
Check if DVM ramp is set to slow (REG 80 bit 5).
Definition at line 438 of file AXP2101Power.cpp.
References SensorCommWrapper::getRegBit(), and axp2101_regs::dcdc::ONOFF_DVM_CTRL.
| bool AXP2101Power::isFastPowerOnEnabled | ( | ) |
Check if fast power-on sequence is enabled (REG 2B bit 7).
Definition at line 486 of file AXP2101Power.cpp.
References axp2101_regs::pmu::FAST_PWRON_CTRL, and SensorCommWrapper::getRegBit().
| bool AXP2101Power::isFastWakeupEnabled | ( | ) |
Check if fast wakeup is enabled (REG 2B bit 6).
Definition at line 497 of file AXP2101Power.cpp.
References axp2101_regs::pmu::FAST_PWRON_CTRL, and SensorCommWrapper::getRegBit().
| bool AXP2101Power::isFrequencySpreadEnabled | ( | ) |
Check if frequency spread spectrum is enabled (REG 81 bit 7).
Definition at line 449 of file AXP2101Power.cpp.
References axp2101_regs::dcdc::FORCE_PWM_CTRL, and SensorCommWrapper::getRegBit().
|
overridevirtual |
Check whether ship mode is currently active (REG 0x12 bit 3).
Reimplemented from PmicPowerBase.
Definition at line 108 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::BATFET_CTRL, and SensorCommWrapper::getRegBit().
| void AXP2101Power::resetSoC | ( | ) |
Trigger a system-on-chip reset (REG 0x10 bit 1).
Definition at line 152 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::COMMON_CFG, and SensorCommWrapper::setRegBit().
Referenced by PmicAXP2101::reset().
| bool AXP2101Power::setDCDCForceCCM | ( | bool | enable | ) |
Force all DCDC1-4 to CCM (continuous conduction mode) (REG 80 bit 6).
| enable | true to force CCM, false for auto. |
Definition at line 421 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::dcdc::ONOFF_DVM_CTRL, and SensorCommWrapper::setRegBit().
| bool AXP2101Power::setDCDCForcePWM | ( | uint8_t | dc_id, |
| bool | force | ||
| ) |
Force a DCDC converter to always-PWM mode (REG 81 bits 2-5).
| dc_id | DCDC index (1-4 for DCDC1-DCDC4). DCDC5 has no PWM control. |
| force | true for always-PWM, false for auto PWM/PFM. |
Definition at line 407 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::dcdc::FORCE_PWM_CTRL, and SensorCommWrapper::setRegBit().
| bool AXP2101Power::setDCDCUVPDebounce | ( | uint8_t | opt | ) |
Set DCDC UVP debounce time (REG 81 bits 1:0).
| opt | 0=60us, 1=120us, 2=180us, 3=240us. |
Definition at line 465 of file AXP2101Power.cpp.
References axp2101_regs::dcdc::FORCE_PWM_CTRL, and SensorCommWrapper::updateBits().
| void AXP2101Power::setDCLowVoltageProtection | ( | uint8_t | dc_id, |
| bool | enable | ||
| ) |
Enable or disable under-voltage protection for a DCDC (REG 0x23 bits 0-4).
| dc_id | DCDC index (0-4 for DCDC1-DCDC5). |
| enable | true to enable, false to disable. |
Definition at line 275 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::pmu::DC_OVP_UVP_CTRL, and SensorCommWrapper::setRegBit().
| void AXP2101Power::setDCOverVoltageProtection | ( | bool | enable | ) |
Enable or disable DC over-voltage protection (REG 0x23 bit 5).
| enable | true to enable, false to disable. |
Definition at line 261 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::pmu::DC_OVP_UVP_CTRL, and SensorCommWrapper::setRegBit().
| bool AXP2101Power::setDieTempLevel1Threshold | ( | uint8_t | opt | ) |
Set die over-temperature Level1 threshold (REG 13 bits 2:1).
| opt | 0=115°C, 1=125°C (default), 2=135°C. 3=reserved. |
Definition at line 388 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::DIE_TEMP_CFG, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
| bool AXP2101Power::setDVMRampSlow | ( | bool | slow | ) |
Set DVM voltage ramp rate (REG 80 bit 5).
| slow | true for 31.250us/step, false for 15.625us/step (default). |
Definition at line 432 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::dcdc::ONOFF_DVM_CTRL, and SensorCommWrapper::setRegBit().
| bool AXP2101Power::setFastPowerOnSequence | ( | uint8_t | channel, |
| uint8_t | seq | ||
| ) |
Set fast power-on start sequence for a channel (REG 28-2B).
| channel | Channel index (0-13 for DCDC1-DLDO2). Use AXP2101Channel::CH_xxx constants. |
| seq | Sequence level (0-2 for start order, 3=disable). |
Definition at line 502 of file AXP2101Power.cpp.
References axp2101_regs::pmu::FAST_PWRON_CTRL, axp2101_regs::pmu::FAST_PWRON_SET0, axp2101_regs::pmu::FAST_PWRON_SET1, axp2101_regs::pmu::FAST_PWRON_SET2, and SensorCommWrapper::updateBits().
| bool AXP2101Power::setFrequencySpreadEnable | ( | bool | enable | ) |
Enable DCDC frequency spread spectrum (REG 81 bit 7).
| enable | true to enable, false to disable (default). |
Definition at line 443 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::dcdc::FORCE_PWM_CTRL, and SensorCommWrapper::setRegBit().
| bool AXP2101Power::setFrequencySpreadRange | ( | bool | wide | ) |
Set frequency spread range (REG 81 bit 6).
| wide | true for 100kHz, false for 50kHz (default). |
Definition at line 454 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::dcdc::FORCE_PWM_CTRL, and SensorCommWrapper::setRegBit().
|
overridevirtual |
Set the VBUS input current limit (REG 0x16 bits 2:0).
| mA | Current in milliamps. Valid values: 100, 500, 900, 1000, 1500, 2000. |
Implements PmicPowerBase.
Definition at line 74 of file AXP2101Power.cpp.
References i, axp2101_regs::ctrl::INPUT_CURR_LIMIT, and SensorCommWrapper::updateBits().
|
overridevirtual |
Set the VBUS input voltage limit (REG 0x15 bits 3:0).
| mv | Voltage in millivolts (3880-5080, 80mV steps). |
Implements PmicPowerBase.
Definition at line 59 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::INPUT_VOLT_LIMIT, and SensorCommWrapper::updateBits().
| void AXP2101Power::setLongPressAction | ( | bool | restart | ) |
Set the long-press power key action (REG 0x22 bit 0).
| restart | true for restart on long press, false for shutdown. |
Definition at line 250 of file AXP2101Power.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::pmu::PWROFF_EN, and SensorCommWrapper::setRegBit().
| void AXP2101Power::setLowBatShutdownThreshold | ( | uint8_t | percentage | ) |
Set the low-battery shutdown threshold (REG 0x1A bits 3:0).
| percentage | Shutdown level (0-15%). |
Definition at line 358 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::LOW_BAT_WARN_SET, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
| void AXP2101Power::setLowBatWarnThreshold | ( | uint8_t | percentage | ) |
Set the low-battery warning threshold (REG 0x1A bits 7:4).
| percentage | Warning level (5-20%). |
Definition at line 341 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::LOW_BAT_WARN_SET, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
|
overridevirtual |
Set the minimum VSYS system voltage (REG 0x14 bits 6:4).
| mv | Voltage in millivolts (4100-4800, 100mV steps). |
Implements PmicPowerBase.
Definition at line 45 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::MIN_SYS_VOLTAGE, and SensorCommWrapper::updateBits().
| bool AXP2101Power::setPwrOkDelay | ( | uint8_t | opt | ) |
Set the PWROK delay time (REG 0x25 bits 1:0).
| opt | 0=8ms, 1=16ms, 2=32ms, 3=64ms. |
Definition at line 211 of file AXP2101Power.cpp.
References axp2101_regs::pmu::PWROK_SEQU_CTRL, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
| bool AXP2101Power::setSysPowerDownVoltage | ( | uint16_t | millivolt | ) |
Set the VSYS power-off voltage threshold (REG 0x24 bits 2:0).
| millivolt | Threshold in millivolts (2600-3300, 100mV steps). |
Definition at line 115 of file AXP2101Power.cpp.
References SensorCommWrapper::readReg(), axp2101_regs::pmu::VOFF_SET, and SensorCommWrapper::writeReg().
| void AXP2101Power::softShutdown | ( | ) |
Initiate a soft shutdown (REG 0x10 bit 0).
Definition at line 147 of file AXP2101Power.cpp.
References axp2101_regs::ctrl::COMMON_CFG, and SensorCommWrapper::setRegBit().
Referenced by PmicAXP2101::shutdown().
| bool AXP2101Power::writeGaugeData | ( | uint8_t * | data, |
| uint8_t | len | ||
| ) |
Write user data to the fuel-gauge backup registers.
| data | Pointer to the data buffer to write. |
| len | Number of bytes to write. |
Definition at line 307 of file AXP2101Power.cpp.
References axp2101_regs::gauge::BAT_PARAMS, SensorCommWrapper::clrRegBit(), compareGaugeData(), axp2101_regs::gauge::FUEL_GAUGE_CTRL, i, axp2101_regs::ctrl::RESET_FUEL_GAUGE, SensorCommWrapper::setRegBit(), and SensorCommWrapper::writeReg().
|
staticconstexpr |
Definition at line 39 of file AXP2101Power.hpp.
|
staticconstexpr |
Definition at line 40 of file AXP2101Power.hpp.
|
staticconstexpr |
Definition at line 41 of file AXP2101Power.hpp.
|
staticconstexpr |
Definition at line 42 of file AXP2101Power.hpp.
|
staticconstexpr |
Definition at line 43 of file AXP2101Power.hpp.