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

#ifndef APP_POWER_POWER_MANAGER_H_
#define APP_POWER_POWER_MANAGER_H_

#include "Power_Sleep.h"
#include "power_manager.h"
#include "pwrMan1.h"
/*MCU MBOX Message*/
enum{
/*0xE000*/EVENT_MCU_COLD_WAKE_UP = 0xE000,
/*0xE001*/EVENT_MCU_CAN_WAKE_UP,
/*0xE002*/EVENT_MCU_IMU_WAKE_UP,
/*0xE003*/EVENT_MCU_NAD_WAKE_UP,
/*0xE004*/EVENT_MCU_SOS_WAKE_UP,
/*0xE005*/EVENT_MCU_BATTERY_WAKE_UP,
/*0xE006*/EVENT_MCU_READY_TO_SLEEP,
/*0xE007*/EVENT_MCU_SLEEP_BREAK,
/*0xE008*/EVENT_MCU_POWER_STANDBYOUT,
/*0xE009*/EVENT_MCU_POWER_STANDBYOUT_STAGE1_ACK,
/*0xE00A*/EVENT_MCU_POWER_STANDBYOUT_STAGE2_ACK,
/*0xE00B*/EVENT_MCU_POWER_STANDBYOUT_STAGE3_ACK,
/*0xE00C*/EVENT_MCU_POWER_STANDBYOUT_OVER,
/*0xE00D*/EVENT_MCU_POWER_STANDBYIN,
/*0xE00E*/EVENT_MCU_POWER_STANDBYIN_STAGE1_ACK,
/*0xE00F*/EVENT_MCU_POWER_STANDBYIN_STAGE2_ACK,
/*0xE010*/EVENT_MCU_POWER_STANDBYIN_STAGE3_ACK,
/*0xE011*/EVENT_MCU_POWER_STANDBYIN_OVER,
/*0xE012*/EVENT_MCU_POWER_BATTERY_ENTER_ISR,
/*0xE013*/EVENT_MCU_POWER_BATTERY_EXIT_ISR,
/*0xE014*/EVENT_MCU_POWER_ECO_ENTER,
/*0xE015*/EVENT_MCU_POWER_ECO_EXIT,
/*0xE016*/EVENT_MCU_POWER_SOC_SHUTDOWN,
/*0xE017*/EVENT_MCU_POWER_ECALL_OFF,
/*0xE018*/EVENT_MCU_POWER_NAD_SOC_TIMEOUT,
/*0xE019*/EVENT_MCU_POWER_NAD_SLEEP_SOC_OFF,
/*0xE01A*/EVENT_MCU_POWER_VEHSTATE_CHANGE,
/*0xE01B*/EVENT_MCU_POWER_DRVMODE_CHANGE,
/*0xE01C*/EVENT_MCU_POWER_LOW_VOLTAGE,
/*0xE01D*/EVENT_MCU_POWER_HIGH_VOLTAGE,
/*0xE01E*/EVENT_MCU_POWER_NORMAL_VOLAGE,
};
/*NAD SPI Message*/
enum{
/*0xF000*/EVENT_POWER_NAD_STARTUP_RES = 0xF000,
/*0xF001*/EVENT_POWER_WAKEUP_SOURCE,
/*0xF002*/EVENT_POWER_ENTER_ECO_MODE_REQ,
/*0xF003*/EVENT_POWER_ENTER_ECO_MODE_RES,
/*0xF004*/EVENT_POWER_EXIT_ECO_MODE_REQ,
/*0xF005*/EVENT_POWER_EXIT_ECO_MODE_RES,
/*0xF006*/EVENT_POWER_ENTER_BATTERY_MODE_REQ,
/*0xF007*/EVENT_POWER_ENTER_BATTERY_MODE_RES,
/*0xF008*/EVENT_POWER_EXIT_BATTERY_MODE_REQ,
/*0xF009*/EVENT_POWER_EXIT_BATTERY_MODE_RES,
/*0xF00A*/EVENT_POWER_SOC_OFF_NAD_SLEEP_REQ,
/*0xF00B*/EVENT_POWER_SOC_OFF_NAD_SLEEP_RES,
/*0xF00C*/EVENT_POWER_SOC_OFF_NAD_OFF_REQ,
/*0xF00D*/EVENT_POWER_SOC_OFF_NAD_OFF_RES,
/*0xF00E*/EVENT_POWER_SOC_POWEROFF_PENDING,
/*0xF00F*/EVENT_POWER_NAD_POWEROFF_PENDING,
/*0xF010*/EVENT_POWER_NAD_SLEEP_PENDING,
/*0xF011*/EVENT_POWER_NAD_SLEEP_TIMER_EXPIRED,
/*0xF012*/EVENT_POWER_NAD_ACCON_SIMULATE,
/*0xF013*/EVENT_POWER_NAD_ACCON_SIMULATE_ACK,
/*0xF014*/EVENT_POWER_NAD_ACCOFF_SIMULATE,
/*0xF015*/EVENT_POWER_NAD_ACCOFF_SIMULATE_ACK,
};

extern void Power_Mode_Init(void);
extern uint8_t GetHardWareVersion(void);

#endif /* APP_POWER_POWER_MANAGER_H_ */
