/** * @file bikebrake.h * @author Wang, Zhiyu(wangzy49@midea.com) * @brief Brake of ebike * @version 0.1 * @date 2021-10-08 * * @copyright Copyright (c) 2021 * */ /************************************************************************ Beginning of File, do not put anything above here except notes Compiler Directives: *************************************************************************/ #ifndef BIKEBRAKE_H #define BIKEBRAKE_H typedef _Bool BOOL; /**************************************** * * Definitions & Macros * ****************************************/ #define BIKEBRAKE_OUT_DEFAULT \ { \ 0,0, FALSE \ } // Default value of BIKELIGHT_OUT #define BRAKE_DETECT_PORT GPIOD // GPIOD #define BRAKE_DETECT_PIN GPIO_Pin_2 // 2 /*************************************** * * Type Definations * ***************************************/ /** * @brief Bikebrake out * */ typedef struct { UWORD uwDetectTimeCnt; // Cnt of detect GPIO state change UWORD uwBikeBrakeCnt; // Cnt of detect GPIO state change BOOL blBikeBrakeOnFlg; // flag of brake on or off } BIKEBRAKE_OUT; /***************************************** * * Exported variable * ****************************************/ /*************************************** * * Function Definations * ***************************************/ void bikebrake_voBikeBrakeInit(void); // api function void bikebrake_voBikeBrakeDetect(void); // api function BOOL BikeBrake_blGetstate(void); /************************************************************************/ #endif /************************************************************************ End of this File (EOF): Do not put anything after this part! *************************************************************************/