The SPI bus in Linux
As in the I2C case, the SPI bus has the concept of master and slave device too. Again, regarding the SPI master device, there is nothing special to do here since the proper driver is already up and running in our embedded kits' default kernel configurations (as seen earlier). However, to be connected with SPI devices, we can have several possibilities: external memories, I/O extenders, sensors, serial ports, and so on (the list can be very long!).
As seen earlier, we can also have a generic spidev
driver to get access to the raw bus functionalities, but this time, we have no prebuild tools to manage it! The only things we can do is write our own program, maybe take some basic tools provided into the kernel's tree (see the next section for an example) as examples to manage our device through the spidev
driver.
Note
For further information on the API in Linux for SPI, we can take a look at the Documentation/spi/spidev
file in Linux's sources repository.