|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
AXP517 charge LED driver. More...
#include <AXP517Led.hpp>
Public Member Functions | |
| AXP517Led (AXP517Core &core) | |
| Construct an AXP517 LED driver. | |
| ~AXP517Led ()=default | |
| bool | setOutputType (OutputType type) override |
| Set the LED output type. | |
| bool | setMode (Mode mode) override |
| Set the LED mode. | |
| Mode | getMode () override |
| Get LED operating mode. | |
| bool | setManualState (ManualState state) override |
| Set the LED manual state. | |
| ManualState | getManualState () override |
| Get manual LED state (only meaningful when Mode::Manual is active). | |
Public Member Functions inherited from PmicLedBase | |
| virtual | ~PmicLedBase ()=default |
Additional Inherited Members | |
Public Types inherited from PmicLedBase | |
| enum class | OutputType : uint8_t { OpenDrain = 0 , PushPull = 1 } |
| enum class | Mode : uint8_t { AUTO = 0 , MANUAL = 1 , BREATH = 2 , DISABLE = 3 , VENDOR = 255 } |
| High-level LED operating mode (portable subset). More... | |
| enum class | ManualState : uint8_t { HiZ = 0 , LEVEL_LOW = 1 , LEVEL_HIGH = 2 , BLINK_1HZ = 3 , BLINK_4HZ = 4 , UNDEFINED = 255 } |
| Manual LED state (portable subset). More... | |
AXP517 charge LED driver.
Controls the AXP517 charge LED output type, automatic/manual mode, and manual output state.
Definition at line 42 of file AXP517Led.hpp.
|
explicit |
Construct an AXP517 LED driver.
| core | Shared AXP517 register transport. |
Definition at line 38 of file AXP517Led.cpp.
|
default |
|
overridevirtual |
Get manual LED state (only meaningful when Mode::Manual is active).
Implements PmicLedBase.
Definition at line 105 of file AXP517Led.cpp.
References PmicLedBase::BLINK_1HZ, PmicLedBase::BLINK_4HZ, axp517_regs::led::CHGLED_CFG, PmicLedBase::HiZ, PmicLedBase::LEVEL_HIGH, PmicLedBase::LEVEL_LOW, SensorCommWrapper::readReg(), and PmicLedBase::UNDEFINED.
|
overridevirtual |
Get LED operating mode.
Implements PmicLedBase.
Definition at line 73 of file AXP517Led.cpp.
References PmicLedBase::AUTO, PmicLedBase::BREATH, axp517_regs::led::CHGLED_CFG, PmicLedBase::DISABLE, SensorCommWrapper::getRegBit(), PmicLedBase::MANUAL, axp517_regs::ctrl::MODULE_EN1, SensorCommWrapper::readReg(), and PmicLedBase::VENDOR.
|
overridevirtual |
Set the LED manual state.
| state | The manual state to set. |
| true | on success, false on register access failure. |
Implements PmicLedBase.
Definition at line 90 of file AXP517Led.cpp.
References PmicLedBase::BLINK_1HZ, PmicLedBase::BLINK_4HZ, axp517_regs::led::CHGLED_CFG, PmicLedBase::HiZ, PmicLedBase::LEVEL_HIGH, PmicLedBase::LEVEL_LOW, and SensorCommWrapper::updateBits().
Referenced by setup().
|
overridevirtual |
Set the LED mode.
| mode | The mode to set. |
| true | on success, false on register access failure. |
Implements PmicLedBase.
Definition at line 55 of file AXP517Led.cpp.
References PmicLedBase::AUTO, PmicLedBase::BREATH, axp517_regs::led::CHGLED_CFG, SensorCommWrapper::clrRegBit(), PmicLedBase::DISABLE, PmicLedBase::MANUAL, axp517_regs::ctrl::MODULE_EN1, SensorCommWrapper::setRegBit(), and SensorCommWrapper::updateBits().
|
overridevirtual |
Set the LED output type.
| type | The output type to set. |
| true | on success, false on register access failure. |
Implements PmicLedBase.
Definition at line 42 of file AXP517Led.cpp.
References axp517_regs::led::CHGLED_CFG, PmicLedBase::OpenDrain, PmicLedBase::PushPull, and SensorCommWrapper::updateBits().