![]() |
CI130X SDK API手册
2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
|
CI130X芯片PWM驱动 更多...
结构体 | |
struct | pwm_init_t |
PWM配置结构体 更多... | |
枚举 | |
enum | pwm_base_t { PWM0 = HAL_PWM0_BASE, PWM1 = HAL_PWM1_BASE, PWM2 = HAL_PWM2_BASE, PWM3 = HAL_PWM3_BASE, PWM4 = HAL_PWM4_BASE, PWM5 = HAL_PWM5_BASE } |
控制器定义 更多... | |
函数 | |
void | pwm_init (pwm_base_t base, pwm_init_t init) |
pwm初始化 更多... | |
void | pwm_start (pwm_base_t base) |
启动pwm 更多... | |
void | pwm_stop (pwm_base_t base) |
暂停pwm 更多... | |
void | pwm_set_duty (pwm_base_t base, unsigned int duty, unsigned int duty_max) |
设置pwm占空比 更多... | |
void | pwm_set_restart_md (pwm_base_t base, uint8_t cmd) |
设置pwm restart_md 重新计数生效模式 更多... | |
CI130X芯片PWM驱动
struct pwm_init_t |
void pwm_init | ( | pwm_base_t | base, |
pwm_init_t | init | ||
) |
pwm初始化
base | 外设基地址PWM0/PWM1/PWM2/PWM3/PWM4/PWM5 |
init | 初始化结构体 |
void pwm_set_duty | ( | pwm_base_t | base, |
unsigned int | duty, | ||
unsigned int | duty_max | ||
) |
设置pwm占空比
base | 外设基地址PWM0/PWM1/PWM2/PWM3/PWM4/PWM5 |
duty | 占空比 |
duty_max | 最大占空比 |
void pwm_set_restart_md | ( | pwm_base_t | base, |
uint8_t | cmd | ||
) |
设置pwm restart_md 重新计数生效模式
base | 外设基地址PWM0/PWM1/PWM2/PWM3/PWM4/PWM5 |
cmd | 0,重新计数立即生效;1,等待正在进行的PWM波完整输出后重新计数才生效 |
void pwm_start | ( | pwm_base_t | base | ) |
启动pwm
base | 外设基地址PWM0/PWM1/PWM2/PWM3/PWM4/PWM5 |
void pwm_stop | ( | pwm_base_t | base | ) |
暂停pwm
base | 外设基地址PWM0/PWM1/PWM2/PWM3/PWM4/PWM5 |