|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
Charging indicator LED control for the AXP2101 PMIC. More...
#include <AXP2101Led.hpp>
Public Member Functions | |
| AXP2101Led (AXP2101Core &core) | |
| ~AXP2101Led ()=default | |
| bool | setOutputType (OutputType type) override |
| Set the LED output driver type. | |
| bool | setMode (Mode mode) override |
| Set the LED operating mode. | |
| Mode | getMode () override |
| Get the current LED operating mode. | |
| bool | setManualState (ManualState state) override |
| For manual mode, set the LED output state. | |
| ManualState | getManualState () override |
| Get the current manual LED state. | |
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... | |
Charging indicator LED control for the AXP2101 PMIC.
Controls the CHGLED pin (register 0x69) which can be configured as:
Definition at line 44 of file AXP2101Led.hpp.
|
explicit |
Definition at line 38 of file AXP2101Led.cpp.
|
default |
|
overridevirtual |
Get the current manual LED state.
Implements PmicLedBase.
Definition at line 96 of file AXP2101Led.cpp.
References PmicLedBase::BLINK_1HZ, PmicLedBase::BLINK_4HZ, axp2101_regs::chg::CHGLED_CFG, PmicLedBase::LEVEL_HIGH, PmicLedBase::LEVEL_LOW, SensorCommWrapper::readReg(), and PmicLedBase::UNDEFINED.
Referenced by loop().
|
overridevirtual |
Get the current LED operating mode.
Implements PmicLedBase.
Definition at line 63 of file AXP2101Led.cpp.
References PmicLedBase::AUTO, axp2101_regs::chg::CHGLED_CFG, PmicLedBase::DISABLE, PmicLedBase::MANUAL, SensorCommWrapper::readReg(), and PmicLedBase::VENDOR.
|
overridevirtual |
For manual mode, set the LED output state.
| state | On or Off. |
Implements PmicLedBase.
Definition at line 79 of file AXP2101Led.cpp.
References PmicLedBase::BLINK_1HZ, PmicLedBase::BLINK_4HZ, axp2101_regs::chg::CHGLED_CFG, PmicLedBase::HiZ, PmicLedBase::LEVEL_HIGH, PmicLedBase::LEVEL_LOW, and SensorCommWrapper::updateBits().
Referenced by loop().
|
overridevirtual |
Set the LED operating mode.
| mode | Automatic or Manual control mode. |
Implements PmicLedBase.
Definition at line 49 of file AXP2101Led.cpp.
References PmicLedBase::AUTO, axp2101_regs::chg::CHGLED_CFG, PmicLedBase::DISABLE, PmicLedBase::MANUAL, and SensorCommWrapper::updateBits().
Referenced by loop().
|
overridevirtual |
Set the LED output driver type.
| type | PushPull or OpenDrain configuration. |
Implements PmicLedBase.
Definition at line 43 of file AXP2101Led.cpp.