drv_pwm.h 590 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2029-06-02 hqfang first implementation.
  9. */
  10. #ifndef __DRV_PWM__
  11. #define __DRV_PWM__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include <rthw.h>
  15. #include <drv_config.h>
  16. /* gd32 config class */
  17. struct gd32_pwm_config
  18. {
  19. const char *name;
  20. rt_uint32_t periph;
  21. rt_uint32_t period;
  22. rt_uint32_t pulse;
  23. };
  24. struct gd32_pwm
  25. {
  26. struct rt_device_pwm pwm_device;
  27. struct gd32_pwm_config *config;
  28. };
  29. #endif