WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hal_pwm.h
浏览该文件的文档.
1
9#ifndef HAL_PWM_H
10#define HAL_PWM_H
11
12#include <stdint.h>
13#include "errcode.h"
14#include "pwm_porting.h"
15
16#ifdef __cplusplus
17#if __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20#endif /* __cplusplus */
21
42
60
74typedef errcode_t (*hal_pwm_callback_t)(uint8_t channel);
75
87typedef errcode_t (*hal_pwm_init_t)(void);
88
100typedef void (*hal_pwm_deinit_t)(void);
101
115typedef void (*hal_pwm_set_time_t)(hal_pwm_set_time_id_t id, pwm_channel_t channel, uint32_t time);
116
128typedef void (*hal_pwm_set_cycles_t)(pwm_channel_t channel, uint16_t sycles);
129
141typedef void (*hal_pwm_set_action_t)(uint8_t channel, pwm_action_t action);
142
152typedef void (*hal_pwm_clear_t)(pwm_channel_t channel);
153
165typedef void (*hal_pwm_register_t)(pwm_channel_t channel, hal_pwm_callback_t callback);
166
176typedef void (*hal_pwm_unregister_t)(pwm_channel_t channel);
177
178#if defined(CONFIG_PWM_USING_V151)
191typedef void (*hal_pwm_set_group_t)(pwm_v151_group_t group, uint16_t channel);
192
193#if defined(CONFIG_PWM_PRELOAD)
203typedef void (*hal_pwm_config_preload_t)(pwm_v151_group_t group);
204#endif /* CONFIG_PWM_PRELOAD */
205#endif /* CONFIG_PWM_USING_V151 */
206
214typedef struct {
231#if defined(CONFIG_PWM_USING_V151)
234#if defined(CONFIG_PWM_PRELOAD)
235 hal_pwm_config_preload_t config_preload;
236#endif /* CONFIG_PWM_PRELOAD */
237#endif /* CONFIG_PWM_USING_V151 */
239
254
267
278
291
300void hal_pwm_regs_deinit(void);
301
306#ifdef __cplusplus
307#if __cplusplus
308}
309#endif /* __cplusplus */
310#endif /* __cplusplus */
311
312#endif
pwm_action_t
Definition of SHARE RAM Selections.
Definition dyn_mem.c:16
uint32_t errcode_t
Definition of error code.
Definition errcode.h:30
errcode_t hal_pwm_regs_init(void)
初始化PWM,设置寄存器的基地址。
Definition hal_pwm.c:16
void(* hal_pwm_unregister_t)(pwm_channel_t channel)
为PWM设备注销先前注册的回调。
Definition hal_pwm.h:176
void(* hal_pwm_clear_t)(pwm_channel_t channel)
清除PWM中断。
Definition hal_pwm.h:152
errcode_t(* hal_pwm_callback_t)(uint8_t channel)
PWM hal层回调类型定义。
Definition hal_pwm.h:74
errcode_t(* hal_pwm_init_t)(void)
HAL层PWM的初始化接口。
Definition hal_pwm.h:87
void(* hal_pwm_set_cycles_t)(pwm_channel_t channel, uint16_t sycles)
设置PWM重复周期。
Definition hal_pwm.h:128
void(* hal_pwm_set_time_t)(hal_pwm_set_time_id_t id, pwm_channel_t channel, uint32_t time)
设置PWM高低电平时间。
Definition hal_pwm.h:115
void hal_pwm_regs_deinit(void)
去初始化,然后清除在 hal_pwm_regs_init 中设置的寄存器地址。
Definition hal_pwm.c:27
errcode_t hal_pwm_register_funcs(hal_pwm_funcs_t *funcs)
注册 hal_pwm_funcs_t 到 g_hal_pwms_funcs 。
Definition hal_pwm.c:32
hal_pwm_funcs_t * hal_pwm_get_funcs(void)
获取Driver层pwm和HAL层PWM的接口实例,参考 hal_pwm_funcs_t 。
Definition hal_pwm.c:49
enum hal_pwm_set_time_id hal_pwm_set_time_id_t
PWM设置高低电平时间ID定义。
errcode_t hal_pwm_unregister_funcs(void)
从g_hal_pwms_funcs注销 hal_pwm_funcs_t 。
Definition hal_pwm.c:43
pwm_action_t
PWM动作模式定义。
Definition hal_pwm.h:35
void(* hal_pwm_register_t)(pwm_channel_t channel, hal_pwm_callback_t callback)
注册与PWM中断原因关联的回调。
Definition hal_pwm.h:165
void(* hal_pwm_set_action_t)(uint8_t channel, pwm_action_t action)
设置PWM动作模式。
Definition hal_pwm.h:141
void(* hal_pwm_set_group_t)(pwm_v151_group_t group, uint16_t channel)
为PWM组分配通道,一个组可以有多个通道,同一个通道不能同时位于不同的组里。
Definition hal_pwm.h:191
void(* hal_pwm_deinit_t)(void)
HAL层PWM的去初始化接口。
Definition hal_pwm.h:100
hal_pwm_set_time_id
PWM设置高低电平时间ID定义。
Definition hal_pwm.h:50
@ PWM_ACTION_STOP
Definition hal_pwm.h:37
@ PWM_ACTION_CONTINUE_CLR
Definition hal_pwm.h:40
@ PWM_ACTION_START
Definition hal_pwm.h:36
@ PWM_ACTION_CONTINUE_SET
Definition hal_pwm.h:39
@ PWM_ACTION_REFRESH
Definition hal_pwm.h:38
@ PWM_SET_HIGH_TIME
Definition hal_pwm.h:53
@ PWM_SET_TIME_ID_INVALID
Definition hal_pwm.h:58
@ PWM_SET_OFFSET_TIME
Definition hal_pwm.h:55
@ PWM_SET_TIEM_MAX
Definition hal_pwm.h:57
@ PWM_SET_LOW_TIME
Definition hal_pwm.h:51
pwm_channel_t
PWM v150 channel ID.
Definition pwm_porting.h:37
pwm_v151_group_t
PWM v150 group ID.
Definition pwm_porting.h:60
osal_u32 group
Definition oal_net.h:3
Driver层PWM和HAL层PWM的接口。
Definition hal_pwm.h:214
hal_pwm_init_t init
Definition hal_pwm.h:215
hal_pwm_unregister_t unregisterfunc
Definition hal_pwm.h:229
hal_pwm_set_time_t set_time
Definition hal_pwm.h:219
hal_pwm_set_action_t set_action
Definition hal_pwm.h:223
hal_pwm_set_cycles_t set_cycles
Definition hal_pwm.h:221
hal_pwm_register_t registerfunc
Definition hal_pwm.h:227
hal_pwm_set_group_t set_group
Definition hal_pwm.h:232
hal_pwm_deinit_t deinit
Definition hal_pwm.h:217
hal_pwm_clear_t isrclear
Definition hal_pwm.h:225