SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP2101Pwron.hpp
Go to the documentation of this file.
1
31#pragma once
32#include "AXP2101Core.hpp"
33#include "../../PmicButtonBase.hpp"
34
46{
47public:
48 explicit AXP2101Pwron(AXP2101Core &core);
49 ~AXP2101Pwron() = default;
50
57 bool setOnDurationMs(uint16_t ms) override;
58
64 bool getOnDurationMs(uint16_t &ms) const override;
65
72 bool setOffDurationMs(uint16_t ms) override;
73
79 bool getOffDurationMs(uint16_t &ms) const override;
80
87 bool setIrqDurationMs(uint16_t ms) override;
88
94 bool getIrqDurationMs(uint16_t &ms) const override;
95
96private:
103 bool updateBits(uint8_t mask, uint8_t value);
104
105 AXP2101Core &_core;
106};
@license MIT License
Core I2C communication layer for the AXP2101 PMIC.
Power-on / power-button timing control for the AXP2101 PMIC.
bool getIrqDurationMs(uint16_t &ms) const override
Get the short-press / IRQ trigger delay.
bool setIrqDurationMs(uint16_t ms) override
Set the short-press / IRQ trigger delay.
bool setOffDurationMs(uint16_t ms) override
Set the power-off delay (held duration to turn off).
bool setOnDurationMs(uint16_t ms) override
Set the power-on delay (held duration to turn on).
bool getOnDurationMs(uint16_t &ms) const override
Get the power-on delay setting.
~AXP2101Pwron()=default
bool getOffDurationMs(uint16_t &ms) const override
Get the power-off delay setting.