A lightweight C++ hardware abstraction for embedded systems