C++ Hardware Register Access
This is a quick demo of a technique originally presented here
with the original, admittedly pouty :), preamble
The technique, in a nutshell, lets you write high level register access statements with strong safety guarantees without sacrificing low level performance. Find a more complete example for an actual CPU here.
If you need an ARM toolchain, this makefile might do the trick.
Here is a quick explanation of what's going on here.