/* Send a sequence of bytes to a SPI device using USART in SPI mode. 
Received bytes on the USART in SPI mode are discarded. */
status_code_t usart_spi_write_packet(USART_t *usart, const uint8_t *data, size_t len)
/* Send a sequence of bytes to a SPI device using USART in SPI mode. 
Received bytes on the USART in SPI mode are discarded. */
status_code_t usart_spi_write_packet(USART_t *usart, const uint8_t *data, size_t len)
{
	size_t i = 0;
	while (len) {
		usart_spi_transmit(usart, *(data + i));
		len--;
		i++;
	}
	return STATUS_OK;
}