first version for a SPI implementation