/************************************************************************** * * Copyright (c) 2021-2022 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) Quang Nguyen * @date (last) 03-Aug-2021 * * @author (original) Quang Nguyen * @date (original) 24-Feb-2021 * ***************************************************************************/ #ifndef __BATTERY_H__ #define __BATTERY_H__ #include "HDCommon.h" /** * @defgroup Battery Battery * @brief The battery module provides interfaces to the smart battery charger controller through I2C communication. * * @addtogroup Battery * @{ */ // ********** public definitions ********** /// Payload record structure for battery module data broadcast message typedef struct { U32 RemainingCapacity; U32 BatteryStatus; // U32 RemainingCapacityAlarm; // U32 RemainingTimeAlarm; // U32 BatteryMode; // U32 AtRate; // U32 AtRateTimeToFull; // U32 AtRateTimeToEmpty; // U32 AtRateOK; // U32 Temperature; // U32 Voltage; // U32 Current; // U32 AverageCurrent; // U32 MaxError; // U32 RelativeStateOfCharge; // U32 AbsoluteStateOfCharge; // U32 FullChargeCapacity; // U32 RunTimeToEmpty; // U32 AverageTimeToEmpty; // U32 AverageTimeToFull; // U32 ChargingCurrent; // U32 ChargingVoltage; // U32 CycleCount; // U32 DesignCapacity; // U32 DesignVoltage; // U32 SpecificationInfo; // U32 ManufactureDate; // U32 SerialNumber; // U32 ManufacturerName; // U32 DeviceName; // U32 DeviceChemistry; // U32 BatteryChargerStatus; // } BATTERY_MANAGER_PAYLOAD_T; // ********** public function prototypes ********** void initBattery( void ); void execBatteryMonitor( void ); BOOL isBatteryCharged( void ); BOOL testSetBatteryRemainingPercentOverride( U32 value ); BOOL testResetSetBatteryRemainingPercentOverride( void ); /**@}*/ #endif