Initiate the SPI pins.
After the configuration of the SPI pins, you must initialize the SPI pins to set them for the right data direction. When the pins are not used by other hardware/software, you only need to use SPIINIT once.
When the SPI bus is used in master mode, the MOSI, CLOCK and SS pins will be set to output.
When the SPI bus is used in slave mode, the MISO is set to output mode.
If you need to change the logic levels of the SPI pins, you need to disable the SPI. You can do this by setting the SPE bit to 0 in SPCR.
When other routines change the state of the SPI pins, use SPIINIT again before using SPIIN and SPIOUT.