|
SensorLib 0.5.1
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <GaugeAXP2602.hpp>
Classes | |
| struct | GaugeData |
Public Types | |
| enum | CurrentSenseResistor { SENSE_RESISTOR_10_MOHM = 0x00 , SENSE_RESISTOR_5_MOHM = 0x01 , SENSE_RESISTOR_20_MOHM = 0x02 , SENSE_RESISTOR_40_MOHM = 0x03 } |
| enum | IRQStatus { IRQ_STATUS_NONE = 0x00 , IRQ_STATUS_LOW_BATTERY = 0x01 , IRQ_STATUS_SOC_UPDATE = 0x02 , IRQ_STATUS_OVER_TEMPERATURE = 0x03 , IRQ_STATUS_WDT_TIMEOUT = 0x04 } |
| enum | IRQEnable { IRQ_ENABLE_WDT_TIMEOUT = 0x08 , IRQ_ENABLE_OVER_TEMPERATURE = 0x04 , IRQ_ENABLE_SOC_UPDATE = 0x02 , IRQ_ENABLE_LOW_BATTERY = 0x01 } |
| enum | OperatingMode { OPERATING_MODE_HIGH_PRECISION = 0x00 , OPERATING_MODE_NORMAL = 0x02 , OPERATING_MODE_LOW_POWER = 0x06 } |
Public Member Functions | |
| GaugeAXP2602 ()=default | |
| ~GaugeAXP2602 ()=default | |
| bool | begin (SensorCommCustom::CustomCallback callback, SensorCommCustomHal::CustomHalCallback hal_callback) |
| Begin with custom callback functions. | |
| bool | refresh () override |
| Refresh the AXP2602 chip data. | |
| float | getCurrentResolution (CurrentSenseResistor resistor) |
| Obtain current resolution based on the sampling resistor. | |
| uint16_t | getChipID () override |
| Get the chip ID. | |
| float | getTemperature () override |
| Get the temperature. | |
| uint8_t | getBatteryStatus () |
| Get the battery health status. | |
| uint16_t | getStateOfCharge () override |
| Get the battery percentage. | |
| uint16_t | getTimeToEmpty () override |
| Get the battery time to empty. | |
| uint16_t | getTimeToFull () override |
| Get the battery time to full. | |
| uint8_t | getLowBatterySOCThreshold () |
| Get the low battery SOC threshold. | |
| uint8_t | getOverTemperatureThreshold () |
| Get the over-temperature threshold. | |
| float | getThermalDieTemperature () |
| Get the actual die temperature. | |
| uint16_t | getThermalDieTemperatureRaw () |
| Get the thermal die temperature. | |
| uint16_t | getVoltage () override |
| Get the battery voltage. | |
| bool | isCharging () override |
| Checks if the battery is charging. | |
| bool | isDischarging () override |
| Checks if the battery is discharging. | |
| float | getChargingPower () |
| Get charging power (positive or 0) | |
| float | getDischargingPower () |
| Get discharging power (positive or 0) | |
| float | getAbsolutePower () |
| Get the absolute power (always positive) | |
| float | getCurrent () override |
| Get the actual current value (considering the sampling resistor) | |
| int16_t | getCurrentRaw () |
| Get the battery current. | |
| void | reset () override |
| Reset Gauge AXP2602. | |
| void | sleep () |
| Put the AXP2602 chip into sleep mode. | |
| bool | isSleepModeEnabled () |
| Check if the AXP2602 chip is in sleep mode. | |
| void | wakeup () |
| Wake up the AXP2602 chip. | |
| void | setLowBatterySOCThreshold (uint8_t threshold) |
| Set the low battery SOC threshold. | |
| void | setOverTemperatureThreshold (uint8_t threshold) |
| Set the over-temperature threshold. | |
| void | setThermalDieMeasurement (bool enable) |
| Enable or disable the thermal die measurement. | |
| bool | isThermalDieMeasurementEnabled () |
| Check if thermal die measurement is enabled. | |
| void | setCurrentMeasurement (bool enable) |
| Enable or disable battery current detection. | |
| bool | isCurrentMeasurementEnabled () |
| Check if battery current measurement is enabled. | |
| void | setBatteryDetection (bool enable) |
| Enable or disable battery voltage detection. | |
| bool | isBatteryVoltageMeasurementEnabled () |
| Check if battery voltage measurement is enabled. | |
| void | setCurrentSenseResistor (CurrentSenseResistor resistorValue) |
| Set the current sense resistor value. | |
| CurrentSenseResistor | getCurrentSenseResistor () |
| Get the current sense resistor value. | |
| IRQStatus | getIRQStatus () |
| Get the IRQ status. | |
| void | enableIRQ (IRQEnable irq) |
| Enable a specific IRQ. | |
| void | disableIRQ (IRQEnable irq) |
| Disable a specific IRQ. | |
| void | disableAllIRQ () |
| Disable all IRQs. | |
| void | enableIRQ (IRQEnable irq, bool enable, bool low_level_trigger=true) |
| Enable or disable specific IRQs. | |
| void | clearIRQStatus () |
| Clear the IRQ status. | |
| void | setOperatingMode (OperatingMode mode) |
| Set the operating mode. | |
| OperatingMode | getOperatingMode () |
| Get the operating mode. | |
| bool | writeGaugeData (uint8_t *data, uint8_t len) |
| Write Gauge Data. | |
| bool | compareGaugeData (uint8_t *data, uint8_t len) |
| Compare Gauge Data. | |
| void | enableWDT () |
| void | disableWDT () |
Public Member Functions inherited from GaugeBase | |
| virtual | ~GaugeBase ()=default |
| GaugeBase (const GaugeBase &)=delete | |
| GaugeBase & | operator= (const GaugeBase &)=delete |
Public Member Functions inherited from I2CDeviceWithHal | |
| bool | begin (SensorCommCustom::CustomCallback cb, SensorCommCustomHal::CustomHalCallback hal_cb, uint8_t addr) |
| Initialize the sensor using custom callback interface. | |
Public Member Functions inherited from DeviceBeginCommon | |
| virtual | ~DeviceBeginCommon () |
| uint8_t | getAddress () const |
| uint8_t | getInterface () const |
Public Member Functions inherited from SensorCommWrapper | |
| SensorCommWrapper ()=default | |
| int | readReg (uint8_t reg) const |
| int | readRegBuff (uint8_t reg, uint8_t *buf, size_t len) const |
| int | readBuff (uint8_t *buf, size_t len) const |
| int | writeReg (uint8_t reg, uint8_t val) |
| int | writeRegBuff (uint8_t reg, uint8_t *buf, size_t len) |
| int | writeBuff (uint8_t *buf, size_t len) |
| int | writeThenRead (const uint8_t *write_buffer, size_t write_len, uint8_t *read_buffer, size_t read_len) |
| bool | setRegBit (uint8_t reg, uint8_t bit) |
| bool | clrRegBit (uint8_t reg, uint8_t bit) |
| bool | getRegBit (uint8_t reg, uint8_t bit) |
| int | updateBits (uint8_t reg, uint8_t mask, uint8_t value_shifted) |
| void | setAddress (uint8_t address) |
| void | setAck (bool enable) |
Public Member Functions inherited from SensorCommInterface | |
| virtual | ~SensorCommInterface ()=default |
Protected Attributes | |
| GaugeData | data |
Protected Attributes inherited from DeviceBeginCommon | |
| std::unique_ptr< SensorCommBase > | comm |
| std::unique_ptr< SensorHal > | hal |
| std::unique_ptr< SensorCommStatic > | staticComm |
| uint8_t | _addr = 0 |
| uint8_t | _iface = COMM_CUSTOM |
Static Protected Attributes | |
| static constexpr uint8_t | REG_AXP2602_ID = 0x00 |
| static constexpr uint8_t | REG_BROM = 0x01 |
| static constexpr uint8_t | REG_MODE = 0x02 |
| static constexpr uint8_t | REG_PARA_CONFIG = 0x03 |
| static constexpr uint8_t | REG_VBAT_ADC_HIGH = 0x04 |
| static constexpr uint8_t | REG_VBAT_ADC_LOW = 0x05 |
| static constexpr uint8_t | REG_TEMP_RESULT = 0x06 |
| static constexpr uint8_t | REG_SOH = 0x07 |
| static constexpr uint8_t | REG_SOC = 0x08 |
| static constexpr uint8_t | REG_TIME_TO_EMPTY_HIGH = 0x0A |
| static constexpr uint8_t | REG_TIME_TO_EMPTY_LOW = 0x0B |
| static constexpr uint8_t | REG_TIME_TO_FULL_HIGH = 0x0C |
| static constexpr uint8_t | REG_TIME_TO_FULL_LOW = 0x0D |
| static constexpr uint8_t | REG_LOW_SOC_THLD = 0x0E |
| static constexpr uint8_t | REG_OT_THLD = 0x0F |
| static constexpr uint8_t | REG_COMM_CONFIG = 0x11 |
| static constexpr uint8_t | REG_IBAT_ADC_HIGH = 0x14 |
| static constexpr uint8_t | REG_IBAT_ADC_LOW = 0x15 |
| static constexpr uint8_t | REG_RDC25_CONFIG_HIGH = 0x1A |
| static constexpr uint8_t | REG_RDC25_CONFIG_LOW = 0x1B |
| static constexpr uint8_t | REG_QMAX_CONFIG_HIGH = 0x1E |
| static constexpr uint8_t | REG_QMAX_CONFIG_LOW = 0x1F |
| static constexpr uint8_t | REG_IRQ_STATUS = 0x20 |
| static constexpr uint8_t | REG_IRQ_ENABLE = 0x21 |
| static constexpr uint8_t | REG_TDIE_ADC_HIGH = 0xC2 |
| static constexpr uint8_t | REG_TDIE_ADC_LOW = 0xC3 |
| static constexpr uint8_t | REG_RDC25_QMAX_SEL = 0xC5 |
| static constexpr uint8_t | REG_OPERATING_MODE = 0xC6 |
| static constexpr uint8_t | AXP2602_CHIP_ID = 0x1C |
Additional Inherited Members | |
Protected Member Functions inherited from GaugeBase | |
| GaugeBase ()=default | |
Protected Member Functions inherited from I2CDeviceWithHal | |
| bool | ensureValid () const override |
| Ensure the communication interface is valid. | |
Protected Member Functions inherited from DeviceBeginCommon | |
| DeviceBeginCommon ()=default | |
| virtual SensorCommBase * | getComm () const override |
| virtual void | beforeBegin () |
| virtual void | afterCommReady () |
| virtual void | afterInitSuccess (uint8_t param) |
| virtual void | onBeginFail () |
| bool | fail () |
| void | clearCommState () |
| template<typename CreateComm > | |
| bool | beginLifecycle (uint8_t addr, uint8_t iface, uint8_t initParam, CreateComm createComm) |
Definition at line 43 of file gauge/xpowers/GaugeAXP2602.hpp.
| Enumerator | |
|---|---|
| SENSE_RESISTOR_10_MOHM | |
| SENSE_RESISTOR_5_MOHM | |
| SENSE_RESISTOR_20_MOHM | |
| SENSE_RESISTOR_40_MOHM | |
Definition at line 46 of file gauge/xpowers/GaugeAXP2602.hpp.
| Enumerator | |
|---|---|
| IRQ_ENABLE_WDT_TIMEOUT | |
| IRQ_ENABLE_OVER_TEMPERATURE | |
| IRQ_ENABLE_SOC_UPDATE | |
| IRQ_ENABLE_LOW_BATTERY | |
Definition at line 61 of file gauge/xpowers/GaugeAXP2602.hpp.
| Enumerator | |
|---|---|
| IRQ_STATUS_NONE | |
| IRQ_STATUS_LOW_BATTERY | |
| IRQ_STATUS_SOC_UPDATE | |
| IRQ_STATUS_OVER_TEMPERATURE | |
| IRQ_STATUS_WDT_TIMEOUT | |
Definition at line 53 of file gauge/xpowers/GaugeAXP2602.hpp.
| Enumerator | |
|---|---|
| OPERATING_MODE_HIGH_PRECISION | |
| OPERATING_MODE_NORMAL | |
| OPERATING_MODE_LOW_POWER | |
Definition at line 67 of file gauge/xpowers/GaugeAXP2602.hpp.
|
default |
|
default |
References I2CDeviceWithHal::begin().
|
inline |
Begin with custom callback functions.
| callback | The custom callback function for communication. |
| hal_callback | The custom callback function for hardware abstraction layer. |
| True | if initialization is successful, false otherwise. |
Definition at line 186 of file gauge/xpowers/GaugeAXP2602.hpp.
References I2CDeviceWithHal::begin(), and hal_callback().
Referenced by setup().
|
inline |
Clear the IRQ status.
Definition at line 710 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, DeviceBeginCommon::hal, IRQ_STATUS_NONE, GaugeAXP2602::GaugeData::irqStatus, REG_IRQ_STATUS, and SensorCommWrapper::writeReg().
Referenced by loop().
|
inline |
Compare Gauge Data.
| *data | Pointer to the data buffer to compare. |
| len | Length of the data buffer (should be 128 bytes). |
| True | if the data matches, false otherwise. |
Definition at line 788 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::clrRegBit(), data, i, SensorCommWrapper::readReg(), REG_BROM, REG_MODE, REG_PARA_CONFIG, and SensorCommWrapper::setRegBit().
Referenced by writeGaugeData().
|
inline |
Disable all IRQs.
Definition at line 675 of file gauge/xpowers/GaugeAXP2602.hpp.
References REG_IRQ_ENABLE, and SensorCommWrapper::writeReg().
|
inline |
Disable a specific IRQ.
| irq | The IRQ to disable. |
Definition at line 666 of file gauge/xpowers/GaugeAXP2602.hpp.
References enableIRQ().
|
inline |
Definition at line 816 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::clrRegBit(), and REG_PARA_CONFIG.
|
inline |
Enable a specific IRQ.
| irq | The IRQ to enable. |
Definition at line 657 of file gauge/xpowers/GaugeAXP2602.hpp.
References enableIRQ().
Referenced by disableIRQ(), and enableIRQ().
|
inline |
Enable or disable specific IRQs.
| irq | The IRQ to enable or disable. |
| enable | A boolean value to enable (true) or disable (false) the specified IRQ. |
| low_level_trigger | A boolean value to set the IRQ trigger level. |
Definition at line 686 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::readReg(), REG_IRQ_ENABLE, and SensorCommWrapper::writeReg().
|
inline |
Definition at line 811 of file gauge/xpowers/GaugeAXP2602.hpp.
References REG_PARA_CONFIG, and SensorCommWrapper::setRegBit().
|
inline |
Get the absolute power (always positive)
| The | absolute power (W) |
Definition at line 458 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::power.
Referenced by loop().
|
inline |
Get the battery health status.
| The | battery health status as an 8-bit unsigned integer. |
Definition at line 332 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::soh.
Referenced by loop().
|
inline |
Get charging power (positive or 0)
| Charging | power (W), returns 0 if not charging |
Definition at line 440 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::current, data, and GaugeAXP2602::GaugeData::power.
Referenced by loop().
|
inlineoverridevirtual |
Get the chip ID.
| The | chip ID as an integer. Default value is 0x1C for AXP2602. |
Implements GaugeBase.
Definition at line 314 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::readReg(), and REG_AXP2602_ID.
|
inlineoverridevirtual |
Get the actual current value (considering the sampling resistor)
| Actual | current value (mA) |
Implements GaugeBase.
Definition at line 467 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::current, and data.
Referenced by loop().
|
inline |
Get the battery current.
| The | battery current ADC value. |
Definition at line 476 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::currentRaw, and data.
Referenced by loop().
|
inline |
Obtain current resolution based on the sampling resistor.
| resistor | Sampling resistor value |
| Current | resolution (mA/LSB) |
Definition at line 293 of file gauge/xpowers/GaugeAXP2602.hpp.
References SENSE_RESISTOR_10_MOHM, SENSE_RESISTOR_20_MOHM, SENSE_RESISTOR_40_MOHM, and SENSE_RESISTOR_5_MOHM.
Referenced by refresh().
|
inline |
Get the current sense resistor value.
| The | current sense resistor value. |
Definition at line 638 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::senseResistor.
|
inline |
Get discharging power (positive or 0)
| Discharging | power (W), returns 0 if not discharging |
Definition at line 449 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::current, data, and GaugeAXP2602::GaugeData::power.
Referenced by loop().
|
inline |
Get the IRQ status.
| The | IRQ status. |
Definition at line 648 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::irqStatus.
Referenced by loop().
|
inline |
Get the low battery SOC threshold.
| The | low battery SOC threshold as an 8-bit unsigned integer. |
Definition at line 368 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::readReg(), and REG_LOW_SOC_THLD.
|
inline |
Get the operating mode.
| The | current operating mode. |
Definition at line 740 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, GaugeAXP2602::GaugeData::operatingMode, SensorCommWrapper::readReg(), and REG_OPERATING_MODE.
|
inline |
Get the over-temperature threshold.
| The | over-temperature threshold as an 8-bit unsigned integer. |
Definition at line 381 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::readReg(), and REG_OT_THLD.
|
inlineoverridevirtual |
Get the battery percentage.
| The | battery percentage as an 8-bit unsigned integer. |
Implements GaugeBase.
Definition at line 341 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::soc.
Referenced by loop().
|
inlineoverridevirtual |
Get the temperature.
| The | temperature in degrees Celsius (°C). |
Implements GaugeBase.
Definition at line 323 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::temperature.
Referenced by loop().
|
inline |
Get the actual die temperature.
| Actual | temperature value (°C) |
Definition at line 394 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::actualDieTemperature, and data.
Referenced by loop().
|
inline |
Get the thermal die temperature.
| The | thermal die temperature ADC value. |
Definition at line 403 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::tdieTemperatureRaw.
Referenced by loop().
|
inlineoverridevirtual |
Get the battery time to empty.
| The | battery time to empty in minutes. |
Implements GaugeBase.
Definition at line 350 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::timeToEmpty.
Referenced by loop().
|
inlineoverridevirtual |
Get the battery time to full.
| The | battery time to full in minutes. |
Implements GaugeBase.
Definition at line 359 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::timeToFull.
Referenced by loop().
|
inlineoverridevirtual |
Get the battery voltage.
| The | battery voltage in millivolts (mV). |
Implements GaugeBase.
Definition at line 412 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::voltage.
Referenced by loop().
|
inline |
Check if battery voltage measurement is enabled.
| True | if battery voltage measurement is enabled, false otherwise. |
Definition at line 615 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::batteryDetectionEnabled, and data.
|
inlineoverridevirtual |
Checks if the battery is charging.
| Returns | true for charging, false for discharging |
Implements GaugeBase.
Definition at line 422 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::current, and data.
Referenced by loop().
|
inline |
Check if battery current measurement is enabled.
| True | if battery current measurement is enabled, false otherwise. |
Definition at line 592 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::currentMeasurementEnabled, and data.
|
inlineoverridevirtual |
Checks if the battery is discharging.
| Returns | true for discharging and false for charging |
Implements GaugeBase.
Definition at line 431 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::current, and data.
Referenced by loop().
|
inline |
Check if the AXP2602 chip is in sleep mode.
| True | if the chip is in sleep mode, false otherwise. |
Definition at line 506 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::getRegBit(), and REG_MODE.
Referenced by loop().
|
inline |
Check if thermal die measurement is enabled.
| True | if thermal die measurement is enabled, false otherwise. |
Definition at line 569 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, and GaugeAXP2602::GaugeData::thermalDieEnabled.
|
inlineoverridevirtual |
Refresh the AXP2602 chip data.
| True | if refresh is successful, false otherwise. |
Implements GaugeBase.
Definition at line 197 of file gauge/xpowers/GaugeAXP2602.hpp.
References sensorlib::_bv(), GaugeAXP2602::GaugeData::actualDieTemperature, AXP2602_CHIP_ID, GaugeAXP2602::GaugeData::batteryDetectionEnabled, GaugeAXP2602::GaugeData::chipID, DeviceBeginCommon::comm, GaugeAXP2602::GaugeData::current, GaugeAXP2602::GaugeData::currentMeasurementEnabled, GaugeAXP2602::GaugeData::currentRaw, data, getCurrentResolution(), GaugeAXP2602::GaugeData::irqStatus, GaugeAXP2602::GaugeData::power, SensorCommWrapper::readReg(), REG_COMM_CONFIG, REG_IBAT_ADC_HIGH, REG_IBAT_ADC_LOW, REG_IRQ_STATUS, REG_SOC, REG_SOH, REG_TDIE_ADC_HIGH, REG_TDIE_ADC_LOW, REG_TEMP_RESULT, REG_TIME_TO_EMPTY_HIGH, REG_TIME_TO_EMPTY_LOW, REG_TIME_TO_FULL_HIGH, REG_TIME_TO_FULL_LOW, REG_VBAT_ADC_HIGH, REG_VBAT_ADC_LOW, GaugeAXP2602::GaugeData::senseResistor, SENSORLIB_LOG_E, GaugeAXP2602::GaugeData::sleepModeEnabled, GaugeAXP2602::GaugeData::soc, GaugeAXP2602::GaugeData::soh, GaugeAXP2602::GaugeData::tdieTemperatureRaw, GaugeAXP2602::GaugeData::temperature, GaugeAXP2602::GaugeData::thermalDieEnabled, GaugeAXP2602::GaugeData::timeToEmpty, GaugeAXP2602::GaugeData::timeToFull, and GaugeAXP2602::GaugeData::voltage.
Referenced by loop().
|
inlineoverridevirtual |
Reset Gauge AXP2602.
Implements GaugeBase.
Definition at line 484 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::clrRegBit(), DeviceBeginCommon::hal, REG_MODE, and SensorCommWrapper::setRegBit().
|
inline |
Enable or disable battery voltage detection.
| enable | A boolean value to enable (true) or disable (false) the battery detection. |
Definition at line 601 of file gauge/xpowers/GaugeAXP2602.hpp.
References GaugeAXP2602::GaugeData::batteryDetectionEnabled, SensorCommWrapper::clrRegBit(), data, REG_COMM_CONFIG, and SensorCommWrapper::setRegBit().
|
inline |
Enable or disable battery current detection.
| enable | A boolean value to enable (true) or disable (false) battery current detection. |
Definition at line 578 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::clrRegBit(), GaugeAXP2602::GaugeData::currentMeasurementEnabled, data, REG_COMM_CONFIG, and SensorCommWrapper::setRegBit().
|
inline |
Set the current sense resistor value.
| resistorValue | The desired current sense resistor value. |
Definition at line 624 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, SensorCommWrapper::readReg(), REG_COMM_CONFIG, GaugeAXP2602::GaugeData::senseResistor, and SensorCommWrapper::writeReg().
|
inline |
Set the low battery SOC threshold.
| threshold | The low battery SOC threshold (0% to 63%). |
Definition at line 525 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::readReg(), REG_LOW_SOC_THLD, and SensorCommWrapper::writeReg().
|
inline |
Set the operating mode.
| mode | The operating mode to set. |
Definition at line 722 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, OPERATING_MODE_HIGH_PRECISION, OPERATING_MODE_LOW_POWER, OPERATING_MODE_NORMAL, GaugeAXP2602::GaugeData::operatingMode, REG_OPERATING_MODE, and SensorCommWrapper::writeReg().
|
inline |
Set the over-temperature threshold.
| threshold | The over-temperature threshold (0°C to 127°C). |
Definition at line 543 of file gauge/xpowers/GaugeAXP2602.hpp.
References REG_OT_THLD, and SensorCommWrapper::writeReg().
|
inline |
Enable or disable the thermal die measurement.
| enable | A boolean value to enable (true) or disable (false) the thermal die measurement. |
Definition at line 555 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::clrRegBit(), data, REG_COMM_CONFIG, SensorCommWrapper::setRegBit(), and GaugeAXP2602::GaugeData::thermalDieEnabled.
|
inline |
Put the AXP2602 chip into sleep mode.
Definition at line 495 of file gauge/xpowers/GaugeAXP2602.hpp.
References data, REG_MODE, SensorCommWrapper::setRegBit(), and GaugeAXP2602::GaugeData::sleepModeEnabled.
|
inline |
Wake up the AXP2602 chip.
Definition at line 514 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::clrRegBit(), data, REG_MODE, and GaugeAXP2602::GaugeData::sleepModeEnabled.
|
inline |
Write Gauge Data.
| *data | Pointer to the data buffer to compare. |
| len | Length of the data buffer (should be 128 bytes). |
| True | if the data successfully wrote to ROM by comparing with the written data, false otherwise. |
Definition at line 757 of file gauge/xpowers/GaugeAXP2602.hpp.
References SensorCommWrapper::clrRegBit(), compareGaugeData(), data, DeviceBeginCommon::hal, i, REG_BROM, REG_MODE, REG_PARA_CONFIG, SensorCommWrapper::setRegBit(), and SensorCommWrapper::writeReg().
|
staticconstexprprotected |
Definition at line 873 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
protected |
Definition at line 839 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by clearIRQStatus(), compareGaugeData(), getAbsolutePower(), getBatteryStatus(), getChargingPower(), getCurrent(), getCurrentRaw(), getCurrentSenseResistor(), getDischargingPower(), getIRQStatus(), getOperatingMode(), getStateOfCharge(), getTemperature(), getThermalDieTemperature(), getThermalDieTemperatureRaw(), getTimeToEmpty(), getTimeToFull(), getVoltage(), isBatteryVoltageMeasurementEnabled(), isCharging(), isCurrentMeasurementEnabled(), isDischarging(), isThermalDieMeasurementEnabled(), refresh(), setBatteryDetection(), setCurrentMeasurement(), setCurrentSenseResistor(), setOperatingMode(), setThermalDieMeasurement(), sleep(), wakeup(), and writeGaugeData().
|
staticconstexprprotected |
Definition at line 841 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by getChipID().
|
staticconstexprprotected |
Definition at line 842 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by compareGaugeData(), and writeGaugeData().
|
staticconstexprprotected |
Definition at line 858 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh(), setBatteryDetection(), setCurrentMeasurement(), setCurrentSenseResistor(), and setThermalDieMeasurement().
|
staticconstexprprotected |
Definition at line 859 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 860 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 867 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by disableAllIRQ(), and enableIRQ().
|
staticconstexprprotected |
Definition at line 866 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by clearIRQStatus(), and refresh().
|
staticconstexprprotected |
Definition at line 855 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by getLowBatterySOCThreshold(), and setLowBatterySOCThreshold().
|
staticconstexprprotected |
Definition at line 843 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by compareGaugeData(), isSleepModeEnabled(), reset(), sleep(), wakeup(), and writeGaugeData().
|
staticconstexprprotected |
Definition at line 871 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by getOperatingMode(), and setOperatingMode().
|
staticconstexprprotected |
Definition at line 856 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by getOverTemperatureThreshold(), and setOverTemperatureThreshold().
|
staticconstexprprotected |
Definition at line 844 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by compareGaugeData(), disableWDT(), enableWDT(), and writeGaugeData().
|
staticconstexprprotected |
Definition at line 863 of file gauge/xpowers/GaugeAXP2602.hpp.
|
staticconstexprprotected |
Definition at line 864 of file gauge/xpowers/GaugeAXP2602.hpp.
|
staticconstexprprotected |
Definition at line 861 of file gauge/xpowers/GaugeAXP2602.hpp.
|
staticconstexprprotected |
Definition at line 862 of file gauge/xpowers/GaugeAXP2602.hpp.
|
staticconstexprprotected |
Definition at line 870 of file gauge/xpowers/GaugeAXP2602.hpp.
|
staticconstexprprotected |
Definition at line 849 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 848 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 868 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 869 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 847 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 851 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 852 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 853 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 854 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 845 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().
|
staticconstexprprotected |
Definition at line 846 of file gauge/xpowers/GaugeAXP2602.hpp.
Referenced by refresh().