pwm_config.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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-13 zylx first version
  9. */
  10. #ifndef __PWM_CONFIG_H__
  11. #define __PWM_CONFIG_H__
  12. #include <rtthread.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #ifdef BSP_USING_PWM1
  17. #ifndef PWM1_CONFIG
  18. #define PWM1_CONFIG \
  19. { \
  20. .tim_handle.Instance = TIM1, \
  21. .name = "pwm1", \
  22. .channel = 0 \
  23. }
  24. #endif /* PWM1_CONFIG */
  25. #endif /* BSP_USING_PWM1 */
  26. #ifdef BSP_USING_PWM2
  27. #ifndef PWM2_CONFIG
  28. #define PWM2_CONFIG \
  29. { \
  30. .tim_handle.Instance = TIM2, \
  31. .name = "pwm2", \
  32. .channel = 0 \
  33. }
  34. #endif /* PWM2_CONFIG */
  35. #endif /* BSP_USING_PWM2 */
  36. #ifdef BSP_USING_PWM3
  37. #ifndef PWM3_CONFIG
  38. #define PWM3_CONFIG \
  39. { \
  40. .tim_handle.Instance = TIM3, \
  41. .name = "pwm3", \
  42. .channel = 0 \
  43. }
  44. #endif /* PWM3_CONFIG */
  45. #endif /* BSP_USING_PWM3 */
  46. #ifdef BSP_USING_PWM4
  47. #ifndef PWM4_CONFIG
  48. #define PWM4_CONFIG \
  49. { \
  50. .tim_handle.Instance = TIM4, \
  51. .name = "pwm4", \
  52. .channel = 0 \
  53. }
  54. #endif /* PWM4_CONFIG */
  55. #endif /* BSP_USING_PWM4 */
  56. #ifdef BSP_USING_PWM5
  57. #ifndef PWM5_CONFIG
  58. #define PWM5_CONFIG \
  59. { \
  60. .tim_handle.Instance = TIM5, \
  61. .name = "pwm5", \
  62. .channel = 0 \
  63. }
  64. #endif /* PWM5_CONFIG */
  65. #endif /* BSP_USING_PWM5 */
  66. #ifdef BSP_USING_PWM8
  67. #ifndef PWM8_CONFIG
  68. #define PWM8_CONFIG \
  69. { \
  70. .tim_handle.Instance = TIM8, \
  71. .name = "pwm8", \
  72. .channel = 0 \
  73. }
  74. #endif /* PWM8_CONFIG */
  75. #endif /* BSP_USING_PWM8 */
  76. #ifdef BSP_USING_PWM9
  77. #ifndef PWM9_CONFIG
  78. #define PWM9_CONFIG \
  79. { \
  80. .tim_handle.Instance = TIM9, \
  81. .name = "pwm9", \
  82. .channel = 0 \
  83. }
  84. #endif /* PWM9_CONFIG */
  85. #endif /* BSP_USING_PWM9 */
  86. #ifdef BSP_USING_PWM12
  87. #ifndef PWM12_CONFIG
  88. #define PWM12_CONFIG \
  89. { \
  90. .tim_handle.Instance = TIM12, \
  91. .name = "pwm12", \
  92. .channel = 0 \
  93. }
  94. #endif /* PWM12_CONFIG */
  95. #endif /* BSP_USING_PWM12 */
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99. #endif /* __PWM_CONFIG_H__ */