Skip to content

Latest commit

 

History

History
995 lines (669 loc) · 41.7 KB

api.md

File metadata and controls

995 lines (669 loc) · 41.7 KB

Summary

Members Descriptions
class Battery This class provides a detailed insight into the battery's health and usage.
class Board Represents a board with power management capabilities.
class Charger Class for controlling charging parameters and monitoring charging status.
class MAX1726Driver Driver class for the MAX1726 Fuel Gauge IC.
struct BatteryCharacteristics This struct contains the characteristics of the battery.

class Battery

This class provides a detailed insight into the battery's health and usage.

Summary

Members Descriptions
Battery Initializes the battery object with default values for capacity (0mAh) and empty voltage (3.3V).
Battery Initializes the battery object with the given battery characteristics.
begin Initializes the battery communication and configuration.
isConnected Checks if a battery is connected to the system.
voltage Reads the current voltage of the battery. Voltage is usually between 3.0V and 4.2V.
averageVoltage Reads an average of voltage readings of the battery.
minimumVoltage Returns the minimum voltage value measured since the last device reset. At power-up the minimum voltage value is set to FFh (the maximum).
maximumVoltage Returns the maximum voltage value measured since the last device reset. At power-up the maximum voltage value is set to 00h (the minimum).
resetMaximumMinimumVoltage Resets the minimum and maximum voltage values.
current Reads the current flowing from the battery at the moment. Negative values indicate that the battery is charging, positive values indicate that the battery is discharging. When no battery is connected, the value is -1.
averageCurrent Reads an average of current readings of the battery.
minimumCurrent Reads the minimum current values measured since the last device reset. Note: The resolution of the minimum current value is 160mA so the value is rounded to the nearest 160mA.
maximumCurrent Reads the maximum current values measured since the last device reset. Note: The resolution of the minimum current value is 160mA so the value is rounded to the nearest 160mA.
resetMaximumMinimumCurrent Resets the minimum and maximum current values.
power Reads the current power of the battery in milliwatts (mW). This value is calculated based on the current and voltage of the battery.
averagePower Reads an average of power readings of the battery in milliwatts (mW). This value is calculated based on the current and voltage of the battery.
internalTemperature Reads the current temperature of the internal die of the battery gauge chip.
averageInternalTemperature Reads an average of internal temperature readings of the battery. Note: If the battery temperature was read before, this function will change the configuration to read the internal temperature. You will have to await a couple of temperature readings before getting a meaningful average temperature.
percentage Reads the battery's state of charge (SOC). This value is based on both the voltage and the current of the battery as well as compensation for the battery's age and temperature and discharge rate.
remainingCapacity Reads the remaining capacity of the battery. In combination with current(), this value can be used to estimate the remaining time until the battery is empty.
fullCapacity Returns the full capacity of the battery. For this to work, the capacity of the battery must be set when initializing the battery object.
isEmpty Checks if the battery is empty. Returns false once the cell voltage rises above the recovery threshold.
timeToEmpty Calculates the estimated time until the battery is empty.
timeToFull Calculates the estimated time until the battery is fully charged. The value is determined by learning from the experience of prior charge cycles.

Members

Battery

Battery()

Initializes the battery object with default values for capacity (0mAh) and empty voltage (3.3V).


Battery

Battery( BatteryCharacteristics batteryCharacteristics)

Initializes the battery object with the given battery characteristics.

Parameters

  • batteryCharacteristics The characteristics of the battery.

begin

bool begin(bool enforceReload)

Initializes the battery communication and configuration.

Parameters

  • enforceReload If set to true, the battery gauge config will be reloaded.

Returns

True if the initialization was successful, false otherwise.


isConnected

boolean isConnected()

Checks if a battery is connected to the system.

Returns

True if a battery is connected, false otherwise


voltage

float voltage()

Reads the current voltage of the battery. Voltage is usually between 3.0V and 4.2V.

Returns

The current voltage in volts (V).


averageVoltage

float averageVoltage()

Reads an average of voltage readings of the battery.

Returns

The average voltage in volts (V).


minimumVoltage

float minimumVoltage()

Returns the minimum voltage value measured since the last device reset. At power-up the minimum voltage value is set to FFh (the maximum).

Returns

The minimum voltage value in volts (V).


maximumVoltage

float maximumVoltage()

