bikebrake.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * @file bikebrake.h
  3. * @author Wang, Zhiyu(wangzy49@midea.com)
  4. * @brief Brake of ebike
  5. * @version 0.1
  6. * @date 2021-10-08
  7. *
  8. * @copyright Copyright (c) 2021
  9. *
  10. */
  11. /************************************************************************
  12. Beginning of File, do not put anything above here except notes
  13. Compiler Directives:
  14. *************************************************************************/
  15. #ifndef BIKEBRAKE_H
  16. #define BIKEBRAKE_H
  17. #include "typedefine.h"
  18. /****************************************
  19. *
  20. * Definitions & Macros
  21. *
  22. ****************************************/
  23. #define BIKEBRAKE_OUT_DEFAULT \
  24. { \
  25. 0,0, FALSE \
  26. } // Default value of BIKELIGHT_OUT
  27. #define BRAKE_DETECT_PORT 10 // PB10
  28. /***************************************
  29. *
  30. * Type Definations
  31. *
  32. ***************************************/
  33. /**
  34. * @brief Bikebrake out
  35. *
  36. */
  37. typedef struct
  38. {
  39. UWORD uwDetectTimeCnt; // Cnt of detect GPIO state change
  40. UWORD uwBikeBrakeCnt; // Cnt of detect GPIO state change
  41. BOOL blBikeBrakeOnFlg; // flag of brake on or off
  42. } BIKEBRAKE_OUT;
  43. /*****************************************
  44. *
  45. * Exported variable
  46. *
  47. ****************************************/
  48. /***************************************
  49. *
  50. * Function Definations
  51. *
  52. ***************************************/
  53. void bikebrake_voBikeBrakeInit(void); // api function
  54. void bikebrake_voBikeBrakeDetect(void); // api function
  55. BOOL BikeBrake_blGetstate(void);
  56. /************************************************************************/
  57. #endif
  58. /************************************************************************
  59. End of this File (EOF):
  60. Do not put anything after this part!
  61. *************************************************************************/