From a1e512f152456f6fcbacee427fd265e34f05a966 Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Tue, 4 Jun 2024 13:40:38 +0200 Subject: [PATCH] Add documentation --- src/Battery.h | 8 ++++++++ src/Board.h | 16 ++++++++++++++++ src/MAX1726Driver.h | 3 +++ 3 files changed, 27 insertions(+) diff --git a/src/Battery.h b/src/Battery.h index 743c9f9..fc0379c 100644 --- a/src/Battery.h +++ b/src/Battery.h @@ -15,6 +15,9 @@ enum class NTCResistor { Resistor100K }; +/** + * @brief This struct contains the characteristics of the battery. +*/ struct BatteryCharacteristics { /// @brief The battery's capacity in milliampere-hours (mAh). int capacity = 0; @@ -33,6 +36,7 @@ struct BatteryCharacteristics { /// @brief The NTC resistor value used in the battery pack (10K or 100K Ohm). NTCResistor ntcResistor = NTCResistor::Resistor10K; + /// @brief Sets the voltage level for clearing empty detection. Once the cell voltage rises above this point, empty voltage detection is re-enabled. float recoveryVoltage = DEFAULT_RECOVERY_VOLTAGE; }; @@ -46,6 +50,10 @@ class Battery { */ Battery(); + /** + * @brief Initializes the battery object with the given battery characteristics. + * @param batteryCharacteristics The characteristics of the battery. + */ Battery(BatteryCharacteristics batteryCharacteristics); /** diff --git a/src/Board.h b/src/Board.h index 1e0f8ef..c0c9277 100644 --- a/src/Board.h +++ b/src/Board.h @@ -141,10 +141,26 @@ class Board { * @return True if successful, false otherwise. */ bool enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds, void (* const callbackFunction)(), RTClock * rtc = &RTC); + + /** + * @brief Enables wake-up of the device from the RTC. + * @param hours The number of hours to sleep. + * @param minutes The number of minutes to sleep. + * @param seconds The number of seconds to sleep. + * @param rtc The RTC instance to use for the sleep function. Default is the shared RTC instance. + * @return True if successful, false otherwise. + */ bool enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds, RTClock * rtc = &RTC); #endif #if defined(ARDUINO_PORTENTA_H7) + /** + * Enables wake-up of the device from the RTC. + * @param hours The number of hours to sleep. + * @param minutes The number of minutes to sleep. + * @param seconds The number of seconds to sleep. + * @return True if successful, false otherwise. + */ bool enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds); #endif diff --git a/src/MAX1726Driver.h b/src/MAX1726Driver.h index 012ef4d..b63a81e 100644 --- a/src/MAX1726Driver.h +++ b/src/MAX1726Driver.h @@ -9,6 +9,9 @@ enum class FuelGaugeOperationMode { constexpr uint8_t DEFAULT_I2C_ADDRESS = 0x36; +/** + * @brief Driver class for the MAX1726 Fuel Gauge IC. + */ class MAX1726Driver { private: TwoWire *wire;