writing a stupid SPI library