HW_TIMER_ATY.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. * @file HW_TIMER_ATY.h
  3. *
  4. * @param Project DEVICE_GENERAL_ATY_LIB
  5. *
  6. * @author ATY
  7. *
  8. * @copyright
  9. * - Copyright 2017 - 2026 MZ-ATY
  10. * - This code follows:
  11. * - MZ-ATY Various Contents Joint Statement -
  12. * <a href="https://mengze.top/MZ-ATY_VCJS">
  13. * https://mengze.top/MZ-ATY_VCJS</a>
  14. * - CC 4.0 BY-NC-SA -
  15. * <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
  16. * https://creativecommons.org/licenses/by-nc-sa/4.0/</a>
  17. * - Your use will be deemed to have accepted the terms of this statement.
  18. *
  19. * @brief functions of timer for C platform
  20. *
  21. * @version
  22. * - 1_01_220608 > ATY
  23. * -# Preliminary version, first Release
  24. * - 1_02_240410 > ATY
  25. * -# add multy addr and channel
  26. * -# add lock
  27. ********************************************************************************
  28. */
  29. #ifndef __HW_TIMER_ATY_H
  30. #define __HW_TIMER_ATY_H
  31. #include "INCLUDE_ATY.h"
  32. /******************************* For user *************************************/
  33. /******************************************************************************/
  34. struct HW_TIMER_ATY_Dev{
  35. uint32_t msN;
  36. uint32_t ms10;
  37. uint32_t ms100;
  38. uint32_t s1;
  39. uint32_t s2;
  40. uint32_t s10;
  41. uint8_t ms1_f;
  42. uint8_t ms10_f;
  43. uint8_t ms100_f;
  44. uint8_t s1_f;
  45. uint8_t s2_f;
  46. uint8_t s10_f;
  47. uint8_t timerInitFlag;
  48. void (*timerInit)();
  49. /**
  50. * @brief timer cycle process in user define self
  51. */
  52. void (*timerLoopProcess_User)();
  53. uint8_t lock;
  54. };
  55. void UserTimerLoop_Cycle1ms(struct HW_TIMER_ATY_Dev* dev);
  56. void UserTimerLoopProcess(struct HW_TIMER_ATY_Dev* dev);
  57. #endif /* __HW_TIMER_ATY_H */
  58. /******************************** End Of File *********************************/