/* Send a sequence of bytes to an SPI device using USART in SPI mode. 
Received bytes on the USART in SPI mode are discarded. */
uint32_t usart_spi_write_packet(Usart *p_usart, const uint8_t *data, size_t len)
/* Send a sequence of bytes to an SPI device using USART in SPI mode. 
Received bytes on the USART in SPI mode are discarded. */
uint32_t usart_spi_write_packet(Usart *p_usart, const uint8_t *data, size_t len)
{
	uint32_t dummy_data;
	size_t i=0;
	while(len) {
		usart_putchar(p_usart, *(data+i));
		usart_getchar(p_usart, &dummy_data);
		len--;
		i++;
	}
	return 0;
}