|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <SY6970Charger.hpp>
Public Member Functions | |
| SY6970Charger (SY6970Core &core) | |
| ~SY6970Charger ()=default | |
| bool | enableCharging (bool enable) override |
| Enable/disable charging. | |
| bool | isCharging () override |
| Check whether charger is currently charging (best-effort). | |
| bool | setPreChargeCurrent (uint16_t mA) override |
| Set pre-charge current. | |
| uint16_t | getPreChargeCurrent () override |
| Get pre-charge current. | |
| bool | setFastChargeCurrent (uint16_t mA) override |
| Set fast charge (constant-current) current. | |
| uint16_t | getFastChargeCurrent () override |
| Get fast charge (constant-current) current. | |
| bool | setTerminationCurrent (uint16_t mA) override |
| Set termination current. | |
| uint16_t | getTerminationCurrent () override |
| Get termination current. | |
| bool | setChargeVoltage (uint16_t mV) override |
| Set charge voltage (CV). | |
| uint16_t | getChargeVoltage () override |
| Get charge voltage (CV). | |
| Status | getStatus () override |
| Get charger status. | |
Public Member Functions inherited from PmicChargerBase | |
| virtual | ~PmicChargerBase ()=default |
| Virtual destructor. | |
Additional Inherited Members | |
Public Types inherited from PmicChargerBase | |
| enum class | ChargingStatus : uint8_t { NO_CHARGING = 0 , PRE_CHARGE = 1 , FAST_CHARGE = 2 , TERMINATION = 3 , UNKNOWN = 0xFF } |
| Charging status enumeration. More... | |
Definition at line 35 of file SY6970Charger.hpp.
|
explicit |
Definition at line 38 of file SY6970Charger.cpp.
|
default |
|
overridevirtual |
Enable/disable charging.
| enable | true to enable charging, false to disable. |
Implements PmicChargerBase.
Definition at line 40 of file SY6970Charger.cpp.
References SensorCommWrapper::updateBits().
|
overridevirtual |
Get charge voltage (CV).
Implements PmicChargerBase.
Definition at line 133 of file SY6970Charger.cpp.
References SensorCommWrapper::readReg().
Referenced by setup().
|
overridevirtual |
Get fast charge (constant-current) current.
Implements PmicChargerBase.
Definition at line 92 of file SY6970Charger.cpp.
References SensorCommWrapper::readReg().
Referenced by setup().
|
overridevirtual |
Get pre-charge current.
Implements PmicChargerBase.
Definition at line 69 of file SY6970Charger.cpp.
References SensorCommWrapper::readReg().
Referenced by setup().
|
overridevirtual |
Get charger status.
Implements PmicChargerBase.
Definition at line 144 of file SY6970Charger.cpp.
References PmicChargerBase::Status::chargeDone, PmicChargerBase::Status::charging, PmicChargerBase::Status::chargingStatus, PmicChargerBase::FAST_CHARGE, PmicChargerBase::Status::fault, PmicChargerBase::Status::faultCode, SY6970Core::getChargeStatus(), SY6970Core::getFaultStatus(), SY6970Core::isChargeDone(), SY6970Core::isCharging(), SY6970Core::isValid(), SY6970Core::isVbusPresent(), PmicChargerBase::NO_CHARGING, PmicChargerBase::Status::online, PmicChargerBase::PRE_CHARGE, PmicChargerBase::TERMINATION, PmicChargerBase::UNKNOWN, and PmicChargerBase::Status::vbusPresent.
Referenced by loop().
|
overridevirtual |
Get termination current.
Implements PmicChargerBase.
Definition at line 112 of file SY6970Charger.cpp.
References SensorCommWrapper::readReg().
Referenced by setup().
|
overridevirtual |
Check whether charger is currently charging (best-effort).
Implements PmicChargerBase.
Definition at line 51 of file SY6970Charger.cpp.
References SY6970Core::isCharging().
Referenced by loop().
|
overridevirtual |
Set charge voltage (CV).
| mV | Charge voltage in millivolts. Value will be quantized to nearest valid step (16mV). |
Implements PmicChargerBase.
Definition at line 120 of file SY6970Charger.cpp.
References SensorCommWrapper::updateBits().
Referenced by setup().
|
overridevirtual |
Set fast charge (constant-current) current.
| mA | Fast charge current in milliamps. Value will be quantized to nearest valid step (64mA). |
Implements PmicChargerBase.
Definition at line 77 of file SY6970Charger.cpp.
References SensorCommWrapper::updateBits().
Referenced by setup().
|
overridevirtual |
Set pre-charge current.
| mA | Pre-charge current in milliamps. Value will be quantized to nearest valid step (64mA). |
Implements PmicChargerBase.
Definition at line 56 of file SY6970Charger.cpp.
References SensorCommWrapper::updateBits().
Referenced by setup().
|
overridevirtual |
Set termination current.
| mA | Termination current in milliamps. Value will be quantized to nearest valid step (64mA). |
Implements PmicChargerBase.
Definition at line 99 of file SY6970Charger.cpp.
References SensorCommWrapper::updateBits().
Referenced by setup().