drv_hwtimer.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-02-22 airm2m first version
  9. */
  10. #ifndef __DRV_HWTIMER_H__
  11. #define __DRV_HWTIMER_H__
  12. #include <rtthread.h>
  13. #ifdef BSP_USING_TIM
  14. #include <board.h>
  15. struct hwtimer_device
  16. {
  17. struct rt_hwtimer_device parent;
  18. TIM_TypeDef *periph;
  19. IRQn_Type irqn;
  20. char *name;
  21. };
  22. #ifdef BSP_USING_TIM1
  23. struct hwtimer_device hwtimer_device1 =
  24. {
  25. .periph = TIM1,
  26. .irqn = TIM1_UP_IRQn,
  27. .name = "timer1"};
  28. #endif
  29. #ifdef BSP_USING_TIM2
  30. struct hwtimer_device hwtimer_device2 =
  31. {
  32. .periph = TIM2,
  33. .irqn = TIM2_IRQn,
  34. .name = "timer2"};
  35. #endif
  36. #ifdef BSP_USING_TIM3
  37. struct hwtimer_device hwtimer_device3 =
  38. {
  39. .periph = TIM3,
  40. .irqn = TIM3_IRQn,
  41. .name = "timer3"};
  42. #endif
  43. #ifdef BSP_USING_TIM4
  44. struct hwtimer_device hwtimer_device4 =
  45. {
  46. .periph = TIM4,
  47. .irqn = TIM4_IRQn,
  48. .name = "timer4"};
  49. #endif
  50. #endif /* BSP_USING_HWTIMER */
  51. #endif /* __DRV_HWTIMER_H__ */