Returns the maximum voltage value measured since the last device reset. At power-up the maximum voltage value is set to 00h (the minimum).

Returns

The maximum voltage value in volts (V).


resetMaximumMinimumVoltage

bool resetMaximumMinimumVoltage()

Resets the minimum and maximum voltage values.

Returns

True if the minimum and maximum voltage values were successfully reset, false otherwise.


current

int16_t current()

Reads the current flowing from the battery at the moment. Negative values indicate that the battery is charging, positive values indicate that the battery is discharging. When no battery is connected, the value is -1.

Returns

The current flowing from the battery in milli amperes (mA).


averageCurrent

int16_t averageCurrent()

Reads an average of current readings of the battery.

Returns

The average current in milli amperes (mA).


minimumCurrent

int16_t minimumCurrent()

Reads the minimum current values measured since the last device reset. Note: The resolution of the minimum current value is 160mA so the value is rounded to the nearest 160mA.

Returns

The minimum current values in milli amperes (mA).


maximumCurrent

int16_t maximumCurrent()

Reads the maximum current values measured since the last device reset. Note: The resolution of the minimum current value is 160mA so the value is rounded to the nearest 160mA.

Returns

The maximum current values in milli amperes (mA).


resetMaximumMinimumCurrent

bool resetMaximumMinimumCurrent()

Resets the minimum and maximum current values.

Returns

True if the minimum and maximum current values were successfully reset, false otherwise.


power

int16_t power()

Reads the current power of the battery in milliwatts (mW). This value is calculated based on the current and voltage of the battery.

Returns

The current power in milliwatts (mW).


averagePower

int16_t averagePower()

Reads an average of power readings of the battery in milliwatts (mW). This value is calculated based on the current and voltage of the battery.

Returns

The average power in milliwatts (mW).


internalTemperature

uint8_t internalTemperature()

Reads the current temperature of the internal die of the battery gauge chip.

Returns

The current temperature in degrees Celsius.


averageInternalTemperature

uint8_t averageInternalTemperature()

Reads an average of internal temperature readings of the battery. Note: If the battery temperature was read before, this function will change the configuration to read the internal temperature. You will have to await a couple of temperature readings before getting a meaningful average temperature.

Returns

The average temperature in degrees Celsius.


percentage

uint8_t percentage()

Reads the battery's state of charge (SOC). This value is based on both the voltage and the current of the battery as well as compensation for the battery's age and temperature and discharge rate.

Returns

The state of charge as a percentage (Range: 0% - 100%).


remainingCapacity

uint16_t remainingCapacity()

Reads the remaining capacity of the battery. In combination with current(), this value can be used to estimate the remaining time until the battery is empty.

Returns

The remaining capacity in milliampere-hours (mAh).


fullCapacity

uint16_t fullCapacity()

Returns the full capacity of the battery. For this to work, the capacity of the battery must be set when initializing the battery object.

Returns

The full capacity of the battery.


isEmpty

bool isEmpty()

Checks if the battery is empty. Returns false once the cell voltage rises above the recovery threshold.

Returns

true if the battery is empty, false otherwise.


timeToEmpty

int32_t timeToEmpty()

Calculates the estimated time until the battery is empty.

Returns

The estimated time until the battery is empty, in seconds. If the battery is charging, the function returns -1.


timeToFull

int32_t timeToFull()

Calculates the estimated time until the battery is fully charged. The value is determined by learning from the experience of prior charge cycles.

Returns

The estimated time until the battery is fully charged in seconds. If the battery is discharging, the function returns -1.


class Board

Represents a board with power management capabilities.

The Board class provides methods to check the power source, enable/disable power rails, set voltage levels, enable/disable wakeup from pins or RTC, put the device into sleep mode for a specified duration, and control peripherals' power.

Supported boards: Arduino Portenta H7, Arduino Portenta C33, Arduino Nicla Vision.

Summary

