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

#include <AXP202Coulomb.hpp>

Public Member Functions

 AXP202Coulomb (AXP202Core &core)
 
bool enable (bool enable)
 Enable coulomb counter (REG B8H bit 7)
 
bool isEnabled ()
 
bool pause ()
 Pause coulomb counter (REG B8H bit 6)
 
bool resume ()
 Resume coulomb counter (REG B8H bit 6 clear)
 
bool clear ()
 Clear/reset coulomb counter (REG B8H bit 5)
 
uint32_t getChargeCoulomb ()
 Read charge coulomb counter (REG B0H-B3H, 32-bit big-endian)
 
uint32_t getDischargeCoulomb ()
 Read discharge coulomb counter (REG B4H-B7H, 32-bit big-endian)
 

Detailed Description

Definition at line 17 of file AXP202Coulomb.hpp.

Constructor & Destructor Documentation

◆ AXP202Coulomb()

AXP202Coulomb::AXP202Coulomb ( AXP202Core core)
inlineexplicit

Definition at line 20 of file AXP202Coulomb.hpp.

Member Function Documentation

◆ clear()

bool AXP202Coulomb::clear ( )
inline

Clear/reset coulomb counter (REG B8H bit 5)

Returns
true on success

Definition at line 60 of file AXP202Coulomb.hpp.

References axp202_regs::coulomb::COULOMB_CTL, and SensorCommWrapper::setRegBit().

◆ enable()

bool AXP202Coulomb::enable ( bool  enable)
inline

Enable coulomb counter (REG B8H bit 7)

Parameters
enabletrue to enable counting
Returns
true on success

Definition at line 27 of file AXP202Coulomb.hpp.

References SensorCommWrapper::clrRegBit(), axp202_regs::coulomb::COULOMB_CTL, enable(), and SensorCommWrapper::setRegBit().

Referenced by enable().

◆ getChargeCoulomb()

uint32_t AXP202Coulomb::getChargeCoulomb ( )
inline

Read charge coulomb counter (REG B0H-B3H, 32-bit big-endian)

Returns
32-bit counter value, 0 on error

Definition at line 69 of file AXP202Coulomb.hpp.

References axp202_regs::coulomb::BAT_CHGCOULOMB3.

◆ getDischargeCoulomb()

uint32_t AXP202Coulomb::getDischargeCoulomb ( )
inline

Read discharge coulomb counter (REG B4H-B7H, 32-bit big-endian)

Returns
32-bit counter value, 0 on error

Definition at line 78 of file AXP202Coulomb.hpp.

References axp202_regs::coulomb::BAT_DISCHGCOULOMB3.

◆ isEnabled()

bool AXP202Coulomb::isEnabled ( )
inline

◆ pause()

bool AXP202Coulomb::pause ( )
inline

Pause coulomb counter (REG B8H bit 6)

Returns
true on success

Definition at line 42 of file AXP202Coulomb.hpp.

References axp202_regs::coulomb::COULOMB_CTL, and SensorCommWrapper::setRegBit().

◆ resume()

bool AXP202Coulomb::resume ( )
inline

Resume coulomb counter (REG B8H bit 6 clear)

Returns
true on success

Definition at line 51 of file AXP202Coulomb.hpp.

References SensorCommWrapper::clrRegBit(), and axp202_regs::coulomb::COULOMB_CTL.


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