drv_pwm.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. * 2020-1-13 Leo first version
  9. */
  10. #ifndef __PWM_CONFIG_H__
  11. #define __PWM_CONFIG_H__
  12. #include <rtthread.h>
  13. #include <drivers/rt_drv_pwm.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #ifdef BSP_USING_TIM3_CH1
  18. #ifndef PWM1_TIM3_CONFIG
  19. #define PWM1_TIM3_CONFIG \
  20. { \
  21. .tim_handle = TIM3, \
  22. .name = "tim3pwm1", \
  23. .channel = 1 \
  24. }
  25. #endif /* PWM1_TIM3_CONFIG */
  26. #endif /* BSP_USING_TIM3_CH1 */
  27. #ifdef BSP_USING_TIM3_CH2
  28. #ifndef PWM2_TIM3_CONFIG
  29. #define PWM2_TIM3_CONFIG \
  30. { \
  31. .tim_handle = TIM3, \
  32. .name = "tim3pwm2", \
  33. .channel = 2 \
  34. }
  35. #endif /* PWM2_TIM3_CONFIG */
  36. #endif /* BSP_USING_TIM3_CH2 */
  37. #ifdef BSP_USING_TIM3_CH3
  38. #ifndef PWM3_TIM3_CONFIG
  39. #define PWM3_TIM3_CONFIG \
  40. { \
  41. .tim_handle = TIM3, \
  42. .name = "tim3pwm3", \
  43. .channel = 3 \
  44. }
  45. #endif /* PWM3_TIM3_CONFIG */
  46. #endif /* BSP_USING_TIM3_CH3 */
  47. #ifdef BSP_USING_TIM3_CH4
  48. #ifndef PWM4_TIM3_CONFIG
  49. #define PWM4_TIM3_CONFIG \
  50. { \
  51. .tim_handle = TIM3, \
  52. .name = "tim3pwm4", \
  53. .channel = 4 \
  54. }
  55. #endif /* PWM4_TIM3_CONFIG */
  56. #endif /* BSP_USING_TIM3_CH4 */
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* __PWM_CONFIG_H__ */