tim_config.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-12-24 zylx first version
  9. */
  10. #ifndef __TIM_CONFIG_H__
  11. #define __TIM_CONFIG_H__
  12. #include <rtthread.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #ifndef TIM_DEV_INFO_CONFIG
  17. #define TIM_DEV_INFO_CONFIG \
  18. { \
  19. .maxfreq = 1000000, \
  20. .minfreq = 2000, \
  21. .maxcnt = 0xFFFF, \
  22. .cntmode = HWTIMER_CNTMODE_UP, \
  23. }
  24. #endif /* TIM_DEV_INFO_CONFIG */
  25. #ifdef BSP_USING_TIM7
  26. #ifndef TIM7_CONFIG
  27. #define TIM7_CONFIG \
  28. { \
  29. .tim_handle.Instance = TIM7, \
  30. .tim_irqn = TIM7_IRQn, \
  31. .name = "timer7", \
  32. }
  33. #endif /* TIM7_CONFIG */
  34. #endif /* BSP_USING_TIM7 */
  35. #ifdef BSP_USING_TIM14
  36. #ifndef TIM14_CONFIG
  37. #define TIM14_CONFIG \
  38. { \
  39. .tim_handle.Instance = TIM14, \
  40. .tim_irqn = TIM14_IRQn, \
  41. .name = "timer14", \
  42. }
  43. #endif /* TIM14_CONFIG */
  44. #endif /* BSP_USING_TIM14 */
  45. #ifdef BSP_USING_TIM16
  46. #ifndef TIM16_CONFIG
  47. #define TIM16_CONFIG \
  48. { \
  49. .tim_handle.Instance = TIM16, \
  50. .tim_irqn = TIM16_IRQn, \
  51. .name = "timer16", \
  52. }
  53. #endif /* TIM16_CONFIG */
  54. #endif /* BSP_USING_TIM16 */
  55. #ifdef BSP_USING_TIM17
  56. #ifndef TIM17_CONFIG
  57. #define TIM17_CONFIG \
  58. { \
  59. .tim_handle.Instance = TIM17, \
  60. .tim_irqn = TIM17_IRQn, \
  61. .name = "timer17", \
  62. }
  63. #endif /* TIM17_CONFIG */
  64. #endif /* BSP_USING_TIM17 */
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif /* __TIM_CONFIG_H__ */