Index: firmware/App/Drivers/Battery.h =================================================================== diff -u -r3d72b777cf1ceb673d118341c46e2d6d5b7b75f5 -rb5ca53ca81575a727e615ab8836abfc1a4a0bbc8 --- firmware/App/Drivers/Battery.h (.../Battery.h) (revision 3d72b777cf1ceb673d118341c46e2d6d5b7b75f5) +++ firmware/App/Drivers/Battery.h (.../Battery.h) (revision b5ca53ca81575a727e615ab8836abfc1a4a0bbc8) @@ -7,8 +7,8 @@ * * @file Battery.h * -* @author (last) Quang Nguyen -* @date (last) 03-Aug-2021 +* @author (last) Dara Navaei +* @date (last) 18-Oct-2022 * * @author (original) Quang Nguyen * @date (original) 24-Feb-2021 @@ -28,18 +28,59 @@ * @{ */ -// ********** public definitions ********** - -// ********** public function prototypes ********** - -void initBattery( void ); +// ********** public definitions ********** +/// Payload record structure for battery status data broadcast message +typedef struct +{ + U32 RemainingCapacity; ///< Remaining capacity. + U32 BatteryStatus; ///< Battery status. + U32 BatteryChargerStatus; ///< Battery charge status. +} BATTERY_STATUS_PAYLOAD_T; + +/// Payload record structure for battery module data broadcast message +typedef struct +{ + U32 RemainingCapacityAlarm; ///< Remaining capacity alarm. + U32 RemainingTimeAlarm; ///< Remaining time alarm. + U32 BatteryMode; ///< Battery mode. + U32 AtRate; ///< At rate. + U32 AtRateTimeToFull; ///< At rate time to full. + U32 AtRateTimeToEmpty; ///< At rate time to empty. + U32 AtRateOK; ///< At rate ok. + U32 Temperature; ///< Temperature. + U32 Voltage; ///< Voltage. + U32 Current; ///< Current. + U32 AverageCurrent; ///< Average current. + U32 MaxError; ///< Max error. + U32 RelativeStateOfCharge; ///< Relative state of charge. + U32 AbsoluteStateOfCharge; ///< Absolute state of charge. + U32 FullChargeCapacity; ///< Full charge capacity. + U32 RunTimeToEmpty; ///< Run time to empty. + U32 AverageTimeToEmpty; ///< Average time to empty. + U32 AverageTimeToFull; ///< Average time to full. + U32 ChargingCurrent; ///< Charging current. + U32 ChargingVoltage; ///< Charging voltage. + U32 CycleCount; ///< Cycle count. + U32 DesignCapacity; ///< Design capacity. + U32 DesignVoltage; ///< Design voltage. + U32 SpecificationInfo; ///< Specification information. + U32 ManufactureDate; ///< Manufacture date. + U32 SerialNumber; ///< Serial number. + U32 ManufacturerName; ///< Manufacturer name. + U32 DeviceName; ///< Device name. + U32 DeviceChemistry; ///< Device chemistry. +} BATTERY_MANAGER_PAYLOAD_T; + +// ********** public function prototypes ********** + +void initBattery( void ); void execBatteryMonitor( void ); -BOOL isBatteryCharged( void ); +BOOL isBatteryCharged( void ); -BOOL testSetBatteryRemainingPercentOverride( U32 value ); +BOOL testSetBatteryRemainingPercentOverride( F32 value ); BOOL testResetSetBatteryRemainingPercentOverride( void ); - + /**@}*/ -#endif +#endif