implement our own spi.write