tim_config.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_TIM1
  26. #ifndef TIM1_CONFIG
  27. #define TIM1_CONFIG \
  28. { \
  29. .tim_handle.Instance = TIM1, \
  30. .tim_irqn = TIM1_IRQn, \
  31. .name = "timer1", \
  32. }
  33. #endif /* TIM1_CONFIG */
  34. #endif /* BSP_USING_TIM1 */
  35. #ifdef __cplusplus
  36. }
  37. #endif
  38. #endif /* __TIM_CONFIG_H__ */