Chapter 9. UART, I2C, and SPI Programming
In the previous chapter, we went through some Python examples on BeagleBone. We covered digital components and analog I/O devices. There are some sensors/devices that do not fit into these types. They accept or produce more data than traditional sensors/devices. Communication with them has to be done via an I/O bus. In this chapter, we will study a few popular I/O bus communication protocols in the embedded world and how they are supported on BeagleBone. Then we will program sensors/devices that support these protocols.
This chapter will cover:
Bus and bus protocols
What is UART?
A program to read/write on UART
I²C protocol
Program to read from an ADXL345 sensor
SPI protocol
A program to write display text on the Nokia 5110 LCD