drv_pwm.h 839 B

12345678910111213141516171819202122232425262728293031323334
  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. * 2021-10-25 KevinXu first version
  9. */
  10. #ifndef __DRV_PWM_H__
  11. #define __DRV_PWM_H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include <rthw.h>
  15. #include <drv_common.h>
  16. #include <drv_config.h>
  17. #include <hal_data.h>
  18. /* PWM device object structure */
  19. struct ra_pwm
  20. {
  21. struct rt_device_pwm pwm_device;
  22. gpt_instance_ctrl_t *g_ctrl;
  23. timer_instance_t const *const g_timer;
  24. timer_cfg_t const *const g_cfg;
  25. char *name;
  26. };
  27. /* Get ra6m4 pwm device object from the general pwm device object */
  28. #define _GET_RA6M4_PWM_OBJ(ptr) rt_container_of(ptr, struct ra_pwm, pwm_device)
  29. #endif /* __DRV_PWM_H__ */