O'Reilly logo

GNU/Linux Rapid Embedded Programming by Rodolfo Giometti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The SPI tools

In complete analogy to the I2C case, even for SPI, we have some basic tools to manage it. However, as stated earlier, this time, these tools are not into a dedicated Debian package, but they are stored directly in the Documentation/spi/ directory of Linux's sources repository. Honestly, these SPI tools offer a poor support against the I2C counterpart. However, they can be used for basic functionalities and taken as examples to build our own programs.

As shown here, the available programs are just two:

$ ls Documentation/spi/*.c
Documentation/spi/spidev_fdx.c  
Documentation/spi/spidev_test.c

Both of them can be compiled on the host PC (or directly on our embedded kits) using the following command:

$ make CC=arm-linux-gnueabihf-gcc CFLAGS="-Wall ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required