The raw SPI bus

As for USB and I2C buses the SPI bus supports the raw access in order to directly send and receive messages from the SPI slaves, so it's time to show a little example about how we can do it on our Wandboard.

As for other raw accesses, the only problem is that it interrupts management. In this case, we cannot manage these signals from the user space. A kernel driver must be used.

Exchanging data in C

To show how we can manage the raw SPI bus, we are going to manage a really simple device using the Wandboard, that is, the thermocouple to digital converter based on the MAX31855 chip:

Exchanging data in C

Note

The device can be purchased at:  http://www.cosino.io/product/thermocouple-max31855 ...

Get GNU/Linux Rapid Embedded Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.