pwm_config.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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-13 zylx first version
  9. */
  10. #ifndef __PWM_CONFIG_H__
  11. #define __PWM_CONFIG_H__
  12. #include <rtthread.h>
  13. #ifdef BSP_USING_PWM2
  14. #ifndef PWM2_CONFIG
  15. #define PWM2_CONFIG \
  16. { \
  17. .tim_handle.Instance = TIM2, \
  18. .name = "pwm2", \
  19. .channel = 0 \
  20. }
  21. #endif /* PWM2_CONFIG */
  22. #endif /* BSP_USING_PWM2 */
  23. #ifdef BSP_USING_PWM3
  24. #ifndef PWM3_CONFIG
  25. #define PWM3_CONFIG \
  26. { \
  27. .tim_handle.Instance = TIM3, \
  28. .name = "pwm3", \
  29. .channel = 0 \
  30. }
  31. #endif /* PWM3_CONFIG */
  32. #endif /* BSP_USING_PWM3 */
  33. #ifdef BSP_USING_PWM4
  34. #ifndef PWM4_CONFIG
  35. #define PWM4_CONFIG \
  36. { \
  37. .tim_handle.Instance = TIM4, \
  38. .name = "pwm4", \
  39. .channel = 0 \
  40. }
  41. #endif /* PWM4_CONFIG */
  42. #endif /* BSP_USING_PWM4 */
  43. #ifdef BSP_USING_PWM5
  44. #ifndef PWM5_CONFIG
  45. #define PWM5_CONFIG \
  46. { \
  47. .tim_handle.Instance = TIM5, \
  48. .name = "pwm5", \
  49. .channel = 0 \
  50. }
  51. #endif /* PWM5_CONFIG */
  52. #endif /* BSP_USING_PWM5 */
  53. #endif /* __PWM_CONFIG_H__ */