pwm_config.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #define PWM1_CONFIG \
  19. { \
  20. .tim_handle.Instance = TIM1, \
  21. .name = "pwm1", \
  22. .channel = RT_NULL \
  23. }
  24. #endif /* BSP_USING_PWM1 */
  25. #ifdef BSP_USING_PWM2
  26. #define PWM2_CONFIG \
  27. { \
  28. .tim_handle.Instance = TIM2, \
  29. .name = "pwm2", \
  30. .channel = RT_NULL \
  31. }
  32. #endif /* BSP_USING_PWM2 */
  33. #ifdef BSP_USING_PWM3
  34. #define PWM3_CONFIG \
  35. { \
  36. .tim_handle.Instance = TIM3, \
  37. .name = "pwm3", \
  38. .channel = RT_NULL \
  39. }
  40. #endif /* BSP_USING_PWM3 */
  41. #ifdef BSP_USING_PWM4
  42. #define PWM4_CONFIG \
  43. { \
  44. .tim_handle.Instance = TIM4, \
  45. .name = "pwm4", \
  46. .channel = RT_NULL \
  47. }
  48. #endif /* BSP_USING_PWM4 */
  49. #ifdef BSP_USING_PWM5
  50. #define PWM5_CONFIG \
  51. { \
  52. .tim_handle.Instance = TIM5, \
  53. .name = "pwm5", \
  54. .channel = RT_NULL \
  55. }
  56. #endif /* BSP_USING_PWM5 */
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* __PWM_CONFIG_H__ */