完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
各位大大安安,想请问PWM_EnablePeriodInt这函数的用法,里面参数PWM_PERIOD_INT_UNDERFLOW和PWM_PERIOD_INT_MATCH_CNR各代表什么意思,谢谢!
/** * Enable period interrupt of selected channel * @param[in] pwm The pointer of the specified PWM module * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~3 * @param[in] u32IntPeriodType Period interrupt type, could be either * - \ref PWM_PERIOD_INT_UNDERFLOW * - \ref PWM_PERIOD_INT_MATCH_CNR * None * This function is used to enable period interrupt of selected channel. * Every two channels, (0 & 1), (2 & 3), shares the period interrupt type setting. */ void PWM_EnablePeriodInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) { (pwm)->PIER = ((pwm)->PIER & ~(PWM_PIER_INT01TYPE_Msk << (u32ChannelNum >> 1))) | \ (PWM_PIER_PWMIE0_Msk << u32ChannelNum) | (u32IntPeriodType << (u32ChannelNum >> 1)); |
|
相关推荐
1个回答
|
|
WM_PERIOD_INT_UNDERFLOW: Interrupt when the PWM counter underflows from its maximum value (0xFFFFFFFF) to 0.
- ref PWM_PERIOD_INT_MATCH_CNR: Interrupt when the PWM counter matches the value in its CNR (cycle number register) register. So the PWM_EnablePeriodInt function allows you to enable either of these two types of period interrupts for a specified PWM channel. When the selected interrupt condition is detected, an interrupt will be generated and trigger the corresponding interrupt service routine. |
|
|
|
只有小组成员才能发言,加入小组>>
3278 浏览 9 评论
2956 浏览 16 评论
3457 浏览 1 评论
8996 浏览 16 评论
4050 浏览 18 评论
1106浏览 3评论
571浏览 2评论
const uint16_t Tab[10]={0}; const uint16_t *p; p = Tab;//报错是怎么回事?
568浏览 2评论
用NUC131单片机UART3作为打印口,但printf没有输出东西是什么原因?
2301浏览 2评论
NUC980DK61YC启动随机性出现Err-DDR是为什么?
1858浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 02:14 , Processed in 1.620231 second(s), Total 79, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号