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