|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <AXP1xxLed.hpp>
Public Member Functions | |
| AXP1xxLed (SensorCommWrapper &core) | |
| Construct LED control interface. | |
| bool | setOutputType (OutputType type) override |
| Set LED output type (no-op, always succeeds). | |
| bool | setMode (Mode mode) override |
| Set LED operating mode. | |
| Mode | getMode () override |
| Get the current LED operating mode. | |
| bool | setManualState (ManualState state) override |
| Set the LED state in manual mode. | |
| ManualState | getManualState () override |
| Get the current LED state in manual mode. | |
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... | |
Definition at line 42 of file AXP1xxLed.hpp.
|
inlineexplicit |
Construct LED control interface.
| core | Reference to the I2C communication wrapper. |
Definition at line 49 of file AXP1xxLed.hpp.
|
inlineoverridevirtual |
Get the current LED state in manual mode.
Implements PmicLedBase.
Definition at line 139 of file AXP1xxLed.hpp.
References PmicLedBase::BLINK_1HZ, PmicLedBase::BLINK_4HZ, SensorCommWrapper::getRegBit(), PmicLedBase::HiZ, PmicLedBase::LEVEL_LOW, SensorCommWrapper::readReg(), and PmicLedBase::UNDEFINED.
Get the current LED operating mode.
Implements PmicLedBase.
Definition at line 93 of file AXP1xxLed.hpp.
References PmicLedBase::AUTO, SensorCommWrapper::getRegBit(), and PmicLedBase::MANUAL.
|
inlineoverridevirtual |
Set the LED state in manual mode.
Automatically switches to manual mode if not already set. Programs bits 5-4 of the OFF_CTL register.
| state | Desired LED state. LEVEL_LOW: drive pin low (0x30). BLINK_1HZ: blink at 1 Hz (0x10). BLINK_4HZ: blink at 4 Hz (0x20). HiZ: high-impedance (0x00). |
| true | State was set successfully. |
| false | Invalid state or I2C communication failed. |
Implements PmicLedBase.
Definition at line 117 of file AXP1xxLed.hpp.
References PmicLedBase::BLINK_1HZ, PmicLedBase::BLINK_4HZ, PmicLedBase::HiZ, PmicLedBase::LEVEL_HIGH, PmicLedBase::LEVEL_LOW, SensorCommWrapper::setRegBit(), and SensorCommWrapper::updateBits().
Referenced by setup().
Set LED operating mode.
Controls OFF_CTL register bit 3.
| mode | LED operating mode. |
| true | Mode was set successfully. |
| false | Invalid mode or I2C communication failed. |
Implements PmicLedBase.
Definition at line 74 of file AXP1xxLed.hpp.
References PmicLedBase::AUTO, SensorCommWrapper::clrRegBit(), PmicLedBase::DISABLE, PmicLedBase::MANUAL, SensorCommWrapper::setRegBit(), and SensorCommWrapper::updateBits().
Referenced by setup().
|
inlineoverridevirtual |
Set LED output type (no-op, always succeeds).
| type | Output type (ignored). |
Implements PmicLedBase.
Definition at line 56 of file AXP1xxLed.hpp.