Optimization of hardware spi_tx