123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- /**
- * @file ctrlmdfsm1.h
- * @author Zhang, Kai(zhangkai71@midea.com)
- * @brief Control mode FSM
- * @version 0.1
- * @date 2021-09-27
- *
- * @copyright Copyright (c) 2021
- *
- */
- #ifndef FSM2ND_H
- #define FSM2ND_H
- #include "typedefine.h"
- /****************************************
- *
- * Definitions & Macros
- *
- ****************************************/
- #define CTRLMD_FSM_FLG_DEFAULT \
- { \
- FALSE, TRUE \
- } // Default value of CTRLMD_FSM_FLG
- /***************************************
- *
- * Type Definations
- *
- ***************************************/
- /**
- * @brief Type of control mode FSM
- *
- */
- typedef enum
- {
- Assistance = 0,
- Boost = 1,
- Cruise = 2,
- Exit = 3,
- Charge1 = 4,
- } RUN_FSM_STATUS;
- /**
- * @brief Type of control mode function hook
- *
- */
- typedef struct
- {
- RUN_FSM_STATUS state;
- void (*Event_hook)(void);
- void (*Tbcup_hook)(void);
- void (*Tbcdown_hook)(void); ///<
- void (*Tbs_hook)(void);
- } FSM_RUN_HOOK;
- /**
- * @brief Type of control mode flag
- *
- */
- typedef struct
- {
- BOOL blCmdRunFlg;
- BOOL blMotorStopFlg;
- } CTRLMD_FSM_FLG1;
- /****************************************
- *
- * Exported variable
- *
- ****************************************/
- extern FSM_RUN_HOOK FSM2nd_Run_state;
- extern FSM_RUN_HOOK Exit_state;
- extern CTRLMD_FSM_FLG1 cmfsm_stFlg;
- /***************************************
- *
- * Function Definations
- *
- ***************************************/
- /**
- *
- * @brief Process of control mode FSM during Assistance state
- *
- */
- void Assistance_hook(void);
- /**
- * @brief Process of tbc_up during Assistance state
- *
- */
- void Assistance_tbcuphook(void);
- /**
- * @brief @brief Process of tbc_down during Assistance state
- *
- */
- void Assistance_tbcdownhook(void);
- /**
- * @brief @brief Process of tbs during Assistance state
- *
- */
- void Assistance_tbshook(void);
- /**
- *
- * @brief Process of control mode FSM during Boost state
- *
- */
- void Boost_hook(void);
- /**
- *
- * @brief Process of tbc_up during Boost state
- *
- */
- void Boost_tbcuphook(void);
- /**
- *
- * @brief Process of tbc_down during Boost state
- *
- */
- void Boost_tbcdownhook(void);
- /**
- *
- * @brief Process of tbs during Boost state
- *
- */
- void Boost_tbshook(void);
- /**
- *
- * @brief Process of control mode FSM during Exit state
- *
- */
- void Exit_hook(void);
- /**
- *
- * @brief Process of tbc_up during Exit state
- *
- */
- void Exit_tbcuphook(void);
- /**
- *
- * @brief Process of tbc_down during Exit state
- *
- */
- void Exit_tbcdownhook(void);
- /**
- *
- * @brief Process of tbs during Exit state
- *
- */
- void Exit_tbshook(void);
- /**
- * @brief Switch current state to *in state
- *
- * @param in pointer to target state
- */
- void Switch_Second_FSM(FSM_RUN_HOOK *in);
- /**
- *
- * @brief Control mode FSM running function
- *
- */
- void FSM_2nd_Main(void);
- /**
- *
- *
- * @brief Control mode FSM initialization
- *
- */
- void RUN_FSM_voInit(void);
- #endif
|