Search code examples
cembeddeduart

What does UART_RX returns


I'm using an efm32lg230f256 microcontroller and in its code there is a line which uses USART_Rx and it returns:

1 2 3 4

but when I look inside of it I can't see how it retuns 1 2 3 4. I tried to look in the data sheet but there are no such names.

What is the logic in this function? And why does it do this?

c = USART_Rx(uart);
uint8_t USART_Rx(USART_TypeDef *usart)
{
    while (!(usart->STATUS & USART_STATUS_RXDATAV))
        ;

    return (uint8_t)usart->RXDATA;
}

Solution

  • "1 2 3 4" is simply the device password