32#include "../../PmicIrqBase.hpp"
124 static bool inline isIrqSet(uint64_t irqMask, uint64_t status) {
return (status & irqMask) != 0; }
187 bool enable(uint64_t mask)
override;
194 bool disable(uint64_t mask)
override;
204 uint64_t
readStatus(
bool clear =
true)
override;
Core I2C communication layer for the AXP2101 PMIC.
Interrupt controller interface for the AXP2101 PMIC.
static constexpr uint64_t IRQ_WARNING_LEVEL2
Battery voltage crossed warning level 2 threshold.
static bool isBatfetOverCurr(uint64_t mask)
Check if BATFET over-current interrupt is set.
static bool isWarningLevel1(uint64_t mask)
Check if battery warning level 1 interrupt is set.
static constexpr uint64_t IRQ_PEKEY_LONG_PRESS
Power key held for a long press duration.
static bool isBatOverTempChg(uint64_t mask)
Check if battery over-temperature (charging range) interrupt is set.
static constexpr uint64_t IRQ_VBUS_REMOVE
VBUS power source removed.
static constexpr uint64_t IRQ_GAUGE_WDT_TIMEOUT
Coulomb gauge watchdog timer expired.
static bool isPekeyShortPress(uint64_t mask)
Check if power key short press interrupt is set.
static constexpr uint64_t IRQ_BAT_CHG_START
Battery charging has started.
static bool isPekeyLongPress(uint64_t mask)
Check if power key long press interrupt is set.
static constexpr uint64_t IRQ_BATFET_OVER_CURR
BATFET over-current condition detected.
static bool isWarningLevel2(uint64_t mask)
Check if battery warning level 2 interrupt is set.
static constexpr uint64_t IRQ_CHG_TIMEOUT
Battery charge cycle timed out.
static constexpr uint64_t IRQ_PEKEY_SHORT_PRESS
Power key pressed briefly (short press).
static constexpr uint64_t IRQ_PEKEY_POSITIVE_EDGE
Power key rising edge detected.
static constexpr uint64_t IRQ_ALL_MASK
Mask covering all defined interrupt bits.
static bool isGaugeNewSoc(uint64_t mask)
Check if gauge new state-of-charge interrupt is set.
static bool isBatOverVolt(uint64_t mask)
Check if battery over-voltage interrupt is set.
static bool isWdtExpire(uint64_t mask)
Check if watchdog timer expired interrupt is set.
static constexpr uint64_t IRQ_BAT_OVER_TEMP_WORK
Battery temperature exceeded the working threshold.
static constexpr uint64_t IRQ_PEKEY_NEGATIVE_EDGE
Power key falling edge detected.
static bool isChgTimeout(uint64_t mask)
Check if charge timeout interrupt is set.
static bool isLdoOverCurr(uint64_t mask)
Check if LDO over-current interrupt is set.
static constexpr uint64_t IRQ_GAUGE_NEW_SOC
Coulomb gauge reported a new state-of-charge value.
static bool isBatInsert(uint64_t mask)
Check if battery insertion interrupt is set.
static bool isBatOverTempWork(uint64_t mask)
Check if battery over-temperature (working range) interrupt is set.
static constexpr uint64_t IRQ_VBUS_INSERT
VBUS power source inserted.
static bool isBatRemove(uint64_t mask)
Check if battery removal interrupt is set.
static bool isPkeyPositiveEdge(uint64_t mask)
Check if power key positive (rising) edge interrupt is set.
static bool isVbusInsert(uint64_t mask)
Check if VBUS insertion interrupt is set.
static bool isBatUnderTempWork(uint64_t mask)
Check if battery under-temperature (working range) interrupt is set.
static constexpr uint64_t IRQ_WARNING_LEVEL1
Battery voltage crossed warning level 1 threshold.
static constexpr uint64_t IRQ_LDO_OVER_CURR
LDO output over-current condition detected.
static constexpr uint64_t IRQ_BAT_INSERT
Battery inserted into the system.
bool enable(uint64_t mask) override
Enable one or more interrupt sources.
static bool isVbusRemove(uint64_t mask)
Check if VBUS removal interrupt is set.
uint64_t readStatus(bool clear=true) override
Read the current interrupt status.
static constexpr uint64_t IRQ_WDT_EXPIRE
Watchdog timer expired.
static constexpr uint64_t IRQ_BAT_REMOVE
Battery removed from the system.
static constexpr uint64_t IRQ_RESERVED_MASK
Mask for reserved / unused interrupt bits.
bool disable(uint64_t mask) override
Disable one or more interrupt sources.
static bool isBatChgDone(uint64_t mask)
Check if battery charge done interrupt is set.
static constexpr uint64_t IRQ_BAT_OVER_VOLT
Battery voltage exceeded the over-voltage threshold.
static constexpr uint64_t IRQ_BAT_CHG_DONE
Battery charging has completed.
static bool isPkeyNegativeEdge(uint64_t mask)
Check if power key negative (falling) edge interrupt is set.
static bool isIrqSet(uint64_t irqMask, uint64_t status)
Check whether a specific interrupt bit is set in a status word.
static bool isDieOverTemp(uint64_t mask)
Check if die over-temperature interrupt is set.
bool clearStatus() override
Clear all pending interrupt status registers.
static constexpr uint64_t IRQ_DIE_OVER_TEMP
Die temperature exceeded the thermal shutdown threshold.
static constexpr uint64_t IRQ_BAT_UNDER_TEMP_CHG
Battery temperature dropped below the charging threshold.
static constexpr uint64_t IRQ_BAT_OVER_TEMP_CHG
Battery temperature exceeded the charging threshold.
static constexpr uint64_t IRQ_BAT_UNDER_TEMP_WORK
Battery temperature dropped below the working threshold.
static bool isBatUnderTempChg(uint64_t mask)
Check if battery under-temperature (charging range) interrupt is set.
static bool isGaugeWdtTimeout(uint64_t mask)
Check if gauge watchdog timeout interrupt is set.
static bool isBatChgStart(uint64_t mask)
Check if battery charge start interrupt is set.