|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <AXP1xxTimer.hpp>
Public Member Functions | |
| AXP1xxTimer (SensorCommWrapper &core) | |
| bool | setTimer (uint8_t minutes) override |
| Start the timer with the given duration, or stop it. | |
| uint8_t | getTimer () const override |
| Read the current timer value from REG8AH bits[6:0]. | |
| bool | isTimedOut () const override |
| Check whether the timer has expired (bit 7 of REG8AH). | |
| bool | clearTimeout () override |
| Clear the timeout status flag (write 1 to bit 7 of REG8AH). | |
Public Member Functions inherited from PmicTimerBase | |
| virtual | ~PmicTimerBase ()=default |
Definition at line 46 of file AXP1xxTimer.hpp.
|
inlineexplicit |
Definition at line 49 of file AXP1xxTimer.hpp.
|
inlineoverridevirtual |
Clear the timeout status flag (write 1 to bit 7 of REG8AH).
| true | Cleared successfully. |
| false | I2C error. |
Implements PmicTimerBase.
Definition at line 95 of file AXP1xxTimer.hpp.
References SensorCommWrapper::setRegBit().
Referenced by loop().
|
inlineoverridevirtual |
Read the current timer value from REG8AH bits[6:0].
Implements PmicTimerBase.
Definition at line 73 of file AXP1xxTimer.hpp.
References SensorCommWrapper::readReg().
|
inlineoverridevirtual |
Check whether the timer has expired (bit 7 of REG8AH).
| true | Timer has timed out. |
| false | Still running, stopped, or I2C error. |
Implements PmicTimerBase.
Definition at line 85 of file AXP1xxTimer.hpp.
References SensorCommWrapper::getRegBit().
Referenced by loop().
|
inlineoverridevirtual |
Start the timer with the given duration, or stop it.
Writes the minute value to REG8AH bits[6:0]. Also clears any pending timeout status (bit 7) by writing 1.
| minutes | 0 to stop, 1-127 to start. |
| true | Success. |
| false | Out of range or I2C error. |
Implements PmicTimerBase.
Definition at line 61 of file AXP1xxTimer.hpp.
References SensorCommWrapper::writeReg().
Referenced by setup().