Fracanto Architecture

Fracanto Architecture #2 — HAL: Hardware Abstraction Layer

HAL — the bridge between protocol and hardware

Between the protocol and node management lies the HAL as a thin bridge. The hal.h interface defines a vtable with eight operations (init, deinit, start, stop, send, set_filter, set_rx_callback, get_tick_ms) that every backend must implement. Currently two backends exist: the SocketCAN HAL for Linux and Raspberry Pi (poll-based, CAN-FD capable, testable via vcan0) and the STM32 FDCAN HAL for STM32G4/H7 microcontrollers (interrupt-based with DLC conversion and weak callback). Through this abstraction, all code above is platform-independent. The underlying design pattern is described in detail under The vtable pattern in fracanto.