SPI implementation nearly done