|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
Power output channel (DCDC / LDO) control for the AXP2101 PMIC. More...
#include <AXP2101Channel.hpp>
Public Member Functions | |
| AXP2101Channel (AXP2101Core &core) | |
| ~AXP2101Channel ()=default | |
| bool | enable (uint8_t channel, bool enable) override |
| Enable or disable a power output channel. | |
| bool | isEnabled (uint8_t channel) override |
| Check whether a power output channel is enabled. | |
| bool | setVoltage (uint8_t channel, uint16_t mV) override |
| Set the output voltage for a DCDC or LDO channel. | |
| uint16_t | getVoltage (uint8_t channel) override |
| Get the current output voltage setting for a channel. | |
| uint8_t | count () const override |
| Get the total number of available power channels. | |
| Info | getInfo (uint8_t channel) const override |
| Get information about a specific power channel. | |
Public Member Functions inherited from PmicChannelBase | |
| virtual | ~PmicChannelBase ()=default |
| Virtual destructor. | |
Static Public Attributes | |
| static constexpr uint8_t | DCDC_COUNT = 5 |
| Number of DCDC converters. | |
| static constexpr uint8_t | LDO_COUNT = 9 |
| Number of LDO regulators. | |
| static constexpr uint8_t | CHANNEL_COUNT = DCDC_COUNT + LDO_COUNT |
| Total number of power channels. | |
| static constexpr uint8_t | CH_DCDC1 = 0 |
| static constexpr uint8_t | CH_DCDC2 = 1 |
| static constexpr uint8_t | CH_DCDC3 = 2 |
| static constexpr uint8_t | CH_DCDC4 = 3 |
| static constexpr uint8_t | CH_DCDC5 = 4 |
| static constexpr uint8_t | CH_ALDO1 = 5 |
| static constexpr uint8_t | CH_ALDO2 = 6 |
| static constexpr uint8_t | CH_ALDO3 = 7 |
| static constexpr uint8_t | CH_ALDO4 = 8 |
| static constexpr uint8_t | CH_BLDO1 = 9 |
| static constexpr uint8_t | CH_BLDO2 = 10 |
| static constexpr uint8_t | CH_CPUSLDO = 11 |
| static constexpr uint8_t | CH_DLDO1 = 12 |
| static constexpr uint8_t | CH_DLDO2 = 13 |
Additional Inherited Members | |
Public Types inherited from PmicChannelBase | |
| enum class | Type : uint8_t { DCDC = 0 , LDO = 1 } |
| Regulator type classification. More... | |
Power output channel (DCDC / LDO) control for the AXP2101 PMIC.
The AXP2101 provides 5 DCDC converters and 9 LDO regulators (14 channels total). Each channel can be independently enabled/disabled and its output voltage set.
Definition at line 56 of file AXP2101Channel.hpp.
|
explicit |
Definition at line 37 of file AXP2101Channel.cpp.
|
default |
|
overridevirtual |
Get the total number of available power channels.
Implements PmicChannelBase.
Definition at line 215 of file AXP2101Channel.cpp.
References CHANNEL_COUNT.
|
overridevirtual |
Enable or disable a power output channel.
| channel | Channel index (0-13). |
| enable | true to power on, false to power off. |
Implements PmicChannelBase.
Definition at line 41 of file AXP2101Channel.cpp.
References CHANNEL_COUNT, SensorCommWrapper::clrRegBit(), DCDC_COUNT, enable(), axp2101_regs::ldo::ONOFF_CTRL0, axp2101_regs::ldo::ONOFF_CTRL1, axp2101_regs::dcdc::ONOFF_DVM_CTRL, and SensorCommWrapper::setRegBit().
Referenced by enable().
|
overridevirtual |
Get information about a specific power channel.
| channel | Channel index (0-13). |
Implements PmicChannelBase.
Definition at line 220 of file AXP2101Channel.cpp.
References CH_ALDO1, CH_ALDO2, CH_ALDO3, CH_ALDO4, CH_BLDO1, CH_BLDO2, CH_CPUSLDO, CH_DCDC1, CH_DCDC2, CH_DCDC3, CH_DCDC4, CH_DCDC5, CH_DLDO1, CH_DLDO2, CHANNEL_COUNT, PmicChannelBase::DCDC, and PmicChannelBase::LDO.
|
overridevirtual |
Get the current output voltage setting for a channel.
| channel | Channel index (0-13). |
Implements PmicChannelBase.
Definition at line 161 of file AXP2101Channel.cpp.
References CH_DCDC1, CH_DCDC2, CH_DCDC3, CH_DCDC4, CH_DCDC5, CHANNEL_COUNT, DCDC_COUNT, SensorCommWrapper::readReg(), axp2101_regs::dcdc::VOL0_CTRL, axp2101_regs::ldo::VOL0_CTRL, axp2101_regs::dcdc::VOL1_CTRL, axp2101_regs::ldo::VOL1_CTRL, axp2101_regs::dcdc::VOL2_CTRL, axp2101_regs::ldo::VOL2_CTRL, axp2101_regs::dcdc::VOL3_CTRL, axp2101_regs::ldo::VOL3_CTRL, axp2101_regs::dcdc::VOL4_CTRL, axp2101_regs::ldo::VOL4_CTRL, axp2101_regs::ldo::VOL5_CTRL, axp2101_regs::ldo::VOL6_CTRL, axp2101_regs::ldo::VOL7_CTRL, and axp2101_regs::ldo::VOL8_CTRL.
|
overridevirtual |
Check whether a power output channel is enabled.
| channel | Channel index (0-13). |
Implements PmicChannelBase.
Definition at line 56 of file AXP2101Channel.cpp.
References CHANNEL_COUNT, DCDC_COUNT, SensorCommWrapper::getRegBit(), axp2101_regs::ldo::ONOFF_CTRL0, axp2101_regs::ldo::ONOFF_CTRL1, and axp2101_regs::dcdc::ONOFF_DVM_CTRL.
|
overridevirtual |
Set the output voltage for a DCDC or LDO channel.
Value will be clamped to the channel's valid range and quantized to the nearest valid step size.
| channel | Channel index (0-13). |
| mV | Desired output voltage in millivolts. |
Implements PmicChannelBase.
Definition at line 70 of file AXP2101Channel.cpp.
References CH_DCDC1, CH_DCDC2, CH_DCDC3, CH_DCDC4, CH_DCDC5, CHANNEL_COUNT, DCDC_COUNT, SensorCommWrapper::updateBits(), axp2101_regs::dcdc::VOL0_CTRL, axp2101_regs::ldo::VOL0_CTRL, axp2101_regs::dcdc::VOL1_CTRL, axp2101_regs::ldo::VOL1_CTRL, axp2101_regs::dcdc::VOL2_CTRL, axp2101_regs::ldo::VOL2_CTRL, axp2101_regs::dcdc::VOL3_CTRL, axp2101_regs::ldo::VOL3_CTRL, axp2101_regs::dcdc::VOL4_CTRL, axp2101_regs::ldo::VOL4_CTRL, axp2101_regs::ldo::VOL5_CTRL, axp2101_regs::ldo::VOL6_CTRL, axp2101_regs::ldo::VOL7_CTRL, and axp2101_regs::ldo::VOL8_CTRL.
|
staticconstexpr |
Definition at line 71 of file AXP2101Channel.hpp.
|
staticconstexpr |
Definition at line 72 of file AXP2101Channel.hpp.
Referenced by getInfo().
|
staticconstexpr |
Definition at line 73 of file AXP2101Channel.hpp.
Referenced by getInfo().
|
staticconstexpr |
Definition at line 74 of file AXP2101Channel.hpp.
Referenced by getInfo().
|
staticconstexpr |
Definition at line 75 of file AXP2101Channel.hpp.
Referenced by getInfo().
|
staticconstexpr |
Definition at line 76 of file AXP2101Channel.hpp.
Referenced by getInfo().
|
staticconstexpr |
Definition at line 77 of file AXP2101Channel.hpp.
Referenced by getInfo().
|
staticconstexpr |
Definition at line 66 of file AXP2101Channel.hpp.
Referenced by getInfo(), getVoltage(), setup(), and setVoltage().
|
staticconstexpr |
Definition at line 67 of file AXP2101Channel.hpp.
Referenced by getInfo(), getVoltage(), and setVoltage().
|
staticconstexpr |
Definition at line 68 of file AXP2101Channel.hpp.
Referenced by getInfo(), getVoltage(), and setVoltage().
|
staticconstexpr |
Definition at line 69 of file AXP2101Channel.hpp.
Referenced by getInfo(), getVoltage(), and setVoltage().
|
staticconstexpr |
Definition at line 70 of file AXP2101Channel.hpp.
Referenced by getInfo(), getVoltage(), and setVoltage().
|
staticconstexpr |
Definition at line 78 of file AXP2101Channel.hpp.
Referenced by getInfo().
|
staticconstexpr |
Definition at line 79 of file AXP2101Channel.hpp.
Referenced by getInfo().
|
staticconstexpr |
Total number of power channels.
Definition at line 64 of file AXP2101Channel.hpp.
Referenced by count(), enable(), getInfo(), getVoltage(), isEnabled(), and setVoltage().
|
staticconstexpr |
Number of DCDC converters.
Definition at line 60 of file AXP2101Channel.hpp.
Referenced by enable(), getVoltage(), isEnabled(), and setVoltage().
|
staticconstexpr |
Number of LDO regulators.
Definition at line 62 of file AXP2101Channel.hpp.