|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <AXP1xxPwron.hpp>
Public Member Functions | |
| AXP1xxPwron (SensorCommWrapper &core) | |
| Construct power-on key control interface. | |
| bool | setOnDurationMs (uint16_t ms) override |
| Set the power-on press duration threshold. | |
| bool | getOnDurationMs (uint16_t &ms) const override |
| Get the power-on press duration threshold. | |
| bool | setOffDurationMs (uint16_t ms) override |
| Set the power-off press duration threshold. | |
| bool | getOffDurationMs (uint16_t &ms) const override |
| Get the power-off press duration threshold. | |
| bool | setIrqDurationMs (uint16_t ms) override |
| Set the interrupt-trigger press duration threshold. | |
| bool | getIrqDurationMs (uint16_t &ms) const override |
| Get the interrupt-trigger press duration threshold. | |
Public Member Functions inherited from PmicButtonBase | |
| virtual | ~PmicButtonBase ()=default |
| Virtual destructor. | |
Definition at line 45 of file AXP1xxPwron.hpp.
|
inlineexplicit |
Construct power-on key control interface.
| core | Reference to the I2C communication wrapper. |
Definition at line 52 of file AXP1xxPwron.hpp.
|
inlineoverridevirtual |
Get the interrupt-trigger press duration threshold.
| [out] | ms | IRQ-level duration in milliseconds. |
| true | Value was read successfully. |
| false | I2C communication failed. |
Implements PmicButtonBase.
Definition at line 144 of file AXP1xxPwron.hpp.
References SensorCommWrapper::readReg().
|
inlineoverridevirtual |
Get the power-off press duration threshold.
| [out] | ms | Off-level duration in milliseconds. |
| true | Value was read successfully. |
| false | I2C communication failed. |
Implements PmicButtonBase.
Definition at line 111 of file AXP1xxPwron.hpp.
References SensorCommWrapper::readReg().
|
inlineoverridevirtual |
Get the power-on press duration threshold.
| [out] | ms | On-level duration in milliseconds. |
| true | Value was read successfully. |
| false | I2C communication failed. |
Implements PmicButtonBase.
Definition at line 78 of file AXP1xxPwron.hpp.
References SensorCommWrapper::readReg().
|
inlineoverridevirtual |
Set the interrupt-trigger press duration threshold.
Configures POK_SET bits 4-5. The closest valid value is selected.
| ms | Desired IRQ-level duration in milliseconds. Valid values: 1000, 1500, 2000, 2500. |
| true | IRQ-level was set successfully. |
| false | I2C communication failed. |
Implements PmicButtonBase.
Definition at line 130 of file AXP1xxPwron.hpp.
References SensorCommWrapper::updateBits().
|
inlineoverridevirtual |
Set the power-off press duration threshold.
Configures POK_SET bits 2-3. The closest valid value is selected.
| ms | Desired off-level duration in milliseconds. Valid values: 4000, 6000, 8000, 10000. |
| true | Off-level was set successfully. |
| false | I2C communication failed. |
Implements PmicButtonBase.
Definition at line 97 of file AXP1xxPwron.hpp.
References SensorCommWrapper::updateBits().
|
inlineoverridevirtual |
Set the power-on press duration threshold.
Configures POK_SET bits 0-1. The closest valid value is selected.
| ms | Desired on-level duration in milliseconds. Valid values: 128, 512, 1000, 2000. |
| true | On-level was set successfully. |
| false | I2C communication failed. |
Implements PmicButtonBase.
Definition at line 64 of file AXP1xxPwron.hpp.
References SensorCommWrapper::updateBits().