|
hal
Hardware Abstraction Layer
|
This project is an experiment in building a testable hardware-abstraction layer for the STM32F4 from first principles, oriented toward flight-control–class embedded systems. It addresses the tension between development speed and rigor through automated testing, modern tooling, containerized builds, and continuous integration.
The HAL provides a small set of purpose-built drivers (UART, I2C, PWM, timers, GPIO) built around a classic embedded architecture: a super-loop execution model with interrupt-driven peripherals, no RTOS, no DMA, and strictly static memory. Its scope is intentionally narrow and includes only the primitives required for embedded control workloads, avoiding generic configuration layers, dynamic allocation, and broad peripheral coverage. The design favors simplicity, predictability, and testability over configurability or feature breadth.
main.c).include/hal.src that operate directly on device registers.device.UNIX-style command line environment.git installed.docker installedFirst, from inside the repo directory, build the docker image:
Next, run the docker image, mounting the repo dir. This command launches an interactive shell inside the container. (Commands executed inside the container are distinguished by #)
If needed: exit the docker container by pressing
ctrl-pfollowed quickly byctrl-q.
Build for desktop:
Run the unit tests:
Build for target hardware:
Target firmware should be visible in build/embedded-debug/ as .elf and .bin files.
To integrate a pre-built HAL release into a CMake project, see Project Integration.
See Deployment for detailed instructions to deploy firmware to target hardware.
See the code coverage here.
See Waveforms to view representative waveforms captured on target hardware.
Licensed under the MIT License; see LICENSE for details.