|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <AXP2101Charger.hpp>
Public Member Functions | |
| AXP2101Charger (AXP2101Core &core) | |
| Construct AXP2101Charger with a reference to the AXP2101Core. | |
| ~AXP2101Charger ()=default | |
| bool | enableCharging (bool enable) override |
| Enable or disable battery charging. | |
| bool | isCharging () override |
| Check if the charger is actively charging. | |
| bool | setPreChargeCurrent (uint16_t mA) override |
| Set the precharge current limit (REG 0x61, bits 3:0). | |
| uint16_t | getPreChargeCurrent () override |
| Get the configured precharge current (REG 0x61, bits 3:0). | |
| bool | setFastChargeCurrent (uint16_t mA) override |
| Set the fast-charge current limit (REG 0x62, bits 4:0). | |
| uint16_t | getFastChargeCurrent () override |
| Get the configured fast-charge current (REG 0x62, bits 4:0). | |
| bool | setTerminationCurrent (uint16_t mA) override |
| Set the charge termination current (REG 0x63, bits 3:0). | |
| uint16_t | getTerminationCurrent () override |
| Get the configured termination current (REG 0x63, bits 3:0). | |
| bool | setChargeVoltage (uint16_t mV) override |
| Set the charge voltage target (REG 0x64, bits 2:0). | |
| uint16_t | getChargeVoltage () override |
| Get the configured charge voltage target (REG 0x64, bits 2:0). | |
| Status | getStatus () override |
| Get the current charger status. | |
| void | enableChargeTermination () |
| Enable charge termination detection (REG 0x63, bit 4). | |
| void | disableChargeTermination () |
| Disable charge termination detection (REG 0x63, bit 4). | |
| bool | isChargeTerminationEnabled () |
| Check if charge termination detection is enabled (REG 0x63, bit 4). | |
| void | enableButtonBatteryCharge () |
| Enable button/coin-cell battery charging (REG 0x18, bit 2). | |
| void | disableButtonBatteryCharge () |
| Disable button/coin-cell battery charging (REG 0x18, bit 2). | |
| bool | isButtonBatteryChargeEnabled () |
| Check if button battery charging is enabled (REG 0x18, bit 2). | |
| bool | setButtonBatteryChargeVoltage (uint16_t millivolt) |
| Set the button battery charge voltage (REG 0x6A, bits 2:0). | |
| uint16_t | getButtonBatteryChargeVoltage () |
| Get the configured button battery charge voltage (REG 0x6A, bits 2:0). | |
| void | enableBatteryDetection () |
| Enable battery detection (REG 0x68, bit 0). | |
| void | disableBatteryDetection () |
| Disable battery detection (REG 0x68, bit 0). | |
| bool | isBatteryDetectionEnabled () |
| Check if battery detection is enabled (REG 0x68, bit 0). | |
| void | setPreChargeSafetyTimer (uint8_t opt) |
| Set the precharge safety timer (REG 0x67, bits 2:0). | |
| void | setChargeDoneSafetyTimer (uint8_t opt) |
| Set the charge-done safety timer (REG 0x67, bits 6:4). | |
| void | setThermalRegulationThreshold (uint8_t opt) |
| Set the thermal regulation threshold (REG 0x65, bits 1:0). | |
| uint8_t | getThermalRegulationThreshold () |
| Get the thermal regulation threshold (REG 0x65, bits 1:0). | |
| bool | enableJeita (bool enable) |
| Enable or disable JEITA temperature standard. | |
| bool | isJeitaEnabled () |
| Check if JEITA temperature standard is enabled. | |
| bool | setChargeLowTempFaultThreshold (uint8_t val) |
| Set charge low-temperature fault threshold (REG 54, VLTF_CHG). | |
| uint8_t | getChargeLowTempFaultThreshold () |
| Get charge low-temperature fault threshold (REG 54, VLTF_CHG). | |
| bool | setChargeHighTempFaultThreshold (uint8_t val) |
| Set charge high-temperature fault threshold (REG 55, VHTF_CHG). | |
| uint8_t | getChargeHighTempFaultThreshold () |
| Get charge high-temperature fault threshold (REG 55, VHTF_CHG). | |
| bool | setWorkLowTempFaultThreshold (uint8_t val) |
| Set work low-temperature fault threshold (REG 56, VLTF_WORK). | |
| uint8_t | getWorkLowTempFaultThreshold () |
| Get work low-temperature fault threshold (REG 56, VLTF_WORK). | |
| bool | setWorkHighTempFaultThreshold (uint8_t val) |
| Set work high-temperature fault threshold (REG 57, VHTF_WORK). | |
| uint8_t | getWorkHighTempFaultThreshold () |
| Get work high-temperature fault threshold (REG 57, VHTF_WORK). | |
| bool | setLowTempHysteresis (uint8_t val) |
| Set low-temperature hysteresis (REG 52, HYSL2H). | |
| uint8_t | getLowTempHysteresis () |
| Get low-temperature hysteresis (REG 52, HYSL2H). | |
| bool | setHighTempHysteresis (uint8_t val) |
| Set high-temperature hysteresis (REG 53, HYSH2L). | |
| uint8_t | getHighTempHysteresis () |
| Get high-temperature hysteresis (REG 53, HYSH2L). | |
| bool | setJeitaWarmCurrentReduction (bool reduce) |
| Set warm-zone current reduction in JEITA. | |
| bool | getJeitaWarmCurrentReduction () |
| Get warm-zone current reduction setting in JEITA (REG 0x59). | |
| bool | setJeitaCoolCurrentReduction (bool reduce) |
| Set cool-zone current reduction in JEITA. | |
| bool | getJeitaCoolCurrentReduction () |
| Get cool-zone current reduction setting in JEITA (REG 0x59). | |
| bool | setJeitaWarmVoltageDrop (uint8_t levels) |
| Set warm-zone voltage drop levels in JEITA. | |
| uint8_t | getJeitaWarmVoltageDrop () |
| Get warm-zone voltage drop levels in JEITA (REG 0x59). | |
| bool | setJeitaCoolVoltageDrop (uint8_t levels) |
| Set cool-zone voltage drop levels in JEITA. | |
| uint8_t | getJeitaCoolVoltageDrop () |
| Get cool-zone voltage drop levels in JEITA (REG 0x59). | |
| bool | setJeitaCoolThreshold (uint8_t val) |
| Set JEITA cool temperature threshold T2 (REG 5B low nibble). | |
| uint8_t | getJeitaCoolThreshold () |
| Get JEITA cool temperature threshold T2 (REG 5B low nibble). | |
| bool | setJeitaWarmThreshold (uint8_t val) |
| Set JEITA warm temperature threshold T3 (REG 5B high nibble). | |
| uint8_t | getJeitaWarmThreshold () |
| Get JEITA warm temperature threshold T3 (REG 5B high nibble). | |
Public Member Functions inherited from PmicChargerBase | |
| virtual | ~PmicChargerBase ()=default |
| Virtual destructor. | |
Additional Inherited Members | |
Public Types inherited from PmicChargerBase | |
| enum class | ChargingStatus : uint8_t { NO_CHARGING = 0 , PRE_CHARGE = 1 , FAST_CHARGE = 2 , TERMINATION = 3 , UNKNOWN = 0xFF } |
| Charging status enumeration. More... | |
Definition at line 35 of file AXP2101Charger.hpp.
|
explicit |
Construct AXP2101Charger with a reference to the AXP2101Core.
| core | Reference to the AXP2101Core providing register access. |
Definition at line 38 of file AXP2101Charger.cpp.
|
default |
| void AXP2101Charger::disableBatteryDetection | ( | ) |
Disable battery detection (REG 0x68, bit 0).
Definition at line 243 of file AXP2101Charger.cpp.
References axp2101_regs::chg::BAT_DETECT_CTRL, and SensorCommWrapper::clrRegBit().
| void AXP2101Charger::disableButtonBatteryCharge | ( | ) |
Disable button/coin-cell battery charging (REG 0x18, bit 2).
Definition at line 208 of file AXP2101Charger.cpp.
References SensorCommWrapper::clrRegBit(), and axp2101_regs::ctrl::MODULE_EN.
| void AXP2101Charger::disableChargeTermination | ( | ) |
Disable charge termination detection (REG 0x63, bit 4).
Charging will not automatically stop based on termination current.
Definition at line 187 of file AXP2101Charger.cpp.
References axp2101_regs::chg::ITERM_CTRL, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
| void AXP2101Charger::enableBatteryDetection | ( | ) |
Enable battery detection (REG 0x68, bit 0).
When enabled, the charger detects whether a battery is connected.
Definition at line 238 of file AXP2101Charger.cpp.
References axp2101_regs::chg::BAT_DETECT_CTRL, and SensorCommWrapper::setRegBit().
| void AXP2101Charger::enableButtonBatteryCharge | ( | ) |
Enable button/coin-cell battery charging (REG 0x18, bit 2).
Definition at line 203 of file AXP2101Charger.cpp.
References axp2101_regs::ctrl::MODULE_EN, and SensorCommWrapper::setRegBit().
| void AXP2101Charger::enableChargeTermination | ( | ) |
Enable charge termination detection (REG 0x63, bit 4).
When enabled, charging stops when current drops below the termination current threshold.
Definition at line 180 of file AXP2101Charger.cpp.
References axp2101_regs::chg::ITERM_CTRL, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
|
overridevirtual |
Enable or disable battery charging.
Controls the charge enable bit in REG 0x18.
| enable | true to enable charging, false to disable. |
Implements PmicChargerBase.
Definition at line 42 of file AXP2101Charger.cpp.
References AXP2101Core::CELL_CHARGE, and AXP2101Core::enableModule().
| bool AXP2101Charger::enableJeita | ( | bool | enable | ) |
Enable or disable JEITA temperature standard.
| enable | true to enable, false to disable. |
Definition at line 296 of file AXP2101Charger.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::jeita::EN_CTRL, and SensorCommWrapper::setRegBit().
| uint16_t AXP2101Charger::getButtonBatteryChargeVoltage | ( | ) |
Get the configured button battery charge voltage (REG 0x6A, bits 2:0).
Definition at line 229 of file AXP2101Charger.cpp.
References axp2101_regs::chg::BTN_BAT_CHG_VOL, and SensorCommWrapper::readReg().
| uint8_t AXP2101Charger::getChargeHighTempFaultThreshold | ( | ) |
Get charge high-temperature fault threshold (REG 55, VHTF_CHG).
Definition at line 325 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::jeita::VHTF_CHG.
| uint8_t AXP2101Charger::getChargeLowTempFaultThreshold | ( | ) |
Get charge low-temperature fault threshold (REG 54, VLTF_CHG).
Definition at line 314 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::jeita::VLTF_CHG.
|
overridevirtual |
Get the configured charge voltage target (REG 0x64, bits 2:0).
Implements PmicChargerBase.
Definition at line 130 of file AXP2101Charger.cpp.
References axp2101_regs::chg::CV_CHG_VOLTAGE, and SensorCommWrapper::readReg().
|
overridevirtual |
Get the configured fast-charge current (REG 0x62, bits 4:0).
For N <= 8: current = 25 * N mA. For N > 8: current = 200 + 100 * (N - 8) mA.
Implements PmicChargerBase.
Definition at line 84 of file AXP2101Charger.cpp.
References axp2101_regs::chg::ICC_SETTING, and SensorCommWrapper::readReg().
| uint8_t AXP2101Charger::getHighTempHysteresis | ( | ) |
Get high-temperature hysteresis (REG 53, HYSH2L).
Definition at line 371 of file AXP2101Charger.cpp.
References axp2101_regs::ts::HYSH2L, and SensorCommWrapper::readReg().
| bool AXP2101Charger::getJeitaCoolCurrentReduction | ( | ) |
Get cool-zone current reduction setting in JEITA (REG 0x59).
Definition at line 396 of file AXP2101Charger.cpp.
References SensorCommWrapper::getRegBit(), and axp2101_regs::jeita::SET0.
| uint8_t AXP2101Charger::getJeitaCoolThreshold | ( | ) |
Get JEITA cool temperature threshold T2 (REG 5B low nibble).
Definition at line 447 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::jeita::SET2.
| uint8_t AXP2101Charger::getJeitaCoolVoltageDrop | ( | ) |
Get cool-zone voltage drop levels in JEITA (REG 0x59).
Definition at line 428 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::jeita::SET0.
| bool AXP2101Charger::getJeitaWarmCurrentReduction | ( | ) |
Get warm-zone current reduction setting in JEITA (REG 0x59).
Definition at line 385 of file AXP2101Charger.cpp.
References SensorCommWrapper::getRegBit(), and axp2101_regs::jeita::SET0.
| uint8_t AXP2101Charger::getJeitaWarmThreshold | ( | ) |
Get JEITA warm temperature threshold T3 (REG 5B high nibble).
Definition at line 464 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::jeita::SET2.
| uint8_t AXP2101Charger::getJeitaWarmVoltageDrop | ( | ) |
Get warm-zone voltage drop levels in JEITA (REG 0x59).
Definition at line 411 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::jeita::SET0.
| uint8_t AXP2101Charger::getLowTempHysteresis | ( | ) |
Get low-temperature hysteresis (REG 52, HYSL2H).
Definition at line 360 of file AXP2101Charger.cpp.
References axp2101_regs::ts::HYSL2H, and SensorCommWrapper::readReg().
|
overridevirtual |
Get the configured precharge current (REG 0x61, bits 3:0).
Current = 25 * N mA.
Implements PmicChargerBase.
Definition at line 62 of file AXP2101Charger.cpp.
References axp2101_regs::chg::IPRECHG_SET, and SensorCommWrapper::readReg().
|
overridevirtual |
Get the current charger status.
Reads STATUS1 (REG 0x00) and STATUS2 (REG 0x01). STATUS1 bit 5 = VBUS present, bit 3 = battery present. STATUS2 bits 2:0 = charge phase (0=no charging, 1=precharge, 2/3=CC, 4=done, 5+=no charging).
Implements PmicChargerBase.
Definition at line 145 of file AXP2101Charger.cpp.
References PmicChargerBase::FAST_CHARGE, PmicChargerBase::NO_CHARGING, PmicChargerBase::PRE_CHARGE, SensorCommWrapper::readReg(), axp2101_regs::bmu::STATUS1, axp2101_regs::bmu::STATUS2, and PmicChargerBase::TERMINATION.
Referenced by isCharging().
|
overridevirtual |
Get the configured termination current (REG 0x63, bits 3:0).
Current = 25 * N mA.
Implements PmicChargerBase.
Definition at line 105 of file AXP2101Charger.cpp.
References axp2101_regs::chg::ITERM_CTRL, and SensorCommWrapper::readReg().
| uint8_t AXP2101Charger::getThermalRegulationThreshold | ( | ) |
Get the thermal regulation threshold (REG 0x65, bits 1:0).
Definition at line 287 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::chg::THERMAL_REG_THRESH.
| uint8_t AXP2101Charger::getWorkHighTempFaultThreshold | ( | ) |
Get work high-temperature fault threshold (REG 57, VHTF_WORK).
Definition at line 347 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::jeita::VHTF_WORK.
| uint8_t AXP2101Charger::getWorkLowTempFaultThreshold | ( | ) |
Get work low-temperature fault threshold (REG 56, VLTF_WORK).
Definition at line 336 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), and axp2101_regs::jeita::VLTF_WORK.
| bool AXP2101Charger::isBatteryDetectionEnabled | ( | ) |
Check if battery detection is enabled (REG 0x68, bit 0).
Definition at line 248 of file AXP2101Charger.cpp.
References axp2101_regs::chg::BAT_DETECT_CTRL, and SensorCommWrapper::getRegBit().
| bool AXP2101Charger::isButtonBatteryChargeEnabled | ( | ) |
Check if button battery charging is enabled (REG 0x18, bit 2).
Definition at line 213 of file AXP2101Charger.cpp.
References SensorCommWrapper::getRegBit(), and axp2101_regs::ctrl::MODULE_EN.
| bool AXP2101Charger::isChargeTerminationEnabled | ( | ) |
Check if charge termination detection is enabled (REG 0x63, bit 4).
Definition at line 194 of file AXP2101Charger.cpp.
References axp2101_regs::chg::ITERM_CTRL, and SensorCommWrapper::readReg().
|
overridevirtual |
Check if the charger is actively charging.
Reads STATUS2 (REG 0x01) bits 2:0 to determine charge phase.
Implements PmicChargerBase.
Definition at line 47 of file AXP2101Charger.cpp.
References PmicChargerBase::Status::charging, and getStatus().
Referenced by PmicAXP2101::isCharging().
| bool AXP2101Charger::isJeitaEnabled | ( | ) |
Check if JEITA temperature standard is enabled.
Definition at line 302 of file AXP2101Charger.cpp.
References axp2101_regs::jeita::EN_CTRL, and SensorCommWrapper::getRegBit().
| bool AXP2101Charger::setButtonBatteryChargeVoltage | ( | uint16_t | millivolt | ) |
Set the button battery charge voltage (REG 0x6A, bits 2:0).
Valid range: 2600-3300 mV in 100 mV steps.
| millivolt | Desired voltage in millivolts (2600-3300). |
Definition at line 218 of file AXP2101Charger.cpp.
References axp2101_regs::chg::BTN_BAT_CHG_VOL, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
| void AXP2101Charger::setChargeDoneSafetyTimer | ( | uint8_t | opt | ) |
Set the charge-done safety timer (REG 0x67, bits 6:4).
bit 6 = timer enable. bits 5:4 select timeout: 0=5h, 1=8h, 2=12h, 3=20h.
| opt | Timer option value (bits 6:4). Bit 6 enables, bits 5:4 select duration. |
Definition at line 265 of file AXP2101Charger.cpp.
References axp2101_regs::chg::CHG_TIMER_CFG, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setChargeHighTempFaultThreshold | ( | uint8_t | val | ) |
Set charge high-temperature fault threshold (REG 55, VHTF_CHG).
| val | Raw register value. VHTF = val * 2 mV. Default 0x58 (~45°C). |
Definition at line 320 of file AXP2101Charger.cpp.
References axp2101_regs::jeita::VHTF_CHG, and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setChargeLowTempFaultThreshold | ( | uint8_t | val | ) |
Set charge low-temperature fault threshold (REG 54, VLTF_CHG).
| val | Raw register value. VLTF = val * 32 mV. Default 0x29 (~0°C). |
Definition at line 309 of file AXP2101Charger.cpp.
References axp2101_regs::jeita::VLTF_CHG, and SensorCommWrapper::writeReg().
|
overridevirtual |
Set the charge voltage target (REG 0x64, bits 2:0).
Valid values: 0=5.0V, 1=4.0V, 2=4.1V, 3=4.2V, 4=4.35V, 5=4.4V.
| mV | Desired charge voltage in millivolts. |
Implements PmicChargerBase.
Definition at line 112 of file AXP2101Charger.cpp.
References axp2101_regs::chg::CV_CHG_VOLTAGE, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
|
overridevirtual |
Set the fast-charge current limit (REG 0x62, bits 4:0).
For N <= 8: current = 25 * N mA. For N > 8: current = 200 + 100 * (N - 8) mA. Maximum 1000 mA.
| mA | Desired fast-charge current in milliamps (0-1000). |
Implements PmicChargerBase.
Definition at line 69 of file AXP2101Charger.cpp.
References axp2101_regs::chg::ICC_SETTING, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setHighTempHysteresis | ( | uint8_t | val | ) |
Set high-temperature hysteresis (REG 53, HYSH2L).
| val | Raw register value. Hysteresis = val * 4 mV. Default 0x01 (4mV). |
Definition at line 366 of file AXP2101Charger.cpp.
References axp2101_regs::ts::HYSH2L, and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setJeitaCoolCurrentReduction | ( | bool | reduce | ) |
Set cool-zone current reduction in JEITA.
| reduce | true for 50%, false for 100%. Default true. |
Definition at line 390 of file AXP2101Charger.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::jeita::SET0, and SensorCommWrapper::setRegBit().
| bool AXP2101Charger::setJeitaCoolThreshold | ( | uint8_t | val | ) |
Set JEITA cool temperature threshold T2 (REG 5B low nibble).
| val | Raw register value. VHTF = val * 16 mV. Default 0x37 (~10°C). |
Definition at line 437 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), axp2101_regs::jeita::SET2, and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setJeitaCoolVoltageDrop | ( | uint8_t | levels | ) |
Set cool-zone voltage drop levels in JEITA.
| levels | 0=0mV, 1=1 level, 2=2 levels. Default 0. |
Definition at line 418 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), axp2101_regs::jeita::SET0, and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setJeitaWarmCurrentReduction | ( | bool | reduce | ) |
Set warm-zone current reduction in JEITA.
| reduce | true for 50%, false for 100%. Default false. |
Definition at line 379 of file AXP2101Charger.cpp.
References SensorCommWrapper::clrRegBit(), axp2101_regs::jeita::SET0, and SensorCommWrapper::setRegBit().
| bool AXP2101Charger::setJeitaWarmThreshold | ( | uint8_t | val | ) |
Set JEITA warm temperature threshold T3 (REG 5B high nibble).
| val | Raw register value. VHTF = val * 8 mV. Default 0x1E (~45°C). |
Definition at line 454 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), axp2101_regs::jeita::SET2, and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setJeitaWarmVoltageDrop | ( | uint8_t | levels | ) |
Set warm-zone voltage drop levels in JEITA.
| levels | 0=0mV, 1=1 level, 2=2 levels. Default 1. |
Definition at line 401 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), axp2101_regs::jeita::SET0, and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setLowTempHysteresis | ( | uint8_t | val | ) |
Set low-temperature hysteresis (REG 52, HYSL2H).
| val | Raw register value. Hysteresis = val * 16 mV. Default 0x02 (32mV). |
Definition at line 355 of file AXP2101Charger.cpp.
References axp2101_regs::ts::HYSL2H, and SensorCommWrapper::writeReg().
|
overridevirtual |
Set the precharge current limit (REG 0x61, bits 3:0).
Current = 25 * N mA, where N is clamped to 0-8 (0-200 mA).
| mA | Desired precharge current in milliamps (0-200). |
Implements PmicChargerBase.
Definition at line 52 of file AXP2101Charger.cpp.
References axp2101_regs::chg::IPRECHG_SET, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
| void AXP2101Charger::setPreChargeSafetyTimer | ( | uint8_t | opt | ) |
Set the precharge safety timer (REG 0x67, bits 2:0).
bit 2 = timer enable. bits 1:0 select timeout: 0=40min, 1=50min, 2=60min, 3=70min.
| opt | Timer option value (bits 2:0). Bit 2 enables, bits 1:0 select duration. |
Definition at line 255 of file AXP2101Charger.cpp.
References axp2101_regs::chg::CHG_TIMER_CFG, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
|
overridevirtual |
Set the charge termination current (REG 0x63, bits 3:0).
Current = 25 * N mA, where N is clamped to 0-8 (0-200 mA).
| mA | Desired termination current in milliamps (0-200). |
Implements PmicChargerBase.
Definition at line 95 of file AXP2101Charger.cpp.
References axp2101_regs::chg::ITERM_CTRL, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().
| void AXP2101Charger::setThermalRegulationThreshold | ( | uint8_t | opt | ) |
Set the thermal regulation threshold (REG 0x65, bits 1:0).
Valid values: 0=60°C, 1=80°C, 2=100°C, 3=120°C.
| opt | Threshold option (0-3). |
Definition at line 277 of file AXP2101Charger.cpp.
References SensorCommWrapper::readReg(), axp2101_regs::chg::THERMAL_REG_THRESH, and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setWorkHighTempFaultThreshold | ( | uint8_t | val | ) |
Set work high-temperature fault threshold (REG 57, VHTF_WORK).
| val | Raw register value. VHTF = val * 2 mV. Default 0x4C (~55°C). |
Definition at line 342 of file AXP2101Charger.cpp.
References axp2101_regs::jeita::VHTF_WORK, and SensorCommWrapper::writeReg().
| bool AXP2101Charger::setWorkLowTempFaultThreshold | ( | uint8_t | val | ) |
Set work low-temperature fault threshold (REG 56, VLTF_WORK).
| val | Raw register value. VLTF = val * 32 mV. Default 0x3E (~-10°C). |
Definition at line 331 of file AXP2101Charger.cpp.
References axp2101_regs::jeita::VLTF_WORK, and SensorCommWrapper::writeReg().