HW_TIMER_ATY.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 - 2025 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 Familiar functions of I2C with IO simulation for all embedded device
  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. {
  36. uint32_t msN;
  37. uint32_t ms10;
  38. uint32_t ms100;
  39. uint32_t s1;
  40. uint32_t s2;
  41. uint32_t s10;
  42. uint8_t ms1_f;
  43. uint8_t ms10_f;
  44. uint8_t ms100_f;
  45. uint8_t s1_f;
  46. uint8_t s2_f;
  47. uint8_t s10_f;
  48. uint8_t timerInitFlag;
  49. void (*timerInit)();
  50. /**
  51. * @brief timer cycle process in user define self
  52. */
  53. void (*timerLoopProcess_User)();
  54. uint8_t lock;
  55. uint8_t debugEnable;
  56. void (*LOG)(const char*, ...);
  57. };
  58. void UserTimerLoop_Cycle1ms(struct HW_TIMER_ATY_Dev* dev);
  59. void UserTimerLoopProcess(struct HW_TIMER_ATY_Dev* dev);
  60. #endif /* __HW_TIMER_ATY_H */
  61. /******************************** End Of File *********************************/