USART_ClearITPendingBit(USART1,USART_IT_RXNE);
void USART_ClearITPendingBit(USART_TypeDef* USARTx, uint16_t USART_IT)
{
uint16_t bitpos = 0x00, itmask = 0x00;
if (USART_IT == USART_IT_CTS)
{
assert_param(IS_USART_123_PERIPH(USARTx));
}
bitpos = USART_IT >> 0x08;
itmask = ((uint16_t)0x01 << (uint16_t)bitpos);
USARTx->SR = (uint16_t)~itmask;
}
意思应该是把RXNE位清零,具体是怎么执行的呢?
#define USART1 ((USART_TypeDef *) USART1_BASE)
#define USART_IT_RXNE ((uint16_t)0x0525)
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>