WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
PWM

结构体

struct  hal_pwm_funcs_t
 Driver层PWM和HAL层PWM的接口。 更多...
 

类型定义

typedef enum hal_pwm_set_time_id hal_pwm_set_time_id_t
 PWM设置高低电平时间ID定义。
 
typedef errcode_t(* hal_pwm_callback_t) (uint8_t channel)
 PWM hal层回调类型定义。
 
typedef errcode_t(* hal_pwm_init_t) (void)
 HAL层PWM的初始化接口。
 
typedef void(* hal_pwm_deinit_t) (void)
 HAL层PWM的去初始化接口。
 
typedef void(* hal_pwm_set_time_t) (hal_pwm_set_time_id_t id, pwm_channel_t channel, uint32_t time)
 设置PWM高低电平时间。
 
typedef void(* hal_pwm_set_cycles_t) (pwm_channel_t channel, uint16_t sycles)
 设置PWM重复周期。
 
typedef void(* hal_pwm_set_action_t) (uint8_t channel, pwm_action_t action)
 设置PWM动作模式。
 
typedef void(* hal_pwm_clear_t) (pwm_channel_t channel)
 清除PWM中断。
 
typedef void(* hal_pwm_register_t) (pwm_channel_t channel, hal_pwm_callback_t callback)
 注册与PWM中断原因关联的回调。
 
typedef void(* hal_pwm_unregister_t) (pwm_channel_t channel)
 为PWM设备注销先前注册的回调。
 
typedef void(* hal_pwm_set_group_t) (pwm_v151_group_t group, uint16_t channel)
 为PWM组分配通道,一个组可以有多个通道,同一个通道不能同时位于不同的组里。
 

枚举

enum  pwm_action_t {
  PWM_ACTION_START , PWM_ACTION_STOP , PWM_ACTION_REFRESH , PWM_ACTION_CONTINUE_SET ,
  PWM_ACTION_CONTINUE_CLR
}
 PWM动作模式定义。 更多...
 
enum  hal_pwm_set_time_id {
  PWM_SET_LOW_TIME = 0 , PWM_SET_HIGH_TIME , PWM_SET_OFFSET_TIME , PWM_SET_TIEM_MAX ,
  PWM_SET_TIME_ID_INVALID = 0xFF
}
 PWM设置高低电平时间ID定义。 更多...
 

函数

errcode_t hal_pwm_register_funcs (hal_pwm_funcs_t *funcs)
 注册 hal_pwm_funcs_t 到 g_hal_pwms_funcs 。
 
errcode_t hal_pwm_unregister_funcs (void)
 从g_hal_pwms_funcs注销 hal_pwm_funcs_t
 
hal_pwm_funcs_thal_pwm_get_funcs (void)
 获取Driver层pwm和HAL层PWM的接口实例,参考 hal_pwm_funcs_t
 
errcode_t hal_pwm_regs_init (void)
 初始化PWM,设置寄存器的基地址。
 
void hal_pwm_regs_deinit (void)
 去初始化,然后清除在 hal_pwm_regs_init 中设置的寄存器地址。
 

详细描述

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2022. All rights reserved.

Description: Provides HAL PWM
History:
2022-09-16, Create file.

类型定义说明

◆ hal_pwm_callback_t

typedef errcode_t(* hal_pwm_callback_t) (uint8_t channel)

PWM hal层回调类型定义。

◆ hal_pwm_clear_t

typedef void(* hal_pwm_clear_t) (pwm_channel_t channel)

清除PWM中断。

◆ hal_pwm_deinit_t

typedef void(* hal_pwm_deinit_t) (void)

HAL层PWM的去初始化接口。

◆ hal_pwm_init_t

typedef errcode_t(* hal_pwm_init_t) (void)

HAL层PWM的初始化接口。

◆ hal_pwm_register_t

typedef void(* hal_pwm_register_t) (pwm_channel_t channel, hal_pwm_callback_t callback)

注册与PWM中断原因关联的回调。

◆ hal_pwm_set_action_t

typedef void(* hal_pwm_set_action_t) (uint8_t channel, pwm_action_t action)

设置PWM动作模式。

◆ hal_pwm_set_cycles_t

typedef void(* hal_pwm_set_cycles_t) (pwm_channel_t channel, uint16_t sycles)

设置PWM重复周期。

◆ hal_pwm_set_group_t

typedef void(* hal_pwm_set_group_t) (pwm_v151_group_t group, uint16_t channel)

为PWM组分配通道,一个组可以有多个通道,同一个通道不能同时位于不同的组里。

◆ hal_pwm_set_time_id_t

PWM设置高低电平时间ID定义。

◆ hal_pwm_set_time_t

typedef void(* hal_pwm_set_time_t) (hal_pwm_set_time_id_t id, pwm_channel_t channel, uint32_t time)

设置PWM高低电平时间。

◆ hal_pwm_unregister_t

typedef void(* hal_pwm_unregister_t) (pwm_channel_t channel)

为PWM设备注销先前注册的回调。

枚举类型说明

◆ hal_pwm_set_time_id

PWM设置高低电平时间ID定义。

枚举值
PWM_SET_LOW_TIME 

设置PWM低电平时间。

PWM_SET_HIGH_TIME 

设置PWM高电平时间。

PWM_SET_OFFSET_TIME 

PWM相位。

PWM_SET_TIEM_MAX 
PWM_SET_TIME_ID_INVALID 

◆ pwm_action_t

PWM动作模式定义。

枚举值
PWM_ACTION_START 
PWM_ACTION_STOP 
PWM_ACTION_REFRESH 
PWM_ACTION_CONTINUE_SET 
PWM_ACTION_CONTINUE_CLR 

函数说明

◆ hal_pwm_get_funcs()

hal_pwm_funcs_t * hal_pwm_get_funcs ( void  )

获取Driver层pwm和HAL层PWM的接口实例,参考 hal_pwm_funcs_t

◆ hal_pwm_register_funcs()

errcode_t hal_pwm_register_funcs ( hal_pwm_funcs_t funcs)

注册 hal_pwm_funcs_t 到 g_hal_pwms_funcs 。

◆ hal_pwm_regs_deinit()

void hal_pwm_regs_deinit ( void  )

去初始化,然后清除在 hal_pwm_regs_init 中设置的寄存器地址。

◆ hal_pwm_regs_init()

errcode_t hal_pwm_regs_init ( void  )

初始化PWM,设置寄存器的基地址。

◆ hal_pwm_unregister_funcs()

errcode_t hal_pwm_unregister_funcs ( void  )

从g_hal_pwms_funcs注销 hal_pwm_funcs_t