Optimized spi_write