|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
AXP192 Power Output Channel Control. More...
#include <AXP192Channel.hpp>
Public Member Functions | |
| AXP192Channel (AXP192Core &core) | |
| Construct channel control interface. | |
| ~AXP192Channel ()=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 output voltage for a channel. | |
| uint16_t | getVoltage (uint8_t channel) override |
| Get current output voltage for a channel. | |
| uint8_t | count () const override |
| Get total number of power output channels. | |
| Info | getInfo (uint8_t channel) const override |
| Get channel information (type, name, min/max/step) | |
Public Member Functions inherited from PmicChannelBase | |
| virtual | ~PmicChannelBase ()=default |
| Virtual destructor. | |
Static Public Attributes | |
| static constexpr uint8_t | DCDC_COUNT = 3 |
| static constexpr uint8_t | LDO_COUNT = 4 |
| static constexpr uint8_t | CHANNEL_COUNT = 7 |
| 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_LDO2 = 3 |
| static constexpr uint8_t | CH_LDO3 = 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... | |
AXP192 Power Output Channel Control.
Provides enable/disable, voltage get/set, and channel enumeration for all 7 power output channels (3 DCDC + 4 LDO-type). Voltage setters automatically quantize to the nearest valid step. Inherits from PmicChannelBase for polymorphic PMIC integration.
Definition at line 59 of file AXP192Channel.hpp.
|
explicit |
Construct channel control interface.
| core | Reference to AXP192 core communication object |
Definition at line 37 of file AXP192Channel.cpp.
|
default |
|
overridevirtual |
Get total number of power output channels.
Implements PmicChannelBase.
Definition at line 183 of file AXP192Channel.cpp.
References CHANNEL_COUNT.
|
overridevirtual |
Enable or disable a power output channel.
| channel | Channel identifier (CH_DCDC1 through CH_EXTEN) |
| enable | true to turn on, false to turn off |
Implements PmicChannelBase.
Definition at line 55 of file AXP192Channel.cpp.
References CH_LDOio, CHANNEL_COUNT, SensorCommWrapper::clrRegBit(), enable(), axp192_regs::gpio::GPIO0_CTL, axp192_regs::pwr::LDO23_DC123_EXT_CTL, SensorCommWrapper::readReg(), SensorCommWrapper::setRegBit(), and SensorCommWrapper::writeReg().
Referenced by enable().
|
overridevirtual |
Get channel information (type, name, min/max/step)
| channel | Channel identifier |
Implements PmicChannelBase.
Definition at line 188 of file AXP192Channel.cpp.
References CH_DCDC1, CH_DCDC2, CH_DCDC3, CH_EXTEN, CH_LDO2, CH_LDO3, CH_LDOio, CHANNEL_COUNT, PmicChannelBase::DCDC, and PmicChannelBase::LDO.
|
overridevirtual |
Get current output voltage for a channel.
| channel | Channel identifier |
Implements PmicChannelBase.
Definition at line 138 of file AXP192Channel.cpp.
References CH_DCDC1, CH_DCDC2, CH_DCDC3, CH_EXTEN, CH_LDO2, CH_LDO3, CH_LDOio, CHANNEL_COUNT, axp192_regs::pwr::DC1_VOLTAGE, axp192_regs::pwr::DC2OUT_VOL, axp192_regs::pwr::DC3OUT_VOL, axp192_regs::gpio::GPIO0_VOL, axp192_regs::pwr::LDO23OUT_VOL, and SensorCommWrapper::readReg().
|
overridevirtual |
Check whether a power output channel is enabled.
| channel | Channel identifier (CH_DCDC1 through CH_EXTEN) |
Implements PmicChannelBase.
Definition at line 75 of file AXP192Channel.cpp.
References CH_LDOio, CHANNEL_COUNT, SensorCommWrapper::getRegBit(), axp192_regs::gpio::GPIO0_CTL, axp192_regs::pwr::LDO23_DC123_EXT_CTL, and SensorCommWrapper::readReg().
|
overridevirtual |
Set output voltage for a channel.
Valid ranges and step sizes:
| channel | Channel identifier |
| mV | Desired voltage in millivolts |
Implements PmicChannelBase.
Definition at line 90 of file AXP192Channel.cpp.
References CH_DCDC1, CH_DCDC2, CH_DCDC3, CH_EXTEN, CH_LDO2, CH_LDO3, CH_LDOio, CHANNEL_COUNT, axp192_regs::pwr::DC1_VOLTAGE, axp192_regs::pwr::DC2OUT_VOL, axp192_regs::pwr::DC3OUT_VOL, axp192_regs::gpio::GPIO0_VOL, axp192_regs::pwr::LDO23OUT_VOL, and SensorCommWrapper::updateBits().
|
staticconstexpr |
Definition at line 66 of file AXP192Channel.hpp.
Referenced by getInfo(), getVoltage(), setup(), and setVoltage().
|
staticconstexpr |
Definition at line 67 of file AXP192Channel.hpp.
Referenced by getInfo(), getVoltage(), and setVoltage().
|
staticconstexpr |
Definition at line 68 of file AXP192Channel.hpp.
Referenced by getInfo(), getVoltage(), setup(), and setVoltage().
|
staticconstexpr |
Definition at line 72 of file AXP192Channel.hpp.
Referenced by getInfo(), getVoltage(), and setVoltage().
|
staticconstexpr |
Definition at line 69 of file AXP192Channel.hpp.
Referenced by getInfo(), getVoltage(), and setVoltage().
|
staticconstexpr |
Definition at line 70 of file AXP192Channel.hpp.
Referenced by getInfo(), getVoltage(), and setVoltage().
|
staticconstexpr |
Definition at line 71 of file AXP192Channel.hpp.
Referenced by enable(), getInfo(), getVoltage(), isEnabled(), and setVoltage().
|
staticconstexpr |
Definition at line 64 of file AXP192Channel.hpp.
Referenced by count(), enable(), getInfo(), getVoltage(), isEnabled(), and setVoltage().
|
staticconstexpr |
Definition at line 62 of file AXP192Channel.hpp.
|
staticconstexpr |
Definition at line 63 of file AXP192Channel.hpp.