SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP2101Core.hpp
Go to the documentation of this file.
1
31#pragma once
32#include "../../../platform/comm/I2CDeviceWithHal.hpp"
33
42{
43public:
44 AXP2101Core() = default;
45 ~AXP2101Core() = default;
46
53 enum class Module : uint8_t {
56 WATCHDOG,
57 GAUGE,
65 };
66
74
81 bool enableModule(Module module, bool enable);
82
88 bool isModuleEnabled(Module module);
89
96
97private:
98 bool initImpl(uint8_t param) override;
99};
Core I2C communication layer for the AXP2101 PMIC.
WatchdogConfig
Watchdog timer configuration options.
@ TIMEOUT_IRQ_AND_SYS_RESET_PULLDOWN_PWROK_1S
Trigger IRQ, system reset, and pull down PWROK after 1s.
@ TIMEOUT_IRQ_AND_SYS_RESET_AFTER_POWEROFF_THEN_POWERON
Trigger IRQ, system reset after power off, then power on.
@ TIMEOUT_IRQ_AND_SYS_RESET
Trigger IRQ and system reset.
@ TIMEOUT_IRQ_ONLY
Trigger IRQ only.
bool isModuleEnabled(Module module)
Check whether an internal module is enabled.
bool enableModule(Module module, bool enable)
Enable or disable an internal functional module.
~AXP2101Core()=default
bool setWatchdogConfig(WatchdogConfig config)
Set watchdog timer configuration.
Module
Identifiers for AXP2101 internal functional modules.
@ TS_MEASURE
TS pin ADC (REG 0x30 bit 1)
@ CELL_CHARGE
Cell battery charger (REG 0x18 bit 1)
@ TEMP_MEASURE
Die temperature ADC (REG 0x30 bit 4)
@ GAUGE
Fuel gauge (REG 0x18 bit 3)
@ VSYS_MEASURE
VSYS voltage ADC (REG 0x30 bit 3)
@ BAT_VOLT_MEASURE
Battery voltage ADC (REG 0x30 bit 0)
@ BTN_CHARGE
Button/backup battery charger (REG 0x18 bit 2)
@ BAT_DETECT
Battery detection (REG 0x68 bit 0)
@ VBUS_MEASURE
VBUS voltage ADC (REG 0x30 bit 2)
@ WATCHDOG
Watchdog timer (REG 0x18 bit 0)
@ GENERAL_ADC
General-purpose ADC (REG 0x30 bit 5)
AXP2101Core()=default