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

AXP517 PWRON button configuration driver. More...

#include <AXP517Pwron.hpp>

Inheritance diagram for AXP517Pwron:
[legend]

Public Member Functions

 AXP517Pwron (AXP517Core &core)
 Construct an AXP517 PWRON button driver.
 
bool setOnDurationMs (uint16_t ms) override
 Set the power-on debounce duration.
 
bool getOnDurationMs (uint16_t &ms) const override
 Get the current power-on debounce duration.
 
bool setOffDurationMs (uint16_t ms) override
 Set the power-off debounce duration.
 
bool getOffDurationMs (uint16_t &ms) const override
 Get the current power-off debounce duration.
 
bool setIrqDurationMs (uint16_t ms) override
 Set the button IRQ trigger duration.
 
bool getIrqDurationMs (uint16_t &ms) const override
 Get the current button IRQ trigger duration.
 
- Public Member Functions inherited from PmicButtonBase
virtual ~PmicButtonBase ()=default
 Virtual destructor.
 

Detailed Description

AXP517 PWRON button configuration driver.

Provides debounce and interrupt timing controls for the PMIC PWRON input.

Definition at line 41 of file AXP517Pwron.hpp.

Constructor & Destructor Documentation

◆ AXP517Pwron()

AXP517Pwron::AXP517Pwron ( AXP517Core core)
explicit

Construct an AXP517 PWRON button driver.

Parameters
coreShared AXP517 register transport.

Definition at line 37 of file AXP517Pwron.cpp.

Member Function Documentation

◆ getIrqDurationMs()

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

Get the current button IRQ trigger duration.

Parameters
msOutput parameter receiving the IRQ-level duration in milliseconds.
Return values
trueon success, false on register access failure.

Implements PmicButtonBase.

Definition at line 98 of file AXP517Pwron.cpp.

References axp517_regs::ctrl::PWRON_CFG, and SensorCommWrapper::readReg().

◆ getOffDurationMs()

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

Get the current power-off debounce duration.

Parameters
msOutput parameter receiving the off-level duration in milliseconds.
Return values
trueon success, false on register access failure.

Implements PmicButtonBase.

Definition at line 79 of file AXP517Pwron.cpp.

References axp517_regs::ctrl::PWRON_CFG, and SensorCommWrapper::readReg().

◆ getOnDurationMs()

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

Get the current power-on debounce duration.

Parameters
msOutput parameter receiving the on-level duration in milliseconds.
Return values
trueon success, false on register access failure.

Implements PmicButtonBase.

Definition at line 61 of file AXP517Pwron.cpp.

References axp517_regs::ctrl::PWRON_CFG, and SensorCommWrapper::readReg().

◆ setIrqDurationMs()

bool AXP517Pwron::setIrqDurationMs ( uint16_t  ms)
overridevirtual

Set the button IRQ trigger duration.

Note
Allowed values: 1000ms, 1500ms, 2000ms, 2500ms. Input is rounded up to the nearest allowed value.
Parameters
msDesired IRQ-level duration in milliseconds.
Return values
trueon success, false on register access failure.

Implements PmicButtonBase.

Definition at line 90 of file AXP517Pwron.cpp.

◆ setOffDurationMs()

bool AXP517Pwron::setOffDurationMs ( uint16_t  ms)
overridevirtual

Set the power-off debounce duration.

Note
Allowed values: 4000ms, 6000ms, 8000ms, 10000ms. Input is rounded up to the nearest allowed value.
Parameters
msDesired off-level duration in milliseconds.
Return values
trueon success, false on register access failure.

Implements PmicButtonBase.

Definition at line 71 of file AXP517Pwron.cpp.

◆ setOnDurationMs()

bool AXP517Pwron::setOnDurationMs ( uint16_t  ms)
overridevirtual

Set the power-on debounce duration.

Note
Allowed values: 128ms, 512ms, 1000ms, 2000ms. Input is rounded up to the nearest allowed value.
Parameters
msDesired on-level duration in milliseconds.
Return values
trueon success, false on register access failure.

Implements PmicButtonBase.

Definition at line 53 of file AXP517Pwron.cpp.


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