pwm_config.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-12-24 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_PWM2
  17. #ifndef PWM2_CONFIG
  18. #define PWM2_CONFIG \
  19. { \
  20. .tim_handle.Instance = TIM2, \
  21. .name = "pwm2", \
  22. .channel = 0 \
  23. }
  24. #endif /* PWM2_CONFIG */
  25. #endif /* BSP_USING_PWM2 */
  26. #ifdef BSP_USING_PWM3
  27. #ifndef PWM3_CONFIG
  28. #define PWM3_CONFIG \
  29. { \
  30. .tim_handle.Instance = TIM3, \
  31. .name = "pwm3", \
  32. .channel = 0 \
  33. }
  34. #endif /* PWM3_CONFIG */
  35. #endif /* BSP_USING_PWM3 */
  36. #ifdef BSP_USING_PWM4
  37. #ifndef PWM4_CONFIG
  38. #define PWM4_CONFIG \
  39. { \
  40. .tim_handle.Instance = TIM4, \
  41. .name = "pwm4", \
  42. .channel = 0 \
  43. }
  44. #endif /* PWM4_CONFIG */
  45. #endif /* BSP_USING_PWM4 */
  46. #ifdef BSP_USING_PWM5
  47. #ifndef PWM5_CONFIG
  48. #define PWM5_CONFIG \
  49. { \
  50. .tim_handle.Instance = TIM5, \
  51. .name = "pwm5", \
  52. .channel = 0 \
  53. }
  54. #endif /* PWM5_CONFIG */
  55. #endif /* BSP_USING_PWM5 */
  56. #ifdef BSP_USING_PWM16
  57. #ifndef PWM16_CONFIG
  58. #define PWM16_CONFIG \
  59. { \
  60. .tim_handle.Instance = TIM16, \
  61. .name = "pwm16", \
  62. .channel = 0 \
  63. }
  64. #endif /* PWM16_CONFIG */
  65. #endif /* BSP_USING_PWM16 */
  66. #ifdef BSP_USING_PWM17
  67. #ifndef PWM17_CONFIG
  68. #define PWM17_CONFIG \
  69. { \
  70. .tim_handle.Instance = TIM17, \
  71. .name = "pwm17", \
  72. .channel = 0 \
  73. }
  74. #endif /* PWM17_CONFIG */
  75. #endif /* BSP_USING_PWM17 */
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif /* __PWM_CONFIG_H__ */