Skip to content

Architecture

Vasilaki Totsili edited this page May 30, 2026 · 1 revision

sparq's architecture

Here's a list of 10 most common embedded software architectures

Out of those, we chose sparq to follow primarily the layered architecture however, it contains some ideas that resemble hexagonal architecture(ports and adapters pattern) because the HAL layer is made of interfaces and the PAL layer provides the concrete implementations behind those interfaces. But it is not a true hexagonal architecture

Why it is mostly layered

PAL contains the concrete implementations to HAL's interfaces/abstractions and application layer consumes those interfaces in it's business/application logic:

Application
    │
    ▼
   HAL
    │
    ▼
   PAL
    │
    ▼
 OS / SDK / Hardware

This is the textbook definition of a layered architecture with abstraction layers

Why it is not really hexagonal architecture

Hexagonal architecture (Ports & Adapters) usually looks like:

     Adapter
        │
        ▼
 Port(interface)
        │
        ▼
Application/Core
        ▲
        │
 Port(interface)
        ▲
        │
     Adapter

The key idea is:

The application/core owns the interfaces (ports) and the outside world implements them

In a true hexagonal design:

class IMotor
{
public:
    virtual void Move(...) = 0;
};

would belong to the application/core domain, not to a HAL layer and that's why this is not a hexagonal architecture, only looks like it

So conceptually HAL reminds of ports, while PAL reminds of adapters, but structurally the system is still organized as layers rather than as a hexagon around a domain core, so I would call it:

Layered architecture with dependency inversion and interface-based abstractions

Clone this wiki locally