Libraries and Frameworks
While the C++ standard library offers a vast array of containers and algorithms, certain aspects – such as dynamic memory allocation – can pose challenges in constrained environments. In Chapter 2, we explored some of these issues and ways to address them. However, specialized libraries, like the Embedded Template Library (ETL), offer deterministic behavior and fixed memory footprints, making them well suited for embedded systems.
Embedded applications depend on Hardware Abstraction Layers (HALs) provided by vendors as C libraries. In Chapter 12, we examined how to use interfaces to decouple application-level C++ code from the underlying C-based hardware interactions. Wrapping entire HALs in C++ is a lot of work, but luckily, there are projects such as Google’s Pigweed that are tackling exactly that, while offering additional functionality and flexibility for embedded development.
In Chapter 11, we explored how C++ can perform...