libepaper 2.0.0
A C++23 library for controlling Waveshare e-paper displays on Raspberry Pi, featuring transparent sleep/wake management and a fluent builder API.
Loading...
Searching...
No Matches
Namespaces | Concepts
spi.hpp File Reference

SPI bus concept for hardware abstraction. More...

#include <concepts>
#include <cstdint>
#include <span>
Include dependency graph for spi.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  epaper
 
namespace  epaper::hal
 

Concepts

concept  epaper::hal::SpiBus
 Concept for a raw SPI data transfer bus.
 

Detailed Description

SPI bus concept for hardware abstraction.

Defines C++20 concept for SPI data transfer operations, enabling generic driver code that works with any SPI backend.

Design Philosophy:

Hardware Abstraction via Concepts
├─ Platform Independence: Drivers work with Linux SPIdev, embedded HALs, mocks
├─ Minimal Interface: Only data transfer, no config (CS/DC handled by GPIO)
├─ Zero Overhead: Concepts inline to register-level ops in production
└─ Mockability: Easy to substitute mock SPI for testing

SPI Responsibilities:

NOT Handled by SpiBus:

Rationale for Minimal Interface: E-paper displays require precise CS/DC control for command vs data writes. Decoupling CS/DC from SPI allows drivers to implement hardware-specific timing requirements (e.g., CS must go low 10ns before SCLK starts).

Typical Implementations:

Thread Safety: