300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > STM32中TIM_ClearFlag和TIM_ClearITPendingBit有什么区别

STM32中TIM_ClearFlag和TIM_ClearITPendingBit有什么区别

时间:2020-04-20 01:53:45

相关推荐

STM32中TIM_ClearFlag和TIM_ClearITPendingBit有什么区别

STM32中TIM_ClearFlag和TIM_ClearITPendingBit有什么区别

/*** @brief Clears the TIMx's pending flags.* @param TIMx: where x can be 1 to 17 to select the TIM peripheral.* @param TIM_FLAG: specifies the flag bit to clear.* This parameter can be any combination of the following values:*@arg TIM_FLAG_Update: TIM update Flag*@arg TIM_FLAG_CC1: TIM Capture Compare 1 Flag*@arg TIM_FLAG_CC2: TIM Capture Compare 2 Flag*@arg TIM_FLAG_CC3: TIM Capture Compare 3 Flag*@arg TIM_FLAG_CC4: TIM Capture Compare 4 Flag*@arg TIM_FLAG_COM: TIM Commutation Flag*@arg TIM_FLAG_Trigger: TIM Trigger Flag*@arg TIM_FLAG_Break: TIM Break Flag*@arg TIM_FLAG_CC1OF: TIM Capture Compare 1 overcapture Flag*@arg TIM_FLAG_CC2OF: TIM Capture Compare 2 overcapture Flag*@arg TIM_FLAG_CC3OF: TIM Capture Compare 3 overcapture Flag*@arg TIM_FLAG_CC4OF: TIM Capture Compare 4 overcapture Flag* @note* - TIM6 and TIM7 can have only one update flag. * - TIM9, TIM12 and TIM15 can have only TIM_FLAG_Update, TIM_FLAG_CC1,*TIM_FLAG_CC2 or TIM_FLAG_Trigger. * - TIM10, TIM11, TIM13, TIM14, TIM16 and TIM17 can have TIM_FLAG_Update or TIM_FLAG_CC1. * - TIM_FLAG_Break is used only with TIM1, TIM8 and TIM15. * - TIM_FLAG_COM is used only with TIM1, TIM8, TIM15, TIM16 and TIM17. * @retval None*/void TIM_ClearFlag(TIM_TypeDef* TIMx, uint16_t TIM_FLAG){/* Check the parameters */assert_param(IS_TIM_ALL_PERIPH(TIMx));assert_param(IS_TIM_CLEAR_FLAG(TIM_FLAG));/* Clear the flags */TIMx->SR = (uint16_t)~TIM_FLAG;}

/*** @brief Clears the TIMx's interrupt pending bits.* @param TIMx: where x can be 1 to 17 to select the TIM peripheral.* @param TIM_IT: specifies the pending bit to clear.* This parameter can be any combination of the following values:*@arg TIM_IT_Update: TIM1 update Interrupt source*@arg TIM_IT_CC1: TIM Capture Compare 1 Interrupt source*@arg TIM_IT_CC2: TIM Capture Compare 2 Interrupt source*@arg TIM_IT_CC3: TIM Capture Compare 3 Interrupt source*@arg TIM_IT_CC4: TIM Capture Compare 4 Interrupt source*@arg TIM_IT_COM: TIM Commutation Interrupt source*@arg TIM_IT_Trigger: TIM Trigger Interrupt source*@arg TIM_IT_Break: TIM Break Interrupt source* @note* - TIM6 and TIM7 can generate only an update interrupt.* - TIM9, TIM12 and TIM15 can have only TIM_IT_Update, TIM_IT_CC1,*TIM_IT_CC2 or TIM_IT_Trigger. * - TIM10, TIM11, TIM13, TIM14, TIM16 and TIM17 can have TIM_IT_Update or TIM_IT_CC1. * - TIM_IT_Break is used only with TIM1, TIM8 and TIM15. * - TIM_IT_COM is used only with TIM1, TIM8, TIM15, TIM16 and TIM17. * @retval None*/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;}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。