SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP2101Pwron Class Reference

Power-on / power-button timing control for the AXP2101 PMIC. More...

#include <AXP2101Pwron.hpp>

Inheritance diagram for AXP2101Pwron:
[legend]

Public Member Functions

 AXP2101Pwron (AXP2101Core &core)
 
 ~AXP2101Pwron ()=default
 
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.
 
bool setOffDurationMs (uint16_t ms) override
 Set the power-off delay (held duration to turn off).
 
bool getOffDurationMs (uint16_t &ms) const override
 Get the power-off delay setting.
 
bool setIrqDurationMs (uint16_t ms) override
 Set the short-press / IRQ trigger delay.
 
bool getIrqDurationMs (uint16_t &ms) const override
 Get the short-press / IRQ trigger delay.
 
- Public Member Functions inherited from PmicButtonBase
virtual ~PmicButtonBase ()=default
 Virtual destructor.
 

Detailed Description

Power-on / power-button timing control for the AXP2101 PMIC.

Configures the PEKEY (power key) press durations for:

  • Power-on trigger: how long the key must be held to turn the system on
  • Power-off trigger: how long the key must be held to turn the system off
  • IRQ trigger: how long the key must be held to generate an interrupt (short press detection)

Definition at line 45 of file AXP2101Pwron.hpp.

Constructor & Destructor Documentation

◆ AXP2101Pwron()

AXP2101Pwron::AXP2101Pwron ( AXP2101Core core)
explicit

Definition at line 38 of file AXP2101Pwron.cpp.

◆ ~AXP2101Pwron()

AXP2101Pwron::~AXP2101Pwron ( )
default

Member Function Documentation

◆ getIrqDurationMs()

bool AXP2101Pwron::getIrqDurationMs ( uint16_t &  ms) const
overridevirtual

Get the short-press / IRQ trigger delay.

Parameters
[out]msDuration in milliseconds.
Returns
true on success.

Implements PmicButtonBase.

Definition at line 94 of file AXP2101Pwron.cpp.

References axp2101_regs::pmu::IRQ_OFF_ON_LEVEL, and SensorCommWrapper::readReg().

◆ getOffDurationMs()

bool AXP2101Pwron::getOffDurationMs ( uint16_t &  ms) const
overridevirtual

Get the power-off delay setting.

Parameters
[out]msDuration in milliseconds.
Returns
true on success.

Implements PmicButtonBase.

Definition at line 77 of file AXP2101Pwron.cpp.

References axp2101_regs::pmu::IRQ_OFF_ON_LEVEL, and SensorCommWrapper::readReg().

◆ getOnDurationMs()

bool AXP2101Pwron::getOnDurationMs ( uint16_t &  ms) const
overridevirtual

Get the power-on delay setting.

Parameters
[out]msDuration in milliseconds.
Returns
true on success.

Implements PmicButtonBase.

Definition at line 60 of file AXP2101Pwron.cpp.

References axp2101_regs::pmu::IRQ_OFF_ON_LEVEL, and SensorCommWrapper::readReg().

◆ setIrqDurationMs()

bool AXP2101Pwron::setIrqDurationMs ( uint16_t  ms)
overridevirtual

Set the short-press / IRQ trigger delay.

Parameters
msDuration in milliseconds. Allowed value is 1000ms,1500ms,2000ms,2500ms
Returns
true on success.

Implements PmicButtonBase.

Definition at line 86 of file AXP2101Pwron.cpp.

◆ setOffDurationMs()

bool AXP2101Pwron::setOffDurationMs ( uint16_t  ms)
overridevirtual

Set the power-off delay (held duration to turn off).

Parameters
msDuration in milliseconds. Allowed value is 4000ms,6000ms,8000ms,10000ms
Returns
true on success.

Implements PmicButtonBase.

Definition at line 69 of file AXP2101Pwron.cpp.

◆ setOnDurationMs()

bool AXP2101Pwron::setOnDurationMs ( uint16_t  ms)
overridevirtual

Set the power-on delay (held duration to turn on).

Parameters
msDuration in milliseconds. Allowed value is 128ms,512ms,1000ms,2000ms
Returns
true on success.

Implements PmicButtonBase.

Definition at line 52 of file AXP2101Pwron.cpp.


The documentation for this class was generated from the following files: