spiInit function added