Members Descriptions
Board Construct a new Board object.
~Board Destroy the Board object.
begin Initializes the board by initiating the PMIC.
isUSBPowered Check if the board is powered through USB.
isBatteryPowered Check if the board is powered by the battery.
setExternalPowerEnabled Enables/disables the voltage on the external power rail. This lane powers the pin labeled 3V3 on the board.
setExternalVoltage Set the voltage for the external power rail. This lane powers the pin labeled 3V3 on the board.
setCameraPowerEnabled Enables/disables the camera's power rail on boards with a built-in camera.
enableWakeupFromPin Enables wakeup from pin GPIO0 on Portenta H7. The pin is only accessible via high-density connectors.
enableSleepWhenIdle Enables sleep mode when the board is idle.
enableWakeupFromPin Enables wake-up of the device from a specified pin (A0, A1, A2, A3, A4, A5, D4, D7 ) on Arduino Portenta C33.
enableWakeupFromRTC Enables wake-up of the device from the RTC. This function allows to use a custom RTC instance to put the device in sleep mode.
enableWakeupFromRTC Enables wake-up of the device from the RTC.
enableWakeupFromRTC Enables wake-up of the device from the RTC.
sleepUntilWakeupEvent Put the device into sleep mode until a wakeup event occurs This sleep mode is ideal for applications requiring periodic wake-ups or brief intervals of inactivity and reduces consumption to a range between 6mA and 18mA depending on the state of the peripherals. This sleep mode resumes the operation from the last operation without resetting the board. A wakeup event can be an interrupt on a pin or the RTC, depending on what you set with enableWakeupFromPin() and enableWakeupFromRTC().
standByUntilWakeupEvent Put the device into standby mode until a wakeup event occurs. For scenarios demanding drastic power conservation, the standby Mode significantly reduces the board's power usage to micro amperes range depending on the state of the peripherals. This mode restarts the board on wake-up, effectively running the setup() function again. A wakeup event can be an interrupt on a pin or the RTC, depending on what you set with enableWakeupFromPin() and enableWakeupFromRTC().
setAllPeripheralsPower Toggle the peripherals' power on Portenta C33 (ADC, RGB LED, Secure Element, Wifi and Bluetooth).
setCommunicationPeripheralsPower Toggles the communication peripherials' power on Portenta C33 (Wifi, Bluetooth and Secure Element)
setAnalogDigitalConverterPower Toggles the power of the analog digital converter on Portenta C33. This is not available on the Portenta H7.
setReferenceVoltage Set the reference voltage. This value is used by the ADC to convert analog values to digital values. This can be particularly useful to increase the accuracy of the ADC when working with low voltages.
shutDownFuelGauge Shuts down the fuel gauge to reduce power consumption. The IC returns to active mode on any edge of any communication line. If the IC is power-cycled or the software RESET command is sent the IC returns to active mode of operation.

Members

Board

Board()

Construct a new Board object.


~Board

~Board()

Destroy the Board object.


begin

bool begin()

Initializes the board by initiating the PMIC.

Returns

true if the board initialization is successful, false otherwise.


isUSBPowered

bool isUSBPowered()

Check if the board is powered through USB.

Returns

True if powered through USB, false otherwise.


isBatteryPowered

bool isBatteryPowered()

Check if the board is powered by the battery.

Returns

True if powered by the battery, false otherwise.


setExternalPowerEnabled

void setExternalPowerEnabled(bool on)

Enables/disables the voltage on the external power rail. This lane powers the pin labeled 3V3 on the board.

Parameters

  • on True to enable this power rail, false to disable it.

setExternalVoltage

bool setExternalVoltage(float voltage)

Set the voltage for the external power rail. This lane powers the pin labeled 3V3 on the board.

Parameters

  • voltage float value of the voltage value to set. Value has to be one of the following (1.10, 1.20, 1.35, 1.50, 1.80, 2.50, 3.00, 3.30)

Returns

True the voltage was set successfully, false otherwise.


setCameraPowerEnabled

void setCameraPowerEnabled(bool enabled)

Enables/disables the camera's power rail on boards with a built-in camera.

Parameters

  • enabled True to turn on the camera, false to turn it off.

enableWakeupFromPin

void enableWakeupFromPin()

Enables wakeup from pin GPIO0 on Portenta H7. The pin is only accessible via high-density connectors.


enableSleepWhenIdle

void enableSleepWhenIdle()

Enables sleep mode when the board is idle.


enableWakeupFromPin

void enableWakeupFromPin(uint8_t pin, PinStatus direction)

Enables wake-up of the device from a specified pin (A0, A1, A2, A3, A4, A5, D4, D7 ) on Arduino Portenta C33.

Parameters

  • pin The pin number used for waking up the device.

  • direction The direction of the interrupt that will wake up the device. (RISING, FALLING)


