#include "bl_chargControl.h" #include "parameter.h" #include "comm_types.h" static void stopChargWork(void); static BOOL stopChargConditions(void); static BOOL floatChargConditions(void); static BOOL mpptChargConditions(void); static BOOL constantVChargConditions(void); static void mpptCharge(void); static void constantVoltageCharge(void); static void floatCharge(void); /** * @brief 停止充电 * @param * @retval * */ void stopChargWork(void) { } /** * @brief 判断达到停止充电的条件 * @param * @retval TRUE 达到停止充电 * FALSE 未达到 * */ BOOL stopChargConditions(void) { return FALSE; } /** * @brief 判断达到浮充充电的条件 * @param * @retval TRUE 达到 * FALSE 未达到 * */ BOOL floatChargConditions(void) { return FALSE; } /** * @brief 判断达到最大功率充电的条件 * @param * @retval TRUE 达到 * FALSE 未达到 * */ BOOL mpptChargConditions(void) { return FALSE; } /** * @brief 判断达到恒压充电的条件 * @param * @retval TRUE 达到 * FALSE 未达到 * */ BOOL constantVChargConditions(void) { return FALSE; } /** * @brief 判断充电控制的模式 * @param * @retval * */ void chargControlMode(void) { if (stopChargConditions()) { stopChargWork(); setMPPT_Mode(noWork); } if (floatChargConditions()) { setMPPT_Mode(floatCharg); } if (mpptChargConditions()) { setMPPT_Mode(MPPT); } if (constantVChargConditions()) { setMPPT_Mode(constantVoltage); } } /** * @brief 得到充电控制器控制所需的电流电压 * @param * @retval * */ void getCVData(void) { } /** * @brief 判断有无电池 * @param * @retval * */ void judgeYNBattery(void) { } /** * @brief 无电池时控制 * @param * @retval * */ void noBatteryChargControl(void) { } /** * @brief 最大功率充电 * @param * @retval * */ void mpptCharge(void) { } /** * @brief 恒压充电 * @param * @retval * */ void constantVoltageCharge(void) { } /** * @brief 浮充充电 * @param * @retval * */ void floatCharge(void) { } /** * @brief 有电池时控制 * @param * @retval * */ void BatteryChargControl(void) { switch(getMPPT_Mode()) { case MPPT: mpptCharge(); break; case constantVoltage: constantVoltageCharge(); break; case floatCharg: floatCharge(); break; default: setMPPT_Mode(noWork); stopChargWork(); break; } }