/* Read from USART Receive Holding Register. Before reading user should check if rx is ready.  */
uint32_t usart_getchar(Usart *p_usart, uint32_t *c)
/* Read from USART Receive Holding Register. Before reading user should check if rx is ready.  */
uint32_t usart_getchar(Usart *p_usart, uint32_t *c)
{
	while (!(p_usart->US_CSR & US_CSR_RXRDY)) {
	}
	*c = p_usart->US_RHR & US_RHR_RXCHR_Msk;
	return 0;
}