pwm_config.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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-13 zylx first version
  9. * 2022-04-14 Miaowulue add PWM1
  10. */
  11. #ifndef __PWM_CONFIG_H__
  12. #define __PWM_CONFIG_H__
  13. #include <rtthread.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #ifdef BSP_USING_PWM1
  18. #ifndef PWM1_CONFIG
  19. #define PWM1_CONFIG \
  20. { \
  21. .tim_handle.Instance = TIM1, \
  22. .name = "pwm1", \
  23. .channel = 0 \
  24. }
  25. #endif /* PWM1_CONFIG */
  26. #endif /* BSP_USING_PWM1 */
  27. #ifdef BSP_USING_PWM2
  28. #ifndef PWM2_CONFIG
  29. #define PWM2_CONFIG \
  30. { \
  31. .tim_handle.Instance = TIM2, \
  32. .name = "pwm2", \
  33. .channel = 0 \
  34. }
  35. #endif /* PWM2_CONFIG */
  36. #endif /* BSP_USING_PWM2 */
  37. #ifdef BSP_USING_PWM3
  38. #ifndef PWM3_CONFIG
  39. #define PWM3_CONFIG \
  40. { \
  41. .tim_handle.Instance = TIM3, \
  42. .name = "pwm3", \
  43. .channel = 0 \
  44. }
  45. #endif /* PWM3_CONFIG */
  46. #endif /* BSP_USING_PWM3 */
  47. #ifdef BSP_USING_PWM4
  48. #ifndef PWM4_CONFIG
  49. #define PWM4_CONFIG \
  50. { \
  51. .tim_handle.Instance = TIM4, \
  52. .name = "pwm4", \
  53. .channel = 0 \
  54. }
  55. #endif /* PWM4_CONFIG */
  56. #endif /* BSP_USING_PWM4 */
  57. #ifdef BSP_USING_PWM5
  58. #ifndef PWM5_CONFIG
  59. #define PWM5_CONFIG \
  60. { \
  61. .tim_handle.Instance = TIM5, \
  62. .name = "pwm5", \
  63. .channel = 0 \
  64. }
  65. #endif /* PWM5_CONFIG */
  66. #endif /* BSP_USING_PWM5 */
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif /* __PWM_CONFIG_H__ */