https://github.com/eagletrt/libpal-sw
Peripheral Abstraction Layer (PAL) library, suited for all embedded devices
https://github.com/eagletrt/libpal-sw
embedded library platformio platformio-library sw
Last synced: 14 days ago
JSON representation
Peripheral Abstraction Layer (PAL) library, suited for all embedded devices
- Host: GitHub
- URL: https://github.com/eagletrt/libpal-sw
- Owner: eagletrt
- License: other
- Created: 2025-07-25T18:37:22.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2026-05-22T20:15:08.000Z (2 months ago)
- Last Synced: 2026-05-22T20:45:18.366Z (2 months ago)
- Topics: embedded, library, platformio, platformio-library, sw
- Homepage:
- Size: 236 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Peripheral Abstraction Layer (P.A.L.)
The Peripheral Abstraction Layer library implements the logic needed to abstract a generic communication peripheral and its operations especially in embedded projects.
It provides a unified interface for managing message reception and transmission.
The library does not operate independently; it requires a software layer to interact with the underlying hardware, which will henceforth be referred to as the "driver".
Drivers must implement low-level operations such as transmission, reception, serialization, and critical section control, while application logic interacts with a simple API.
## Application Usage
To use PAL each peripheral may use one or multiple handlers that needs to be initialized.
The handler requires at least a callback to send the messages and optionally another one for the deserialization.
PAL uses two buffers: one for message transmission and one for message reception.
To send a message add it to the TX buffer and execute the routine.
When a message is received it can be added to the RX buffer so it can be later deserializer inside the routine.
> [!WARNING]
> If using the default deserializer, ensure that the destination buffer is big enough to avoid a potential buffer overflow.
## Driver Setup
Drivers act as the bridge between the hardware and PAL.
A driver must:
- Add the received message to the RX buffer of PAL;
- Implement the low-level function to serialize and transmit the message to the correct peripheral;
- Properly handle errors returned by PAL;
## Examples
For more info check the [examples](./examples/) folder.