|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <AXP1xxPower.hpp>
Public Member Functions | |
| AXP1xxPower (SensorCommWrapper &core) | |
| Construct power management interface. | |
| bool | setMinimumSystemVoltage (uint32_t mv) override |
| Set minimum system voltage. | |
| uint32_t | getMinimumSystemVoltage () const override |
| Get minimum system voltage. | |
| bool | setInputVoltageLimit (uint32_t mv) override |
| Set input voltage limit (not supported by AXP1xx). | |
| uint32_t | getInputVoltageLimit () const override |
| Get input voltage limit (not supported by AXP1xx). | |
| bool | setInputCurrentLimit (uint32_t mA) override |
| Set input current limit. | |
| uint32_t | getInputCurrentLimit () const override |
| Get input current limit. | |
| bool | enableShipMode (bool enable) override |
| Enable or disable ship mode. | |
| bool | isShipModeEnabled () const override |
| Check if ship mode is enabled. | |
Public Member Functions inherited from PmicPowerBase | |
| virtual bool | enableBoost (bool enable) |
| Enable boost functionality. | |
| virtual bool | isBoostEnabled () const |
| Check if boost functionality is enabled. | |
| virtual bool | setBoostVoltage (uint16_t mv) |
| Set the boost voltage. | |
| virtual uint16_t | getBoostVoltage () const |
| Get the boost voltage. | |
| virtual | ~PmicPowerBase ()=default |
| Virtual destructor. | |
Definition at line 46 of file AXP1xxPower.hpp.
|
inlineexplicit |
Construct power management interface.
| core | Reference to the I2C communication wrapper. |
Definition at line 53 of file AXP1xxPower.hpp.
|
inlineoverridevirtual |
Enable or disable ship mode.
Ship mode disconnects the battery from the system by setting OFF_CTL register bit 7. When enabled and no external power is present, the system is completely powered down.
| enable | true to enter ship mode, false to exit. |
| true | Mode was set successfully. |
| false | I2C communication failed. |
Reimplemented from PmicPowerBase.
Definition at line 145 of file AXP1xxPower.hpp.
References SensorCommWrapper::clrRegBit(), and SensorCommWrapper::setRegBit().
|
inlineoverridevirtual |
Get input current limit.
Implements PmicPowerBase.
Definition at line 127 of file AXP1xxPower.hpp.
References SensorCommWrapper::readReg().
|
inlineoverridevirtual |
Get input voltage limit (not supported by AXP1xx).
Implements PmicPowerBase.
Definition at line 100 of file AXP1xxPower.hpp.
|
inlineoverridevirtual |
Get minimum system voltage.
Implements PmicPowerBase.
Definition at line 78 of file AXP1xxPower.hpp.
References SensorCommWrapper::readReg().
|
inlineoverridevirtual |
Check if ship mode is enabled.
Reimplemented from PmicPowerBase.
Definition at line 157 of file AXP1xxPower.hpp.
References SensorCommWrapper::getRegBit().
|
inlineoverridevirtual |
Set input current limit.
Configures the maximum input current drawn from VBUS via the IPS_SET register (bits 1-0). Exact encoding differs between AXP192 and AXP202 and is provided by Regs::pmu::encodeInputCurrentLimit().
| mA | Input current limit in milliamps. Request values are quantized to chip-supported levels. |
| true | Current limit was set successfully. |
| false | I2C communication failed. |
Implements PmicPowerBase.
Definition at line 117 of file AXP1xxPower.hpp.
References SensorCommWrapper::updateBits().
|
inlineoverridevirtual |
Set input voltage limit (not supported by AXP1xx).
| mv | Voltage in millivolts (ignored). |
Implements PmicPowerBase.
Definition at line 90 of file AXP1xxPower.hpp.
|
inlineoverridevirtual |
Set minimum system voltage.
Configures the minimum system voltage (VSYS) threshold via the VOFF_SET register. The value is clamped to the valid range and quantized to 100mV steps.
| mv | Desired minimum system voltage in millivolts (2600-3300mV). |
| true | Voltage was set successfully. |
| false | I2C communication failed. |
Implements PmicPowerBase.
Definition at line 66 of file AXP1xxPower.hpp.
References SensorCommWrapper::updateBits().