/************************************************************************** * * Copyright (c) 2026 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file Battery.h * * @author (last) Suresh Dharnala * @date (last) 15-May-2026 * * @author (original) Suresh Dharnala * @date (original) 13-May-2026 * ***************************************************************************/ #ifndef APP_MONITORS_BATTERY_H_ #define APP_MONITORS_BATTERY_H_ #include "Utilities.h" #include "Messaging.h" /** * @defgroup Battery * @brief The battery monitor module reads and publishes battery charger * and battery pack data over I2C and SMBus. * * @addtogroup Battery * @{ */ // ********** public definitions ********** /// Payload record structure for battery data broadcast message typedef struct { U32 RemainingCapacity; ///< Remaining capacity in mAh. U32 BatteryStatus; ///< Battery pack status. U32 BatteryChargerStatus; ///< Battery charger status. U32 BatteryI2CStatus; ///< Battery I2C status. U32 FaultStatus; ///< Charger fault status. U32 TS; ///< Thermistor percentage. U32 VBAT; ///< Battery voltage in mV. U32 VSYS; ///< System voltage in mV. U32 IBAT; ///< Battery current in mA. U32 RelativeStateOfCharge; ///< Relative state of charge. U32 FullChargeCapacity; ///< Full charge capacity in mAh. } BATTERY_DATA_PAYLOAD_T; //********** public function prototypes ********** void initBattery( void ); void execBatteryMonitor( void ); BOOL isBatteryCharged( void ); BOOL testBatteryRemainingCapacityOverride( MESSAGE_T *message ); BOOL testBatteryStatusOverride( MESSAGE_T *message ); BOOL testBatteryChargerStatusOverride( MESSAGE_T *message ); /**@}*/ #endif /* APP_MONITORS_BATTERY_H_ */