18#ifndef __HAL_DRIVER_TIMER_GPIO_PWM_H__
19#define __HAL_DRIVER_TIMER_GPIO_PWM_H__
33#if VSF_HAL_USE_PWM == ENABLED && VSF_HAL_USE_TIMER_GPIO_PWM == ENABLED
38#if defined(__VSF_HAL_TIMER_GPIO_PWM_CLASS_IMPLEMENT)
39# define __VSF_CLASS_IMPLEMENT__
50#ifndef VSF_TIMER_GPIO_PWM_CFG_MULTI_CLASS
51# define VSF_TIMER_GPIO_PWM_CFG_MULTI_CLASS VSF_PWM_CFG_MULTI_CLASS
56#if VSF_TIMER_GPIO_PWM_CFG_MULTI_CLASS == ENABLED
57# define __VSF_TIMER_GPIO_MULTI_PWM_INIT_HALOP \
58 .vsf_pwm.op = &vsf_timer_gpio_multi_pwm_op,
59# define __VSF_TIMER_GPIO_SINGLE_PWM_INIT_HALOP \
60 .vsf_pwm.op = &vsf_timer_gpio_single_pwm_op,
62# define __VSF_TIMER_GPIO_MULTI_PWM_INIT_HALOP
63# define __VSF_TIMER_GPIO_SINGLE_PWM_INIT_HALOP
66#define __VSF_TIMER_GPIO_MULTI_PWM_INIT(__TIMER, __GPIO_PORT, __CHANNEL_NUM, __CHANNELS)\
67 __VSF_TIMER_GPIO_MULTI_PWM_INIT_HALOP \
68 .timer = (vsf_timer_t *)(__TIMER), \
69 .gpio = (vsf_gpio_t *)(__GPIO_PORT), \
70 .channels = (__CHANNELS), \
71 .channel_num = (__CHANNEL_NUM),
72#define VSF_TIMER_GPIO_MULTI_PWM_INIT(__TIMER, __GPIO_PORT, __CHANNEL_NUM, __CHANNELS)\
73 __VSF_TIMER_GPIO_MULTI_PWM_INIT((__TIMER), (__GPIO_PORT), (__CHANNEL_NUM), (__CHANNELS))
75#define __describe_timer_gpio_multi_pwm_channel(__config) \
76 { .config = (__config) },
78#define __describe_timer_gpio_multi_pwm(__name, __timer, __gpio_port, ...) \
79 static vsf_timer_gpio_multi_pwm_channel_t VSF_MCONNECT3(__, __name, _channels)[] = {\
80 VSF_MFOREACH(__describe_timer_gpio_multi_pwm_channel, __VA_ARGS__)\
82 vsf_timer_gpio_multi_pwm_t __name = { \
83 VSF_TIMER_GPIO_MULTI_PWM_INIT((__timer), (__gpio_port), \
84 dimof(VSF_MCONNECT3(__, __name, _channels)), \
85 VSF_MCONNECT3(__, __name, _channels)) \
88#define describe_timer_gpio_multi_pwm(__name, __timer, __gpio_port, ...) \
89 __describe_timer_gpio_multi_pwm(__name, (__timer), (__gpio_port), __VA_ARGS__)
92#define __VSF_TIMER_GPIO_SINGLE_PWM_INIT(__TIMER, __FN_GPIO_CONTROL) \
93 __VSF_TIMER_GPIO_SINGLE_PWM_INIT_HALOP \
94 .timer = (vsf_timer_t *)(__TIMER), \
95 .gpio_control = (__FN_GPIO_CONTROL),
96#define VSF_TIMER_GPIO_SINGLE_PWM_INIT(__TIMER, __FN_GPIO_CONTROL) \
97 __VSF_TIMER_GPIO_SINGLE_PWM_INIT((__TIMER), (__FN_GPIO_CONTROL))
99#define __describe_timer_gpio_single_pwm(__name, __timer, __fn_gpio_control) \
100 vsf_timer_gpio_single_pwm_t __name = { \
101 VSF_TIMER_GPIO_SINGLE_PWM_INIT((__timer), (__fn_gpio_control)) \
104#define describe_timer_gpio_single_pwm(__name, __timer, __fn_gpio_control) \
105 __describe_timer_gpio_single_pwm(__name, (__timer), (__fn_gpio_control))
172#if VSF_TIMER_GPIO_PWM_CFG_MULTI_CLASS == ENABLED
#define ENABLED
Definition __type.h:28
Definition vsf_timer_gpio_pwm.h:114
Definition vsf_timer_gpio_pwm.h:130
Definition vsf_timer_gpio_pwm.h:148
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned char uint_fast8_t
Definition stdint.h:23
Definition vsf_template_gpio.h:491
Definition vsf_template_pwm.h:113
Definition vsf_template_pwm.h:121
Definition vsf_template_timer.h:184
vk_av_control_value_t value
Definition vsf_audio.h:171
const vsf_pwm_op_t vsf_timer_gpio_single_pwm_op
const vsf_pwm_op_t vsf_timer_gpio_multi_pwm_op
#define VSF_TIMER_GPIO_PWM_CFG_MULTI_CLASS
Definition vsf_timer_gpio_pwm.h:51
@ VSF_TIMER_GPIO_PWM_NORMAL
Definition vsf_timer_gpio_pwm.h:110
@ VSF_TIMER_GPIO_PWM_REVERSE
Definition vsf_timer_gpio_pwm.h:111