SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP202ChargerEx Class Reference

#include <AXP202ChargerEx.hpp>

Public Member Functions

 AXP202ChargerEx (AXP202Core &core)
 
bool setChargeLowTempThreshold (uint8_t val)
 Set charge low-temperature fault threshold (REG 38H)
 
uint8_t getChargeLowTempThreshold ()
 
bool setChargeHighTempThreshold (uint8_t val)
 Set charge high-temperature fault threshold (REG 39H)
 
uint8_t getChargeHighTempThreshold ()
 
bool setDischargeLowTempThreshold (uint8_t val)
 Set discharge low-temperature fault threshold (REG 3CH)
 
uint8_t getDischargeLowTempThreshold ()
 
bool setDischargeHighTempThreshold (uint8_t val)
 Set discharge high-temperature fault threshold (REG 3DH)
 
uint8_t getDischargeHighTempThreshold ()
 
bool enableBackupCharger (bool enable)
 Enable backup battery charger (REG 35H bit 7)
 
bool isBackupChargerEnabled ()
 
bool setBackupChargerVoltage (uint8_t opt)
 Set backup battery charge voltage (REG 35H bits 6:5)
 
uint8_t getBackupChargerVoltage ()
 
bool setBackupChargerCurrent (uint8_t opt)
 Set backup battery charge current (REG 35H bits 1:0)
 
uint8_t getBackupChargerCurrent ()
 
bool setPrechargeTimeout (uint8_t opt)
 Set precharge timeout (REG 34H bits 7:6)
 
uint8_t getPrechargeTimeout ()
 
bool setConstantCurrentTimeout (uint8_t opt)
 Set constant-current charge timeout (REG 34H bits 1:0)
 
uint8_t getConstantCurrentTimeout ()
 

Detailed Description

Definition at line 38 of file AXP202ChargerEx.hpp.

Constructor & Destructor Documentation

◆ AXP202ChargerEx()

AXP202ChargerEx::AXP202ChargerEx ( AXP202Core core)
inlineexplicit

Definition at line 41 of file AXP202ChargerEx.hpp.

Member Function Documentation

◆ enableBackupCharger()

bool AXP202ChargerEx::enableBackupCharger ( bool  enable)
inline

Enable backup battery charger (REG 35H bit 7)

Parameters
enabletrue to enable
Returns
true on success

Definition at line 116 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::BACKUP_CHG, SensorCommWrapper::clrRegBit(), and SensorCommWrapper::setRegBit().

◆ getBackupChargerCurrent()

uint8_t AXP202ChargerEx::getBackupChargerCurrent ( )
inline

◆ getBackupChargerVoltage()

uint8_t AXP202ChargerEx::getBackupChargerVoltage ( )
inline

◆ getChargeHighTempThreshold()

uint8_t AXP202ChargerEx::getChargeHighTempThreshold ( )
inline

◆ getChargeLowTempThreshold()

uint8_t AXP202ChargerEx::getChargeLowTempThreshold ( )
inline

◆ getConstantCurrentTimeout()

uint8_t AXP202ChargerEx::getConstantCurrentTimeout ( )
inline

Definition at line 191 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::CHARGE2, and SensorCommWrapper::readReg().

◆ getDischargeHighTempThreshold()

uint8_t AXP202ChargerEx::getDischargeHighTempThreshold ( )
inline

◆ getDischargeLowTempThreshold()

uint8_t AXP202ChargerEx::getDischargeLowTempThreshold ( )
inline

◆ getPrechargeTimeout()

uint8_t AXP202ChargerEx::getPrechargeTimeout ( )
inline

Definition at line 174 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::CHARGE2, and SensorCommWrapper::readReg().

◆ isBackupChargerEnabled()

bool AXP202ChargerEx::isBackupChargerEnabled ( )
inline

◆ setBackupChargerCurrent()

bool AXP202ChargerEx::setBackupChargerCurrent ( uint8_t  opt)
inline

Set backup battery charge current (REG 35H bits 1:0)

Parameters
opt0=50uA, 1=100uA, 2=200uA, 3=400uA
Returns
true on success

Definition at line 149 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::BACKUP_CHG, and SensorCommWrapper::updateBits().

◆ setBackupChargerVoltage()

bool AXP202ChargerEx::setBackupChargerVoltage ( uint8_t  opt)
inline

Set backup battery charge voltage (REG 35H bits 6:5)

Parameters
opt0=3.1V, 1=3.0V, 2=3.6V, 3=2.5V
Returns
true on success

Definition at line 132 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::BACKUP_CHG, and SensorCommWrapper::updateBits().

◆ setChargeHighTempThreshold()

bool AXP202ChargerEx::setChargeHighTempThreshold ( uint8_t  val)
inline

Set charge high-temperature fault threshold (REG 39H)

Parameters
valRaw 8-bit value. VHTF = val * 12.8mV
Returns
true on success

Definition at line 65 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::VHTF_CHGSET, and SensorCommWrapper::writeReg().

◆ setChargeLowTempThreshold()

bool AXP202ChargerEx::setChargeLowTempThreshold ( uint8_t  val)
inline

Set charge low-temperature fault threshold (REG 38H)

Parameters
valRaw 8-bit value. VLTF = val * 12.8mV
Returns
true on success

Definition at line 49 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::VLTF_CHGSET, and SensorCommWrapper::writeReg().

◆ setConstantCurrentTimeout()

bool AXP202ChargerEx::setConstantCurrentTimeout ( uint8_t  opt)
inline

Set constant-current charge timeout (REG 34H bits 1:0)

Parameters
opt0=6h, 1=8h, 2=10h, 3=12h
Returns
true on success

Definition at line 185 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::CHARGE2, and SensorCommWrapper::updateBits().

◆ setDischargeHighTempThreshold()

bool AXP202ChargerEx::setDischargeHighTempThreshold ( uint8_t  val)
inline

Set discharge high-temperature fault threshold (REG 3DH)

Parameters
valRaw 8-bit value
Returns
true on success

Definition at line 98 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::THTF_DISCHGSET, and SensorCommWrapper::writeReg().

◆ setDischargeLowTempThreshold()

bool AXP202ChargerEx::setDischargeLowTempThreshold ( uint8_t  val)
inline

Set discharge low-temperature fault threshold (REG 3CH)

Parameters
valRaw 8-bit value
Returns
true on success

Definition at line 82 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::TLTF_DISCHGSET, and SensorCommWrapper::writeReg().

◆ setPrechargeTimeout()

bool AXP202ChargerEx::setPrechargeTimeout ( uint8_t  opt)
inline

Set precharge timeout (REG 34H bits 7:6)

Parameters
opt0=40min, 1=50min, 2=60min, 3=70min
Returns
true on success

Definition at line 168 of file AXP202ChargerEx.hpp.

References axp202_regs::chg::CHARGE2, and SensorCommWrapper::updateBits().


The documentation for this class was generated from the following file: