[mw_shl_code=c,true]void TIM_ClearITPendingBit(TIM_TypeDef* TIMx, uint16_t TIM_IT)
{
/* Check the parameters */
assert_param(IS_TIM_ALL_PERIPH(TIMx));
assert_param(IS_TIM_IT(TIM_IT));
/* Clear the IT pending Bit */
TIMx->SR = (uint16_t)~TIM_IT;
}[/mw_shl_code]
1.这是定时器清除中断标志位的函数,库函数指南里说这个函数就是清除中断TIM_IT标志位用的,可我去查了参考手册通用定时器的寄存器SR,发现没有TIM_IT位?
例程中函数是这样写的:
[mw_shl_code=c,true]#define TIM_IT_Update ((uint16_t)0x0001)[/mw_shl_code]
[mw_shl_code=c,true]TIM_ClearITPendingBit(TIM3, TIM_IT_Update );[/mw_shl_code]
2.我想知道代入到函数原型中去 TIMx->SR = (uint16_t)~TIM_IT_UPDATE; 这句函数怎么理解? |