Systems & Emerging Tech · Spec
Hardware abstraction layer spec outline
The outline we use to spec a HAL before writing firmware, so drivers can be swapped without touching application code.
F
Farai Chikwava
Sample
28 Sep 2026
Embedded C
Firmware
1. Scope
Which peripherals the HAL covers (GPIO, I2C, SPI, UART, timers).
2. Interface rules
- Every call returns a status code; no silent failures.
- No dynamic allocation after start-up.
- Blocking and non-blocking variants named consistently (
_blocking,_async).
3. Per-peripheral section
Initialisation, configuration struct, read/write calls, interrupts, power states.
4. Test strategy
Host-side mocks for every interface, plus a hardware-in-the-loop smoke test.