Representing SPI devices in the Linux kernel
The Linux kernel provides a general-purpose SPI driver named spidev
. The spidev
driver is a simple interface that abstracts many of the housekeeping details involved in SPI communications. The spidev
driver is exposed via the /dev
filesystem as the /dev/spidevX.Y
file. Multiple versions of these spidev
files can be present depending upon the number of SPI buses configured in the Device Tree. The X
value in the spidev
filename refers to the SPI controller number (1 for SPI0 and 2 for SPI1), and the Y
value refers to the SPI bus of that controller (0 for the first bus and 1 for the second bus). For the examples in this book, you will only be using the first SPI bus of the SPI0 controller, so /dev/spidev1.0
is the only file with which PacktHAL will interact.
Preparing Android for SPI sensor use
In Chapter 2, Interfacing with Android, you used adb
to push two prebuilt files to your Android system. These two files, BB-PACKTPUB-00A0.dtbo
and init.{ro...