/* Send a sequence of bytes to a SPI device. 
Received bytes on the SPI bus are discarded. */
status_code_t spi_write_packet(SPI_t *spi, const uint8_t *data, size_t len)
/* Send a sequence of bytes to a SPI device. 
Received bytes on the SPI bus are discarded. */
status_code_t spi_write_packet(SPI_t *spi, const uint8_t *data, size_t len)
{
	while (len--) {
		spi_write_single(spi, *data++);
		while (!spi_is_rx_full(spi)) {
		}
	}
	return STATUS_OK;
}