HAL
__HAL_USART_CLEAR_FLAG is only used within HAL.
 
Symbols
loading...
Files
loading...

__HAL_USART_CLEAR_FLAG macro

Clear the specified USART pending flags.

Syntax

#define __HAL_USART_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__))

Arguments

__HANDLE__

specifies the USART Handle. USART Handle selects the USARTx peripheral (USART availability and x value depending on device).

__FLAG__

specifies the flag to check. This parameter can be any combination of the following values: @arg USART_FLAG_TC: Transmission Complete flag. @arg USART_FLAG_RXNE: Receive data register not empty flag.

Return value

None

Notes

PE (Parity error), FE (Framing error), NE (Noise error), ORE (Overrun error) and IDLE (Idle line detected) flags are cleared by software sequence: a read operation to USART_SR register followed by a read operation to USART_DR register. RXNE flag can be also cleared by a read to the USART_DR register. TC flag can be also cleared by software sequence: a read operation to USART_SR register followed by a write operation to USART_DR register. TXE flag is cleared only by a write to the USART_DR register.

References

LocationText
stm32f4xx_hal_usart.h:374
#define __HAL_USART_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__))
stm32f4xx_hal_usart.c:1280
__HAL_USART_CLEAR_FLAG(husart, USART_FLAG_TC);
stm32f4xx_hal_usart.c:1460
__HAL_USART_CLEAR_FLAG(husart, USART_FLAG_TC);