Battery calibration service.
More...
#include <InternalServices.hpp>
Battery calibration service.
Definition at line 464 of file InternalServices.hpp.
◆ getAutoCalibrationParameter()
| virtual int BatteryCalibrationService::getAutoCalibrationParameter |
( |
| ) |
|
|
inlinevirtual |
Get the auto-calibration parameter.
- Returns
- int Auto-calibration parameter
Definition at line 544 of file InternalServices.hpp.
◆ getBatteryLevel()
| virtual int BatteryCalibrationService::getBatteryLevel |
( |
int | reading | ) |
|
|
inlinevirtual |
Get a percentage of battery charge based on calibration data.
- Parameters
-
| reading | An ADC reading of current battery(+) voltage. |
- Returns
- int -1 if the battery has not been calibrated. Otherwise, a percentage in the range 0%-100%.
Definition at line 483 of file InternalServices.hpp.
◆ getBatteryLevelAutoCalibrated()
| virtual int BatteryCalibrationService::getBatteryLevelAutoCalibrated |
( |
int | reading | ) |
|
|
inlinevirtual |
Get a percentage of battery charge using auto-calibration. Will provide incorrect battery levels (higher) until the battery is fully charged. Anyway, this algorithm is not accurate.
- Parameters
-
| reading | An ADC reading of current battery(+) voltage |
- Returns
- int If auto-calibration is available, a percentage in the range 0%-100%. Otherwise, zero.
- Note
- Based on https://blog.ampow.com/lipo-voltage-chart/
Definition at line 502 of file InternalServices.hpp.
◆ getCalibrationData()
| virtual uint16_t BatteryCalibrationService::getCalibrationData |
( |
uint8_t | index | ) |
|
|
inlinevirtual |
Get calibration data.
- Parameters
-
| index | Index of the required datum |
- Returns
- uint16_t Required datum
Definition at line 523 of file InternalServices.hpp.
◆ getCalibrationDataCount()
| virtual uint8_t BatteryCalibrationService::getCalibrationDataCount |
( |
| ) |
|
|
inlinevirtual |
Get the count of calibration data items.
- Returns
- uint8_t Number of calibration data items
Definition at line 512 of file InternalServices.hpp.
◆ restartAutoCalibration()
| virtual void BatteryCalibrationService::restartAutoCalibration |
( |
| ) |
|
|
inlinevirtual |
◆ setAutoCalibrationParameter()
| virtual void BatteryCalibrationService::setAutoCalibrationParameter |
( |
int | value, |
|
|
bool | save = true ) |
|
inlinevirtual |
Set the auto-calibration parameter.
- Parameters
-
| value | Value of the auto-calibration parameter |
| save | True to save to persistent storage. |
Definition at line 555 of file InternalServices.hpp.
◆ setCalibrationData()
| virtual void BatteryCalibrationService::setCalibrationData |
( |
uint8_t | index, |
|
|
uint16_t | data, |
|
|
bool | save = true ) |
|
inlinevirtual |
Set calibration data.
- Parameters
-
| index | Index of this calibration data |
| data | Data to set |
| save | True to save to persistent storage. |
Definition at line 535 of file InternalServices.hpp.
The documentation for this class was generated from the following file: