-49-
Document Name
AI7688H
Reference Manual
Version
V 2.0
Date 2019/08/08
I2C
I2C (Inter-Integrated Circuit) is a widely used protocol among peripherals. It
consists of
2 signal pins
- usually named SDA and SCL. AI7688H comes with 1
set of I2C on GPIO4(P21) and GPIO5(P20) as SCL and SDA respectively. The
way I2Cs are initialized is slightly different from GPIO modules - instead of
using pins, I2Cs are initialized according to its
device index
. Since there is
only 1 set of I2C master device on AI7688H, you can simply pass 0 - and it is
always on pin GPIO4 and GPIO5.
I2C is capable of connecting multiple slave devices to a single I2C master.
Each slave device is identified by a 7-bit address.
SPI
SPI (Serial Peripheral Interface) can also be used to control peripheral
devices. AI7688H it consists of 4 pins: SPI_MOSI(P22), SPI_MISO(P23),
SPI_CLK(P24), SPI_CS1(P25).
It’s important to note that the SPI device is also used for communicating
with the internal flash storage on the board.
Therefore, developers should access the SPI functionality through SPI
modules only and avoid treating these SPI pins as general GPIO. Otherwise,
the flash storage may work incorrectly.
The SPI module in libmraa is initialized by device index, instead of pin
number: