minimized spi code