enableWakeupFromRTC

bool enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds, void(*)() callbackFunction, RTClock * rtc)

Enables wake-up of the device from the RTC. This function allows to use a custom RTC instance to put the device in sleep mode.

Parameters

  • hours The number of hours to sleep.

  • minutes The number of minutes to sleep.

  • seconds The number of seconds to sleep.

  • callbackFunction The function to call when the device wakes up. If no callback function is provided, the device will wake up without calling any function.

  • rtc The RTC instance to use for the sleep function. If no RTC instance is provided, the default RTC instance is used.

Returns

True if successful, false otherwise.


enableWakeupFromRTC

bool enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds, RTClock * rtc)

Enables wake-up of the device from the RTC.

Parameters

  • hours The number of hours to sleep.

  • minutes The number of minutes to sleep.

  • seconds The number of seconds to sleep.

  • rtc The RTC instance to use for the sleep function. Default is the shared RTC instance.

Returns

True if successful, false otherwise.


enableWakeupFromRTC

bool enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds)

Enables wake-up of the device from the RTC.

Parameters

  • hours The number of hours to sleep.

  • minutes The number of minutes to sleep.

  • seconds The number of seconds to sleep.

Returns

True if successful, false otherwise.


sleepUntilWakeupEvent

void sleepUntilWakeupEvent()

Put the device into sleep mode until a wakeup event occurs This sleep mode is ideal for applications requiring periodic wake-ups or brief intervals of inactivity and reduces consumption to a range between 6mA and 18mA depending on the state of the peripherals. This sleep mode resumes the operation from the last operation without resetting the board. A wakeup event can be an interrupt on a pin or the RTC, depending on what you set with enableWakeupFromPin() and enableWakeupFromRTC().


standByUntilWakeupEvent

void standByUntilWakeupEvent()

Put the device into standby mode until a wakeup event occurs. For scenarios demanding drastic power conservation, the standby Mode significantly reduces the board's power usage to micro amperes range depending on the state of the peripherals. This mode restarts the board on wake-up, effectively running the setup() function again. A wakeup event can be an interrupt on a pin or the RTC, depending on what you set with enableWakeupFromPin() and enableWakeupFromRTC().


setAllPeripheralsPower

void setAllPeripheralsPower(bool on)

Toggle the peripherals' power on Portenta C33 (ADC, RGB LED, Secure Element, Wifi and Bluetooth).

Parameters

  • on True to turn on the power, false to turn it off.

setCommunicationPeripheralsPower

void setCommunicationPeripheralsPower(bool on)

Toggles the communication peripherials' power on Portenta C33 (Wifi, Bluetooth and Secure Element)

Parameters

  • on True to turn on the power, false to turn it off.

setAnalogDigitalConverterPower

void setAnalogDigitalConverterPower(bool on)

Toggles the power of the analog digital converter on Portenta C33. This is not available on the Portenta H7.

Parameters

  • on True to turn on the power, false to turn it off.

setReferenceVoltage

bool setReferenceVoltage(float voltage)

Set the reference voltage. This value is used by the ADC to convert analog values to digital values. This can be particularly useful to increase the accuracy of the ADC when working with low voltages.

Parameters

  • voltage Reference voltage value in volts. It can be anything between 1.80V and 3.30V in steps of 0.10V. Any value outside this range or with different steps will not be accepted by the library.

Returns

True if the voltage was set successfully, false otherwise.


shutDownFuelGauge

void shutDownFuelGauge()

Shuts down the fuel gauge to reduce power consumption. The IC returns to active mode on any edge of any communication line. If the IC is power-cycled or the software RESET command is sent the IC returns to active mode of operation.


class Charger

Class for controlling charging parameters and monitoring charging status.

Summary

