31#include "../../../SensorBuildOpt.h"
32#if !SENSORLIB_EXCLUDE_PMIC_AXP2101
56 case 1: val = 0;
break;
57 case 2: val = 1;
break;
58 case 4: val = 2;
break;
59 case 8: val = 3;
break;
60 case 16: val = 4;
break;
61 case 32: val = 5;
break;
62 case 64: val = 6;
break;
63 case 128: val = 7;
break;
64 default:
return false;
72 if (val < 0)
return 0;
73 const uint16_t timeouts[] = {1, 2, 4, 8, 16, 32, 64, 128};
74 uint8_t idx = val & 0x07;
75 if (idx >= 8)
return 0;
Core I2C communication layer for the AXP2101 PMIC.
bool isModuleEnabled(Module module)
Check whether an internal module is enabled.
bool enableModule(Module module, bool enable)
Enable or disable an internal functional module.
@ WATCHDOG
Watchdog timer (REG 0x18 bit 0)
bool enableWatchdog(bool enable) override
Enable or disable the watchdog timer.
bool setWatchdogTimeout(uint16_t timeout_s) override
Set the watchdog timeout duration.
bool isWatchdogEnabled() const override
Check whether the watchdog timer is enabled.
bool resetWatchdog() override
Reset (pet) the watchdog timer.
uint16_t getWatchdogTimeout() const override
Get the current watchdog timeout setting.
AXP2101Watchdog(AXP2101Core &core)
int readReg(uint8_t reg) const
int updateBits(uint8_t reg, uint8_t mask, uint8_t value_shifted)
bool setRegBit(uint8_t reg, uint8_t bit)
static constexpr uint8_t WDT_CTRL