Added SPI function.