drv_pwm.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. * 2022-07-13 Rbb666 first version
  9. */
  10. #ifndef __PWM_CONFIG_H__
  11. #define __PWM_CONFIG_H__
  12. #include <rtthread.h>
  13. #include <board.h>
  14. #ifdef __cplusplus
  15. extern "C"
  16. {
  17. #endif
  18. #define MAX_PERIOD 65535
  19. #ifdef BSP_USING_PWM0
  20. #ifndef PWM0_CH0_PORT0_CONFIG
  21. #define PWM0_CH0_PORT0_CONFIG \
  22. { \
  23. .name = "pwm0", \
  24. .channel = 0, \
  25. .gpio = GET_PIN(0, 0), \
  26. }
  27. #endif /* PWM0_CH7_PORT2_CONFIG */
  28. #ifndef PWM0_CH7_PORT2_CONFIG
  29. #define PWM0_CH7_PORT2_CONFIG \
  30. { \
  31. .name = "pwm0", \
  32. .channel = 7, \
  33. .gpio = GET_PIN(2, 2), \
  34. }
  35. #endif /* PWM0_CH7_PORT2_CONFIG */
  36. #ifndef PWM0_CH7_PORT5_CONFIG
  37. #define PWM0_CH7_PORT5_CONFIG \
  38. { \
  39. .name = "pwm0", \
  40. .channel = 7, \
  41. .gpio = GET_PIN(5, 6), \
  42. }
  43. #endif /* PWM0_CH7_PORT5_CONFIG */
  44. #ifndef PWM0_CH7_PORT7_CONFIG
  45. #define PWM0_CH7_PORT7_CONFIG \
  46. { \
  47. .name = "pwm0", \
  48. .channel = 7, \
  49. .gpio = GET_PIN(7, 7), \
  50. }
  51. #endif /* PWM0_CH7_PORT7_CONFIG */
  52. #ifndef PWM0_CH7_PORT9_CONFIG
  53. #define PWM0_CH7_PORT9_CONFIG \
  54. { \
  55. .name = "pwm0", \
  56. .channel = 7, \
  57. .gpio = GET_PIN(9, 4), \
  58. }
  59. #endif /* PWM0_CH7_PORT9_CONFIG */
  60. #ifndef PWM0_CH7_PORT10_CONFIG
  61. #define PWM0_CH7_PORT10_CONFIG \
  62. { \
  63. .name = "pwm0", \
  64. .channel = 7, \
  65. .gpio = GET_PIN(10, 2), \
  66. }
  67. #endif /* PWM0_CH7_PORT10_CONFIG */
  68. #ifndef PWM0_CH7_PORT12_CONFIG
  69. #define PWM0_CH7_PORT12_CONFIG \
  70. { \
  71. .name = "pwm0", \
  72. .channel = 7, \
  73. .gpio = GET_PIN(12, 6), \
  74. }
  75. #endif /* PWM0_CH7_PORT12_CONFIG */
  76. #ifndef PWM0_CH3_PORT13_CONFIG
  77. #define PWM0_CH3_PORT13_CONFIG \
  78. { \
  79. .name = "pwm0", \
  80. .channel = 3, \
  81. .gpio = GET_PIN(13, 7), \
  82. }
  83. #endif /* PWM0_CH3_PORT13_CONFIG */
  84. #endif /* BSP_USING_PWM0 */
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif