pwm_config.h 1015 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2006-2025, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2025-08-17 CYFS first version
  9. */
  10. #ifndef __PWM_CONFIG_H__
  11. #define __PWM_CONFIG_H__
  12. #include <rtthread.h>
  13. #include <drv_config.h>
  14. #include "hal_data.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. enum
  19. {
  20. #ifdef BSP_USING_PWM4
  21. BSP_PWM4_INDEX,
  22. #endif
  23. #ifdef BSP_USING_PWM5
  24. BSP_PWM5_INDEX,
  25. #endif
  26. #ifdef BSP_USING_PWM6
  27. BSP_PWM6_INDEX,
  28. #endif
  29. #ifdef BSP_USING_PWM7
  30. BSP_PWM7_INDEX,
  31. #endif
  32. #ifdef BSP_USING_PWM8
  33. BSP_PWM8_INDEX,
  34. #endif
  35. #ifdef BSP_USING_PWM9
  36. BSP_PWM9_INDEX,
  37. #endif
  38. BSP_PWMS_NUM
  39. };
  40. #define PWM_DRV_INITIALIZER(num) \
  41. { \
  42. .name = "pwm"#num , \
  43. .g_cfg = &g_timer##num##_cfg, \
  44. .g_ctrl = &g_timer##num##_ctrl, \
  45. .g_timer = &g_timer##num, \
  46. }
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* __PWM_CONFIG_H__ */