Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sebromero committed Jun 4, 2024
1 parent 4db9acd commit a1e512f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
};

Expand All @@ -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);

/**
Expand Down
16 changes: 16 additions & 0 deletions src/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions src/MAX1726Driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a1e512f

Please sign in to comment.