Device register classes for embedded systems
Jonathan R. Engdahl, Dukki Chung · International Conference on Control, Automation and Systems · 2011
A device register is the view any peripheral device presents to the software world. Low-level routines in typical embedded systems, e.g., device drivers, communicate with devices by reading and writing device registers. Many processors use memory-mapped I/O, which assigns device registers to fixed addresses in conventional memory. To high level languages like C or C++, memory mapped devices behave like ordinary data objects to some extent. Programs use assignment operators to read values from or write values to memory mapped device registers. Unfortunately, traditional approaches for organizing and accessing memory-mapped devices are inconvenient and error prone. In this paper, a new way of writing and using C++ classes which encapsulate memory mapped device registers is described. The principle is extended to handle I/O mapped device registers for coprocessors. A Device Register Class description language is also described.