pwm_config.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) 2006-2021, 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. #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 __cplusplus
  57. }
  58. #endif
  59. #endif /* __PWM_CONFIG_H__ */