tim_config.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2006-2018, 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. #ifndef TIM_DEV_INFO_CONFIG
  14. #define TIM_DEV_INFO_CONFIG \
  15. { \
  16. .maxfreq = 1000000, \
  17. .minfreq = 3000, \
  18. .maxcnt = 0xFFFF, \
  19. .cntmode = HWTIMER_CNTMODE_UP, \
  20. }
  21. #endif /* TIM_DEV_INFO_CONFIG */
  22. #ifdef BSP_USING_TIM11
  23. #ifndef TIM11_CONFIG
  24. #define TIM11_CONFIG \
  25. { \
  26. .tim_handle.Instance = TIM11, \
  27. .tim_irqn = TIM1_TRG_COM_TIM11_IRQn, \
  28. .name = "timer11", \
  29. }
  30. #endif /* TIM11_CONFIG */
  31. #endif /* BSP_USING_TIM11 */
  32. #ifdef BSP_USING_TIM13
  33. #ifndef TIM13_CONFIG
  34. #define TIM13_CONFIG \
  35. { \
  36. .tim_handle.Instance = TIM13, \
  37. .tim_irqn = TIM8_UP_TIM13_IRQn, \
  38. .name = "timer13", \
  39. }
  40. #endif /* TIM13_CONFIG */
  41. #endif /* BSP_USING_TIM13 */
  42. #ifdef BSP_USING_TIM14
  43. #ifndef TIM14_CONFIG
  44. #define TIM14_CONFIG \
  45. { \
  46. .tim_handle.Instance = TIM14, \
  47. .tim_irqn = TIM8_TRG_COM_TIM14_IRQn, \
  48. .name = "timer14", \
  49. }
  50. #endif /* TIM14_CONFIG */
  51. #endif /* BSP_USING_TIM14 */
  52. #endif /* __TIM_CONFIG_H__ */