pwm_config.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. * 2022-09-21 yuqi created
  9. */
  10. #ifndef DRIVERS_CONFIG_PWM_CONFIG_H_
  11. #define DRIVERS_CONFIG_PWM_CONFIG_H_
  12. #include "F28x_Project.h" // Device Headerfile and Examples Include File
  13. #include "F2837xD_epwm.h"
  14. #include "rtthread.h"
  15. #include "drv_config.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #ifdef BSP_USING_PWM1
  20. #ifndef PWM1_CONFIG
  21. #define PWM1_CONFIG \
  22. { \
  23. .name = "pwm1", \
  24. .pwm_regs = &EPwm1Regs, \
  25. }
  26. #endif
  27. #endif
  28. #ifdef BSP_USING_PWM2
  29. #ifndef PWM2_CONFIG
  30. #define PWM2_CONFIG \
  31. { \
  32. .name = "pwm2", \
  33. .pwm_regs = &EPwm2Regs, \
  34. }
  35. #endif
  36. #endif
  37. #ifdef BSP_USING_PWM3
  38. #ifndef PWM3_CONFIG
  39. #define PWM3_CONFIG \
  40. { \
  41. .name = "pwm3", \
  42. .pwm_regs = &EPwm3Regs, \
  43. }
  44. #endif
  45. #endif
  46. #ifdef BSP_USING_PWM4
  47. #ifndef PWM4_CONFIG
  48. #define PWM4_CONFIG \
  49. { \
  50. .name = "pwm4", \
  51. .pwm_regs = &EPwm4Regs, \
  52. }
  53. #endif
  54. #endif
  55. #define TZ_OFF 2
  56. #define TZ_ON 1
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #define RT_SHADOW_MODE CC_SHADOW
  61. #define RT_LOAD_TIME CC_CTR_ZERO
  62. #define RT_CTRMODE TB_COUNT_UPDOWN
  63. #endif /* DRIVERS_CONFIG_PWM_CONFIG_H_ */