Members Descriptions
Charger Constructs a new Charger object.
begin Initializes the charger by initiating the PMIC.
setChargeCurrent Set the charging current. The default charging current is set to 100mA.
getChargeCurrent Get the charge current in milli amperes (mA).
setChargeVoltage Set the charging voltage in volts (V). The current charging voltage is set to 4.2V by default.
getChargeVoltage Get the charge voltage in volts (V).
setEndOfChargeCurrent Set the end-of-charge current. The charger IC determines when to terminate the charge cycle based on the current going into the battery dropping below the given threshold during the constant voltage phase. At this point, the battery is considered fully charged and charging is completed. If charge termination is disabled, the charge current will naturally decay to 0mA, but this is rarely done in practice. This is because the amount of charge going into the battery exponentially decreases during CV charging, and it would take a significantly longer time to recharge the battery with a very little increase in capacity.
getEndOfChargeCurrent Get the end of charge current.
setInputCurrentLimit The input current limit (ILIM) safeguards the device by preventing overcurrent, ensuring the charging current is within safe levels for the battery, and adapting to the maximum current the power source can provide, allowing you to charge and use the system at the same time. The default input current limit is set to 1.5A.
getInputCurrentLimit Get the input current limit. It is a safeguard to prevent overcurrent when charging respectively to the maximum current the power source can provide.
getState Get the current charging status.
isEnabled Checks if the charger and thus charging is enabled. By default, the charger is enabled.
setEnabled Sets the enabled state of the charger. When enabling it uses the default settings or the last saved parameters, depending on what was set previously.

Members

Charger

Charger()

Constructs a new Charger object.


begin

bool begin()

Initializes the charger by initiating the PMIC.

Returns

true if the charger initialization is successful, false otherwise.


setChargeCurrent

bool setChargeCurrent(uint16_t current)

Set the charging current. The default charging current is set to 100mA.

Parameters

  • current Charging current in milli amperes (mA). Supported values: 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000

Returns

True if successful, false if an invalid value was provided or if the PMIC communication failed.


getChargeCurrent

uint16_t getChargeCurrent()

Get the charge current in milli amperes (mA).

Returns

The charge current in float.


setChargeVoltage

bool setChargeVoltage(float voltage)

Set the charging voltage in volts (V). The current charging voltage is set to 4.2V by default.

Parameters

  • voltage Charging voltage in volts (V). Supported values: 3.50, 3.52, 3.54, 3.56, 3.58, 3.60, 3.62, 3.64, 3.66, 3.68, 3.70, 3.72, 3.74, 3.76, 3.78, 3.80, 3.82, 3.84, 3.86, 3.88, 3.90, 3.92, 3.94, 3.96, 3.98, 4.00, 4.02, 4.04, 4.06, 4.08, 4.10, 4.12, 4.14, 4.16, 4.18, 4.20, 4.22, 4.24, 4.26, 4.28, 4.30, 4.32, 4.34, 4.36, 4.38, 4.40, 4.42, 4.44

Returns

True if successful, false if an invalid value was provided or if the PMIC communication failed.


getChargeVoltage

float getChargeVoltage()

Get the charge voltage in volts (V).

Returns

The charge voltage as a float value.


setEndOfChargeCurrent

bool setEndOfChargeCurrent(uint16_t current)

Set the end-of-charge current. The charger IC determines when to terminate the charge cycle based on the current going into the battery dropping below the given threshold during the constant voltage phase. At this point, the battery is considered fully charged and charging is completed. If charge termination is disabled, the charge current will naturally decay to 0mA, but this is rarely done in practice. This is because the amount of charge going into the battery exponentially decreases during CV charging, and it would take a significantly longer time to recharge the battery with a very little increase in capacity.

Parameters

  • current End-of-charge current in milli amperes (mA). The default end-of-charge current is set to 50 mA. Supported values: 5, 10, 20, 30, 50

Returns

True if successful, false if an invalid value was provided or if the PMIC communication failed.


getEndOfChargeCurrent

uint16_t getEndOfChargeCurrent()

Get the end of charge current.

This function returns the current value at which the charging process is considered complete. Charging is terminated when the supplied current drops below the pre-programmed end of charge level.

Returns

The end of charge current.


setInputCurrentLimit

bool setInputCurrentLimit(uint16_t current)

The input current limit (ILIM) safeguards the device by preventing overcurrent, ensuring the charging current is within safe levels for the battery, and adapting to the maximum current the power source can provide, allowing you to charge and use the system at the same time. The default input current limit is set to 1.5A.

Parameters

  • current Maximum input current in milli amperes (mA). Supported values: 10, 15, 20, 25, 30, 35, 40, 45, 50, 100, 150, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1500

Returns

True if successful, false if an invalid value was provided or if the PMIC communication failed.


getInputCurrentLimit

uint16_t getInputCurrentLimit()

