|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
AXP202 power channel enable and voltage control. More...
#include <AXP202Channel.hpp>
Public Member Functions | |
| AXP202Channel (AXP202Core &core) | |
| Construct AXP202 channel control interface. | |
| ~AXP202Channel ()=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 of a power channel. | |
| uint16_t | getVoltage (uint8_t channel) override |
| Get the current output voltage of a power channel. | |
| uint8_t | count () const override |
| Get the number of available power channels. | |
| Info | getInfo (uint8_t channel) const override |
| Get information about a specific channel. | |
Public Member Functions inherited from PmicChannelBase | |
| virtual | ~PmicChannelBase ()=default |
| Virtual destructor. | |
Static Public Attributes | |
| static constexpr uint8_t | CHANNEL_COUNT = 7 |
| static constexpr uint8_t | CH_DCDC2 = 0 |
| static constexpr uint8_t | CH_DCDC3 = 1 |
| static constexpr uint8_t | CH_LDO2 = 2 |
| static constexpr uint8_t | CH_LDO3 = 3 |
| static constexpr uint8_t | CH_LDO4 = 4 |
| static constexpr uint8_t | CH_LDOio = 5 |
| static constexpr uint8_t | CH_EXTEN = 6 |
Additional Inherited Members | |
Public Types inherited from PmicChannelBase | |
| enum class | Type : uint8_t { DCDC = 0 , LDO = 1 } |
| Regulator type classification. More... | |
AXP202 power channel enable and voltage control.
Implements PmicChannelBase to provide enable/disable and voltage setting for all seven AXP202 output rails. Each channel maps to a unique register and bit position in the power control register map.
Definition at line 61 of file AXP202Channel.hpp.
|
explicit |
Construct AXP202 channel control interface.
| core | Reference to AXP202 core communication |
Definition at line 42 of file AXP202Channel.cpp.
|
default |
|
overridevirtual |
Get the number of available power channels.
Implements PmicChannelBase.
Definition at line 214 of file AXP202Channel.cpp.
References CHANNEL_COUNT.
|
overridevirtual |
Enable or disable a power output channel.
| channel | Channel identifier (CH_DCDC2 .. CH_EXTEN) |
| enable | true to turn on, false to turn off |
Implements PmicChannelBase.
Definition at line 46 of file AXP202Channel.cpp.
References axp202_regs::BIT_DCDC2, axp202_regs::BIT_DCDC3, axp202_regs::BIT_EXTEN, axp202_regs::BIT_LDO2, axp202_regs::BIT_LDO3, axp202_regs::BIT_LDO4, CH_DCDC2, CH_DCDC3, CH_EXTEN, CH_LDO2, CH_LDO3, CH_LDO4, CH_LDOio, CHANNEL_COUNT, SensorCommWrapper::clrRegBit(), enable(), axp202_regs::gpio::GPIO0_CTL, axp202_regs::pmu::LDO234_DC23_CTL, SensorCommWrapper::readReg(), SensorCommWrapper::setRegBit(), and SensorCommWrapper::writeReg().
Referenced by enable().
|
overridevirtual |
Get information about a specific channel.
| channel | Channel identifier |
Implements PmicChannelBase.
Definition at line 219 of file AXP202Channel.cpp.
References CH_DCDC2, CH_DCDC3, CH_EXTEN, CH_LDO2, CH_LDO3, CH_LDO4, CH_LDOio, CHANNEL_COUNT, PmicChannelBase::DCDC, and PmicChannelBase::LDO.
|
overridevirtual |
Get the current output voltage of a power channel.
| channel | Channel identifier |
Implements PmicChannelBase.
Definition at line 165 of file AXP202Channel.cpp.
References CH_DCDC2, CH_DCDC3, CH_EXTEN, CH_LDO2, CH_LDO3, CH_LDO4, CH_LDOio, CHANNEL_COUNT, axp202_regs::pmu::DC2OUT_VOL, axp202_regs::pmu::DC3OUT_VOL, axp202_regs::gpio::GPIO0_VOL, axp202_regs::pmu::LDO24OUT_VOL, axp202_regs::pmu::LDO3OUT_VOL, and SensorCommWrapper::readReg().
|
overridevirtual |
Check whether a power output channel is enabled.
| channel | Channel identifier |
Implements PmicChannelBase.
Definition at line 84 of file AXP202Channel.cpp.
References axp202_regs::BIT_DCDC2, axp202_regs::BIT_DCDC3, axp202_regs::BIT_EXTEN, axp202_regs::BIT_LDO2, axp202_regs::BIT_LDO3, axp202_regs::BIT_LDO4, CH_DCDC2, CH_DCDC3, CH_EXTEN, CH_LDO2, CH_LDO3, CH_LDO4, CH_LDOio, CHANNEL_COUNT, SensorCommWrapper::getRegBit(), axp202_regs::gpio::GPIO0_CTL, axp202_regs::pmu::LDO234_DC23_CTL, and SensorCommWrapper::readReg().
|
overridevirtual |
Set the output voltage of a power channel.
| channel | Channel identifier (DCDC2, DCDC3, LDO2, LDO3, LDO4, or LDOio) |
| mV | Desired voltage in millivolts |
Implements PmicChannelBase.
Definition at line 111 of file AXP202Channel.cpp.
References CH_DCDC2, CH_DCDC3, CH_EXTEN, CH_LDO2, CH_LDO3, CH_LDO4, CH_LDOio, CHANNEL_COUNT, axp202_regs::pmu::DC2OUT_VOL, axp202_regs::pmu::DC3OUT_VOL, axp202_regs::gpio::GPIO0_VOL, i, axp202_regs::pmu::LDO24OUT_VOL, axp202_regs::pmu::LDO3OUT_VOL, and SensorCommWrapper::updateBits().
|
staticconstexpr |
Definition at line 66 of file AXP202Channel.hpp.
Referenced by enable(), getInfo(), getVoltage(), isEnabled(), setup(), and setVoltage().
|
staticconstexpr |
Definition at line 67 of file AXP202Channel.hpp.
Referenced by enable(), getInfo(), getVoltage(), isEnabled(), and setVoltage().
|
staticconstexpr |
Definition at line 72 of file AXP202Channel.hpp.
Referenced by enable(), getInfo(), getVoltage(), isEnabled(), and setVoltage().
|
staticconstexpr |
Definition at line 68 of file AXP202Channel.hpp.
Referenced by enable(), getInfo(), getVoltage(), isEnabled(), and setVoltage().
|
staticconstexpr |
Definition at line 69 of file AXP202Channel.hpp.
Referenced by enable(), getInfo(), getVoltage(), isEnabled(), setup(), and setVoltage().
|
staticconstexpr |
Definition at line 70 of file AXP202Channel.hpp.
Referenced by enable(), getInfo(), getVoltage(), isEnabled(), setup(), and setVoltage().
|
staticconstexpr |
Definition at line 71 of file AXP202Channel.hpp.
Referenced by enable(), getInfo(), getVoltage(), isEnabled(), and setVoltage().
|
staticconstexpr |
Definition at line 64 of file AXP202Channel.hpp.
Referenced by count(), enable(), getInfo(), getVoltage(), isEnabled(), and setVoltage().