Notice the use of the status flag USART_IT_RXNE to determine when
there is a character to receive (“receive data not empty”). Also, notice the
use of a mask to select the lower 8 bits returned by USART_ReceiveData –
this library procedure returns 9 bits by default because configuration of the
USART permits 9-bit data. For example, the 9th bit might contain parity
information which could be used to check the validity of the received character.