pwm_config.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_PWM15
  57. #define PWM15_CONFIG \
  58. { \
  59. .tim_handle.Instance = TIM15, \
  60. .name = "pwm15", \
  61. .channel = RT_NULL \
  62. }
  63. #endif /* BSP_USING_PWM15 */
  64. #ifdef BSP_USING_PWM16
  65. #define PWM16_CONFIG \
  66. { \
  67. .tim_handle.Instance = TIM16, \
  68. .name = "pwm16", \
  69. .channel = RT_NULL \
  70. }
  71. #endif /* BSP_USING_PWM16 */
  72. #ifdef BSP_USING_PWM17
  73. #define PWM17_CONFIG \
  74. { \
  75. .tim_handle.Instance = TIM17, \
  76. .name = "pwm17", \
  77. .channel = RT_NULL \
  78. }
  79. #endif /* BSP_USING_PWM17 */
  80. #ifdef __cplusplus
  81. }
  82. #endif
  83. #endif /* __PWM_CONFIG_H__ */