bikegearsensor.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * @file bikegearsensor.h
  3. * @author Zhou xiong(zhouxiong9@midea.com)
  4. * @brief Gear Sensor of ebike
  5. * @version 0.1
  6. * @date 2023-02-03
  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 BIKEGEARSENSOR_H
  16. #define BIKEGEARSENSOR_H
  17. #include "typedefine.h"
  18. /****************************************
  19. *
  20. * Definitions & Macros
  21. *
  22. ****************************************/
  23. #define GEARSENSOR_OUT_DEFAULT \
  24. { \
  25. 0,0, FALSE \
  26. } // Default value
  27. /***************************************
  28. *
  29. * Type Definations
  30. *
  31. ***************************************/
  32. /**
  33. * @brief Bike Gear Sensor out
  34. *
  35. */
  36. typedef struct
  37. {
  38. UWORD uwDetectTimeCnt; // Cnt of detect GPIO state change
  39. UWORD uwGearSensorCnt; // Cnt of detect GPIO state change
  40. BOOL blGearSensorOnFlg; // flag of GearSensor on or off
  41. } BIKE_GEARSENSOR_OUT;
  42. /*****************************************
  43. *
  44. * Exported variable
  45. *
  46. ****************************************/
  47. /***************************************
  48. *
  49. * Function Definations
  50. *
  51. ***************************************/
  52. void bikegearsensor_voBikeGearsensorInit(void); // api function
  53. void bikegearsensor_voBikeGearsensorDetect(void); // api function
  54. BOOL bikegearsensor_blBikeGetState(void);
  55. /************************************************************************/
  56. #endif
  57. /************************************************************************
  58. End of this File (EOF):
  59. Do not put anything after this part!
  60. *************************************************************************/