完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
各位大大安安,想请问PWM_EnablePeriodInt这函数的用法,里面参数PWM_PERIOD_INT_UNDERFLOW和PWM_PERIOD_INT_MATCH_CNR各代表什么意思,谢谢!
/** * @brief 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 * @return None * @details 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个回答
|
|
|
PWM_PERIOD_INT_UNDERFLOW: Enable period interrupt when PWM counter underflows
- ref PWM_PERIOD_INT_MATCH_CNR: Enable period interrupt when PWM counter matches CNR value * @return None */ void PWM_EnablePeriodInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); 该函数用于使能PWM中指定通道的周期中断。参数pwm为PWM模块指针,u32ChannelNum为PWM通道号,有效值为0~3。参数u32IntPeriodType为周期中断类型,可以取以下值: - PWM_PERIOD_INT_UNDERFLOW: 当PWM计数器向下溢出时中断 - PWM_PERIOD_INT_MATCH_CNR: 当PWM计数器匹配CNR值时中断 例如,若想使能PWM模块0的通道2的周期中断,在程序中调用PWM_EnablePeriodInt(&PWM0, 2, PWM_PERIOD_INT_MATCH_CNR)即可。 |
|
|
|
|
只有小组成员才能发言,加入小组>>
1027 浏览 1 评论
1856 浏览 0 评论
1837 浏览 1 评论
3261 浏览 5 评论
3587 浏览 9 评论
1031浏览 1评论
1855浏览 1评论
如何知道嵌入式电子控制单元 (ECU) 中的RAM使用情况?
1367浏览 1评论
1860浏览 0评论
1185浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 16:54 , Processed in 0.560752 second(s), Total 74, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
251