Basics of SPI and setting up an SPI module
The SPI, or Serial Peripheral Interface, is similar to the I2C bus, but has a few advantages for a few more wires. Generally, you'd choose I2C or SPI based on the peripheral you are trying to talk to and what protocol it supports. For this recipe, we will look at configuring SPI for upcoming recipes.
Getting ready
Just like setting up I2C in the previous recipe, the easiest way to get going is with raspi-config. Run with sudo, and select Interfacing Options. Select P4 to enable SPI, and reboot.
How to do it...
Once you've enabled SPI and rebooted, you should find your bus on the device list:
Working with the SPI module is a little bit more complex than I2C, but it gives you more flexibility as well as expandability to run multiple peripherals over the same bus. This will be a lot of fun later, but for now, let's look at the pins you will be using. Just like any connection to your Raspberry Pi Zero, the Power and Ground pins will be the same, but...