tim_config.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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-11 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 = 3000, \
  21. .maxcnt = 0xFFFF, \
  22. .cntmode = HWTIMER_CNTMODE_UP, \
  23. }
  24. #endif /* TIM_DEV_INFO_CONFIG */
  25. #ifdef BSP_USING_TIM14
  26. #ifndef TIM14_CONFIG
  27. #define TIM14_CONFIG \
  28. { \
  29. .tim_handle.Instance = TIM14, \
  30. .tim_irqn = TIM14_IRQn, \
  31. .name = "timer14", \
  32. }
  33. #endif /* TIM14_CONFIG */
  34. #endif /* BSP_USING_TIM14 */
  35. #ifdef BSP_USING_TIM16
  36. #ifndef TIM16_CONFIG
  37. #define TIM16_CONFIG \
  38. { \
  39. .tim_handle.Instance = TIM16, \
  40. .tim_irqn = TIM16_IRQn, \
  41. .name = "timer16", \
  42. }
  43. #endif /* TIM16_CONFIG */
  44. #endif /* BSP_USING_TIM16 */
  45. #ifdef BSP_USING_TIM17
  46. #ifndef TIM17_CONFIG
  47. #define TIM17_CONFIG \
  48. { \
  49. .tim_handle.Instance = TIM17, \
  50. .tim_irqn = TIM17_IRQn, \
  51. .name = "timer17", \
  52. }
  53. #endif /* TIM17_CONFIG */
  54. #endif /* BSP_USING_TIM17 */
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif /* __TIM_CONFIG_H__ */