Embedded C++ library / Prototype 2.0
CASTLE
C++ built for bounded systems.
A header-only toolkit for firmware where memory, timing, and failure behavior belong in the design, not in the surprises.
Brings modern C++ abstractions to embedded systems
01 / Design principles
CASTLE turns embedded constraints into visible choices: capacity in the type, outcomes in the return value, and storage where you can account for it.
Inspired by the Embedded Template Library (ETL) , CASTLE carries familiar C++ building blocks into a small-footprint, embedded-first library.
Capacity, made concrete
Fixed-size containers keep bounds close to the type that owns them.
Failure, made ordinary
Full, empty, and invalid states are represented through status values and boolean results.
Runtime, kept lean
No mandatory heap allocation, RTTI, exceptions, or STL dependency in public headers.
Predictable, by design
Plan memory, timing, and faults up front, following MISRA C++, AUTOSAR C++14, and CERT C++ guidance.
02 / Module map
A place for
every building block.
Start at the layer you need. Each module is independently usable, with documentation organized alongside the public include tree.
15 modules / one consistent include tree
03 / Get started
Drop in.
Set your bounds.
CASTLE is header-only. Add the include directory to your project, or use its CMake interface target to propagate the include path and C++17 requirement.
Read the documentation#include "castle/container/vector.hpp"
#include "castle/utility/optional.hpp"
castle::container::vector<uint16_t, 16U> samples;
if (samples.push_back(42U) == castle::status::ok)
{
castle::optional<uint16_t> first = samples[0U];
}