Embedded systems often provide access to their peripheral devices over specific ranges of memory addresses. When a program accesses an address in such a region, it does not read or write a value in memory. Instead, data is sent to a device or read from a device mapped to this address.
This technique is commonly named MMIOÂ (short for memory-mapped input/output). In this recipe, we will learn how to access peripheral devices of the Raspberry PI using MMIO from userspace Linux applications.