/*********************************************************************************
 * Copyright(C),Ningbo Joyson Preh Car Connect Co.,Ltd.
 * FileName:    Power_Core.h
 * Author:      Zheng shijie
 * Version :    Ver0.1
 * Date:        2020-10-09
 * Description:
 *
 *********************************************************************************/
#ifndef APP_POWER_POWER_CORE_H_
#define APP_POWER_POWER_CORE_H_

/*Standbyout function*/
void Power_Standbyout_Cold(void);
void Power_Standbyout_Cold_Stage1Timeout(void);
void Power_Standbyout_Cold_Stage2Timeout(void);
void Power_Standbyout_Cold_Stage3Timeout(void);
void Power_Standbyout_Cold_Stage4Timeout(void);
void Power_Standbyout_Cold_Stage1Wait(void);
void Power_Standbyout_Cold_Stage2Wait(void);
void Power_Standbyout_Cold_Stage3Wait(void);

void Power_Standbyout_Warm(void);
void Power_Standbyout_Warm_Stage1Timeout(void);
void Power_Standbyout_Warm_Stage2Timeout(void);
void Power_Standbyout_Warm_Stage3Timeout(void);
void Power_Standbyout_Warm_Stage1Wait(void);
void Power_Standbyout_Warm_Stage2Wait(void);
void Power_Standbyout_Warm_Stage3Wait(void);
void Power_Standbyout_NAD(void);
void Power_Standbyout_Over(void);
/*ECO Mode function*/
void Power_CheckEcoMode(void);
void Power_EnterEcoMode(void);
void Power_ExitEcoMode(void);
void Power_SocOff_Set(void);
void Power_EcoMode_Done(void);
void Power_NadSleep_Check(void);
void Power_SocOff_Check(void);
/*Backup Battery function*/
void Power_Enter_Battery(void);
void Power_Battery_Done(void);
void Power_OffCall_Set(void);
void Power_Exit_Battery(void);
void Power_Battery_Done(void);
/*Voltage abnormal function*/
void Power_Voltage_Abnormal(void);
void Power_NadSleep_SocOff_Set(void);
void Power_NadSleep_SocOff_Done(void);
void Power_Exit_Voltage_Abnormal(void);
void Power_Exit_Voltage_Abnormal_Done(void);
/*Standbyin function*/
void Power_StandbyInStart(void);
void Power_StandbyInProcess(void);
void Power_NadOff_Pending(void);
void Power_NadOff_Pendingtimeout(void);
void Power_NadSleep_Pending(void);
void Power_NadSleep_Pendingtimeout(void);

void Power_Standbyin_Stage1Timeout(void);
void Power_Standbyin_Stage2Timeout(void);
void Power_Standbyin_Stage3Timeout(void);
void Power_Standbyin_Stage1Wait(void);
void Power_Standbyin_Stage2Wait(void);
void Power_Standbyin_Stage3Wait(void);
void Power_Standbyin_Stage4Wait(void);
void Power_Standbyin_Stage1(void);
void Power_Standbyin_Stage2(void);
void Power_Standbyin_Stage3(void);
void Power_Standbyin_Stage4(void);
void Power_Standbyin_Over(void);
void Power_StandbyIn_Break(void);
void Power_MainProcess(uint16_t event_code);
void Power_SetMode(uint8_t mode);
uint8_t Power_GetMode(void);
void Power_AllSleepTest(void);

/*for backup battery emc test*/
void BackupBatteryActive(void);

typedef struct
{
	uint8_t ID;
	uint8_t Level;
	uint16_t StandbyOutEvent;
	uint16_t StandbyInEvent;
	void 	(*ForceStandby)(void);
	void 	(*Callback)(const uint8_t,const uint8_t);
}st_StandbyConfigMap;

typedef struct
{
	/*uint8_t		TaskID;*/
	uint16_t 	EventCode;
	uint8_t 	currentmode;
	uint8_t 	nextmode;
	void 		(*Process)(void);
}st_PowerProcess;




#endif /* APP_POWER_POWER_CORE_H_ */
