drv_pwm.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. * 2020-1-13 Leo first version
  9. */
  10. #ifndef __PWM_CONFIG_H__
  11. #define __PWM_CONFIG_H__
  12. #include <rtthread.h>
  13. #include <drivers/rt_drv_pwm.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #ifdef BSP_USING_TMR1_CH1
  18. #ifndef PWM1_CONFIG
  19. #define PWM1_CONFIG \
  20. { \
  21. .tim_handle = TMR1, \
  22. .name = "tmr1pwm1", \
  23. .channel = 1 \
  24. }
  25. #endif /* PWM1_CONFIG */
  26. #endif /* BSP_USING_TMR1_CH1 */
  27. #ifdef BSP_USING_TMR1_CH2
  28. #ifndef PWM2_CONFIG
  29. #define PWM2_CONFIG \
  30. { \
  31. .tim_handle = TMR1, \
  32. .name = "tmr1pwm2", \
  33. .channel = 2 \
  34. }
  35. #endif /* PWM2_CONFIG */
  36. #endif /* BSP_USING_TMR1_CH2 */
  37. #ifdef BSP_USING_TMR1_CH3
  38. #ifndef PWM3_CONFIG
  39. #define PWM3_CONFIG \
  40. { \
  41. .tim_handle = TMR1, \
  42. .name = "tmr1pwm3", \
  43. .channel = 3 \
  44. }
  45. #endif /* PWM3_CONFIG */
  46. #endif /* BSP_USING_TMR1_CH3 */
  47. #ifdef BSP_USING_TMR1_CH4
  48. #ifndef PWM4_CONFIG
  49. #define PWM4_CONFIG \
  50. { \
  51. .tim_handle = TMR1, \
  52. .name = "tmr1pwm4", \
  53. .channel = 4 \
  54. }
  55. #endif /* PWM4_CONFIG */
  56. #endif /* BSP_USING_TMR1_CH4 */
  57. #ifdef BSP_USING_TMR2_CH1
  58. #ifndef PWM5_CONFIG
  59. #define PWM5_CONFIG \
  60. { \
  61. .tim_handle = TMR2, \
  62. .name = "tmr2pwm1", \
  63. .channel = 1 \
  64. }
  65. #endif /* PWM5_CONFIG */
  66. #endif /* BSP_USING_TMR2_CH1 */
  67. #ifdef BSP_USING_TMR2_CH2
  68. #ifndef PWM6_CONFIG
  69. #define PWM6_CONFIG \
  70. { \
  71. .tim_handle = TMR2, \
  72. .name = "tmr2pwm2", \
  73. .channel = 2 \
  74. }
  75. #endif /* PWM6_CONFIG */
  76. #endif /* BSP_USING_TMR2_CH2 */
  77. #ifdef BSP_USING_TMR2_CH3
  78. #ifndef PWM7_CONFIG
  79. #define PWM7_CONFIG \
  80. { \
  81. .tim_handle = TMR2, \
  82. .name = "tmr2pwm3", \
  83. .channel = 3 \
  84. }
  85. #endif /* PWM7_CONFIG */
  86. #endif /* BSP_USING_TMR2_CH3 */
  87. #ifdef BSP_USING_TMR2_CH4
  88. #ifndef PWM8_CONFIG
  89. #define PWM8_CONFIG \
  90. { \
  91. .tim_handle = TMR2, \
  92. .name = "tmr2pwm4", \
  93. .channel = 4 \
  94. }
  95. #endif /* PWM8_CONFIG */
  96. #endif /* BSP_USING_TMR2_CH4 */
  97. #ifdef BSP_USING_TMR3_CH1
  98. #ifndef PWM9_CONFIG
  99. #define PWM9_CONFIG \
  100. { \
  101. .tim_handle = TMR3, \
  102. .name = "tmr3pwm1", \
  103. .channel = 1 \
  104. }
  105. #endif /* PWM9_CONFIG */
  106. #endif /* BSP_USING_TMR3_CH1 */
  107. #ifdef BSP_USING_TMR3_CH2
  108. #ifndef PWM10_CONFIG
  109. #define PWM10_CONFIG \
  110. { \
  111. .tim_handle = TMR3, \
  112. .name = "tmr3pwm2", \
  113. .channel = 2 \
  114. }
  115. #endif /* PWM10_CONFIG */
  116. #endif /* BSP_USING_TMR3_CH2 */
  117. #ifdef BSP_USING_TMR3_CH3
  118. #ifndef PWM11_CONFIG
  119. #define PWM11_CONFIG \
  120. { \
  121. .tim_handle = TMR3, \
  122. .name = "tmr3pwm3", \
  123. .channel = 3 \
  124. }
  125. #endif /* PWM11_CONFIG */
  126. #endif /* BSP_USING_TMR3_CH3 */
  127. #ifdef BSP_USING_TMR3_CH4
  128. #ifndef PWM12_CONFIG
  129. #define PWM12_CONFIG \
  130. { \
  131. .tim_handle = TMR3, \
  132. .name = "tmr3pwm4", \
  133. .channel = 4 \
  134. }
  135. #endif /* PWM12_CONFIG */
  136. #endif /* BSP_USING_TMR3_CH4 */
  137. #ifdef __cplusplus
  138. }
  139. #endif
  140. #endif /* __PWM_CONFIG_H__ */