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-12 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 = 2000, \
  18. .maxcnt = 0xFFFF, \
  19. .cntmode = HWTIMER_CNTMODE_UP, \
  20. }
  21. #endif /* TIM_DEV_INFO_CONFIG */
  22. #ifdef BSP_USING_TIM15
  23. #ifndef TIM15_CONFIG
  24. #define TIM15_CONFIG \
  25. { \
  26. .tim_handle.Instance = TIM15, \
  27. .tim_irqn = TIM1_BRK_TIM15_IRQn, \
  28. .name = "timer15", \
  29. }
  30. #endif /* TIM15_CONFIG */
  31. #endif /* BSP_USING_TIM15 */
  32. #ifdef BSP_USING_TIM16
  33. #ifndef TIM16_CONFIG
  34. #define TIM16_CONFIG \
  35. { \
  36. .tim_handle.Instance = TIM16, \
  37. .tim_irqn = TIM1_UP_TIM16_IRQn, \
  38. .name = "timer16", \
  39. }
  40. #endif /* TIM16_CONFIG */
  41. #endif /* BSP_USING_TIM16 */
  42. #ifdef BSP_USING_TIM17
  43. #ifndef TIM17_CONFIG
  44. #define TIM17_CONFIG \
  45. { \
  46. .tim_handle.Instance = TIM17, \
  47. .tim_irqn = TIM1_TRG_COM_TIM17_IRQn, \
  48. .name = "timer17", \
  49. }
  50. #endif /* TIM17_CONFIG */
  51. #endif /* BSP_USING_TIM17 */
  52. #endif /* __TIM_CONFIG_H__ */