Skip to content

Figures

Every figure on this site is drawn by a Python module from facts extracted from the code, so it is rebuilt, not redrawn, when the code changes. CI runs hardfoc-docs figures --check and fails when a committed figure no longer matches the code. Each figure below lists the files it is drawn from.

Write against the interface, pick the MCU at build time

Layer diagram: drivers, handlers and board HALs call the abstract Base interfaces such as BaseGpio, BaseI2c, BaseSpi and BaseCan; below them the ESP32 classes implement the interfaces with ESP-IDF, the STM32 classes with STM32Cube HAL handles, and host classes serve tests.Layer diagram: drivers, handlers and board HALs call the abstract Base interfaces such as BaseGpio, BaseI2c, BaseSpi and BaseCan; below them the ESP32 classes implement the interfaces with ESP-IDF, the STM32 classes with STM32Cube HAL handles, and host classes serve tests.
Write against the interface, pick the MCU at build time
Figure description and sources

From top to bottom. Drivers, handlers and board HALs hold references to the abstract Base* classes (listed from inc/base/). Each platform folder under inc/mcu/ implements them with that platform's SDK: ESP32 classes over ESP-IDF, STM32 classes over STM32Cube HAL handles, and host classes for tests. The application picks one platform at build time; nothing above the interface line changes.

Drawn from: inc/base Base classes; inc/mcu implementations; figure module docs/diagrams/figures/interface-layers.py.

Figure module: docs/diagrams/figures/interface-layers.py

Drawn from: