From ee85033053945c0a058dbcb345e1ed679a101c24 Mon Sep 17 00:00:00 2001 From: cleeUC <68129277+cleeUC@users.noreply.github.com> Date: Tue, 5 Mar 2024 13:50:48 -0500 Subject: [PATCH] added chargingCurrent and chargingVoltage methods --- src/ArduinoSMBus.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/ArduinoSMBus.cpp b/src/ArduinoSMBus.cpp index 7886329..4fd16fa 100644 --- a/src/ArduinoSMBus.cpp +++ b/src/ArduinoSMBus.cpp @@ -178,6 +178,25 @@ uint16_t ArduinoSMBus::batteryStatus() { return status; } +/** + * @brief Get the battery's design charging current. + * Returns the desired design charging current of the battery, in mA. + * @return uint16_t + */ +uint16_t ArduinoSMBus::chargingCurrent() { + return readRegister(CHARGING_CURRENT); +} + +/** + * @brief Get the battery's design charging voltage. + * Returns the desired design charging voltage of the battery, in mV. + * @return uint16_t + */ +uint16_t ArduinoSMBus::chargingVoltage() { + return readRegister(CHARGING_VOLTAGE); +} + + /** * @brief Check if the battery status is OK. * Check for any alarm conditions in the battery status register. These include bits