bikebrake.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /****************************************
  18. *
  19. * Definitions & Macros
  20. *
  21. ****************************************/
  22. #define BIKEBRAKE_OUT_DEFAULT \
  23. { \
  24. 0,0, FALSE \
  25. } // Default value of BIKELIGHT_OUT
  26. #define BRAKE_DETECT_PORT 10 // PB10
  27. /***************************************
  28. *
  29. * Type Definations
  30. *
  31. ***************************************/
  32. /**
  33. * @brief Bikebrake out
  34. *
  35. */
  36. typedef struct
  37. {
  38. UWORD uwDetectTimeCnt; // Cnt of detect GPIO state change
  39. UWORD uwBikeBrakeCnt; // Cnt of detect GPIO state change
  40. BOOL blBikeBrakeOnFlg; // flag of brake on or off
  41. } BIKEBRAKE_OUT;
  42. /*****************************************
  43. *
  44. * Exported variable
  45. *
  46. ****************************************/
  47. /***************************************
  48. *
  49. * Function Definations
  50. *
  51. ***************************************/
  52. void bikebrake_voBikeBrakeInit(void); // api function
  53. void bikebrake_voBikeBrakeDetect(void); // api function
  54. BOOL BikeBrake_blGetBrkState(void);
  55. /************************************************************************/
  56. #endif
  57. /************************************************************************
  58. End of this File (EOF):
  59. Do not put anything after this part!
  60. *************************************************************************/