Get the input current limit. It is a safeguard to prevent overcurrent when charging respectively to the maximum current the power source can provide.

Returns

The input current limit in milli amperes (mA).


getState

ChargingState getState()

Get the current charging status.

Returns

Charging status enum value (ChargingState). The possible states are:

  • none: Provided by the registers, not used in this API.

  • preCharge: First stage of the charging process, prepares battery for the charging process.

  • fastChargeConstantCurrent: Second phase of the charging process where the battery is charging in constant current mode until it reaches the voltage where the it's considered fully charged. (4.2V)

  • fastChargeConstantVoltage: Third phase of the charging process where the battery is kept at the fully charged voltage and current is slowly decreased to the end of charge current.

  • endOfCharge: If the battery is still connected, the charger will ensure it's kept at 4.2V by topping up the voltage to avoid self discharge.

  • done: Battery is fully charged

  • timerFaultError: The timer that is monitoring the charge status has encountered an error.

  • thermistorSuspendError: Charging was suspended due to overheating

  • chargerDisabled: Charger is disabled

  • batteryOvervoltageError: Charging was suspended due to an overvoltage fault

  • chargerBypassed: The charger is bypassed completely and the USB voltage is powering the board


isEnabled

bool isEnabled()

Checks if the charger and thus charging is enabled. By default, the charger is enabled.

Returns

true if the charger is enabled, false otherwise.


setEnabled

bool setEnabled(bool enabled)

Sets the enabled state of the charger. When enabling it uses the default settings or the last saved parameters, depending on what was set previously.

Parameters

  • enabled The desired enabled state of the charger.

Returns

true if the enabled state was successfully set, false otherwise.


class MAX1726Driver

Driver class for the MAX1726 Fuel Gauge IC.

Summary

Members Descriptions
chargingComplete Checks if the battery charging is complete.
setOperationMode Sets the operation mode of the Fuel Gauge.
MAX1726Driver Constructs a new MAX1726Driver object.
~MAX1726Driver

Members

chargingComplete

bool chargingComplete()

Checks if the battery charging is complete.

Checks if the charging process is complete.

Returns

true if the charging process is complete, false otherwise.

Returns

true if the charging is complete, false otherwise.


setOperationMode

bool setOperationMode(FuelGaugeOperationMode mode)

Sets the operation mode of the Fuel Gauge.

Parameters

  • mode The operation mode to set. Possible values are: hibernate, shutdown, active.

Returns

True if the operation mode was set successfully, false otherwise.


MAX1726Driver

MAX1726Driver(TwoWire * wire, uint8_t i2cAddress)

Constructs a new MAX1726Driver object.

Parameters

  • wire Pointer to the TwoWire object for I2C communication.

  • i2cAddress The I2C address of the MAX1726 device. The default value is 0x36.


~MAX1726Driver

~MAX1726Driver()

struct BatteryCharacteristics

This struct contains the characteristics of the battery.

Summary

Members Descriptions
capacity The battery's capacity in milliampere-hours (mAh).
emptyVoltage The voltage in volts (V) at which the battery is considered empty. If you don't know this value you can use the minimumVoltage() function to find out while you let the battery completely discharge.
chargeVoltage The voltage in volts (V) at which the battery is being charged.
endOfChargeCurrent The current in milli amperes (mA) that is used to keep the battery charged at the end of the charging process.
ntcResistor The NTC resistor value used in the battery pack (10K or 100K Ohm).
recoveryVoltage Sets the voltage level for clearing empty detection. Once the cell voltage rises above this point, empty voltage detection is re-enabled.

Members

capacity

int capacity

The battery's capacity in milliampere-hours (mAh).


emptyVoltage

float emptyVoltage

The voltage in volts (V) at which the battery is considered empty. If you don't know this value you can use the minimumVoltage() function to find out while you let the battery completely discharge.


chargeVoltage

float chargeVoltage

The voltage in volts (V) at which the battery is being charged.


endOfChargeCurrent

int endOfChargeCurrent

The current in milli amperes (mA) that is used to keep the battery charged at the end of the charging process.


ntcResistor

NTCResistor ntcResistor

The NTC resistor value used in the battery pack (10K or 100K Ohm).


recoveryVoltage

float recoveryVoltage

Sets the voltage level for clearing empty detection. Once the cell voltage rises above this point, empty voltage detection is re-enabled.