While the Raspberry Pi has very good support for an I2C bus, a lot of very cool chips – including the in system programmer for just about every ATtiny and ATmega microcontroller – use an SPI bus.
The CM5 offers two standard ways of connecting more sophisticated devices in hardware – the Serial Peripheral Interface or SPI bus and the I2C or I-⁠squared-C bus. In addition there is a Linux driver ...
Using the functions listed above it is easy to implement the loopback example given earlier: #include <stdio.h> #include <stdlib.h> #include <time.h> #include "Gpio5.h" int main(int argc, char **argv) ...