pwm_config.h 1.6 KB

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