/* Set up a USART in SPI master mode device. 
The returned device descriptor structure must be passed to the driver whenever that device should be used as current slave device. */
void usart_spi_setup_device(volatile avr32_usart_t *p_usart, struct usart_spi_device *device, spi_flags_t flags, unsigned long baud_rate, board_spi_select_id_t sel_id)
/* Set up a USART in SPI master mode device. 
The returned device descriptor structure must be passed to the driver whenever that device should be used as current slave device. */
void usart_spi_setup_device(volatile avr32_usart_t *p_usart, struct usart_spi_device *device, spi_flags_t flags, unsigned long baud_rate, board_spi_select_id_t sel_id)
{
	usart_spi_options_t opt;
	UNUSED(device);
	UNUSED(sel_id);
	opt.baudrate = baud_rate;
	opt.charlength = 8;
	opt.spimode = flags;
	opt.channelmode = USART_NORMAL_CHMODE;
	usart_init_spi_master(p_usart, &opt, sysclk_get_cpu_hz());
}