pwm_config.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /*
  2. * Copyright (c) 2006-2023, 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. #define PWM1_CONFIG \
  18. { \
  19. .tim_handle.Instance = TIM1, \
  20. .name = "pwm1", \
  21. .channel = RT_NULL \
  22. }
  23. #endif /* BSP_USING_PWM1 */
  24. #ifdef BSP_USING_PWM2
  25. #define PWM2_CONFIG \
  26. { \
  27. .tim_handle.Instance = TIM2, \
  28. .name = "pwm2", \
  29. .channel = RT_NULL \
  30. }
  31. #endif /* BSP_USING_PWM2 */
  32. #ifdef BSP_USING_PWM3
  33. #define PWM3_CONFIG \
  34. { \
  35. .tim_handle.Instance = TIM3, \
  36. .name = "pwm3", \
  37. .channel = RT_NULL \
  38. }
  39. #endif /* BSP_USING_PWM3 */
  40. #ifdef BSP_USING_PWM4
  41. #define PWM4_CONFIG \
  42. { \
  43. .tim_handle.Instance = TIM4, \
  44. .name = "pwm4", \
  45. .channel = RT_NULL \
  46. }
  47. #endif /* BSP_USING_PWM4 */
  48. #ifdef BSP_USING_PWM5
  49. #define PWM5_CONFIG \
  50. { \
  51. .tim_handle.Instance = TIM5, \
  52. .name = "pwm5", \
  53. .channel = RT_NULL \
  54. }
  55. #endif /* BSP_USING_PWM5 */
  56. #ifdef BSP_USING_PWM6
  57. #define PWM6_CONFIG \
  58. { \
  59. .tim_handle.Instance = TIM6, \
  60. .name = "pwm6", \
  61. .channel = RT_NULL \
  62. }
  63. #endif /* BSP_USING_PWM6 */
  64. #ifdef BSP_USING_PWM7
  65. #define PWM7_CONFIG \
  66. { \
  67. .tim_handle.Instance = TIM7, \
  68. .name = "pwm7", \
  69. .channel = RT_NULL \
  70. }
  71. #endif /* BSP_USING_PWM7 */
  72. #ifdef BSP_USING_PWM8
  73. #define PWM8_CONFIG \
  74. { \
  75. .tim_handle.Instance = TIM8, \
  76. .name = "pwm8", \
  77. .channel = RT_NULL \
  78. }
  79. #endif /* BSP_USING_PWM8 */
  80. #ifdef BSP_USING_PWM9
  81. #define PWM9_CONFIG \
  82. { \
  83. .tim_handle.Instance = TIM9, \
  84. .name = "pwm9", \
  85. .channel = RT_NULL \
  86. }
  87. #endif /* BSP_USING_PWM9 */
  88. #ifdef BSP_USING_PWM10
  89. #define PWM10_CONFIG \
  90. { \
  91. .tim_handle.Instance = TIM10, \
  92. .name = "pwm10", \
  93. .channel = RT_NULL \
  94. }
  95. #endif /* BSP_USING_PWM10 */
  96. #ifdef BSP_USING_PWM11
  97. #define PWM11_CONFIG \
  98. { \
  99. .tim_handle.Instance = TIM11, \
  100. .name = "pwm11", \
  101. .channel = RT_NULL \
  102. }
  103. #endif /* BSP_USING_PWM11 */
  104. #ifdef BSP_USING_PWM12
  105. #define PWM12_CONFIG \
  106. { \
  107. .tim_handle.Instance = TIM12, \
  108. .name = "pwm12", \
  109. .channel = RT_NULL \
  110. }
  111. #endif /* BSP_USING_PWM12 */
  112. #ifdef BSP_USING_PWM13
  113. #define PWM13_CONFIG \
  114. { \
  115. .tim_handle.Instance = TIM13, \
  116. .name = "pwm13", \
  117. .channel = RT_NULL \
  118. }
  119. #endif /* BSP_USING_PWM13 */
  120. #ifdef BSP_USING_PWM14
  121. #define PWM14_CONFIG \
  122. { \
  123. .tim_handle.Instance = TIM14, \
  124. .name = "pwm14", \
  125. .channel = RT_NULL \
  126. }
  127. #endif /* BSP_USING_PWM14 */
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif /* __PWM_CONFIG_H__ */