/* Configure USART in normal (serial rs232) mode, asynchronous, 8 bits, 1 stop bit, no parity, 115200 bauds and enable its transmitter and receiver.  */
static void configure_usart(void)
/* Configure USART in normal (serial rs232) mode, asynchronous, 8 bits, 1 stop bit, no parity, 115200 bauds and enable its transmitter and receiver.  */
static void configure_usart(void)
{
	const sam_usart_opt_t usart_console_settings = {
		BOARD_USART_BAUDRATE,
		US_MR_CHRL_8_BIT,
		US_MR_PAR_NO,
		US_MR_NBSTOP_1_BIT,
		US_MR_CHMODE_NORMAL,
		0
	};
	sysclk_enable_peripheral_clock(BOARD_USART);
	usart_init_rs232(BOARD_USART, &usart_console_settings,
			sysclk_get_peripheral_bus_hz(BOARD_USART));
	BOARD_USART->US_MR |= US_MR_CHMODE_LOCAL_LOOP;
	usart_disable_interrupt(BOARD_USART, ALL_INTERRUPT_MASK);
	usart_enable_tx(BOARD_USART);
	usart_enable_rx(BOARD_USART);
	NVIC_EnableIRQ(USART_IRQn);
}