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
Public Member Functions | List of all members
epaper::hal::MockSpiBus Class Reference

#include <mock_spi.hpp>

Public Member Functions

auto transfer (std::uint8_t byte) -> std::uint8_t
 Full-duplex byte transfer.
 
auto write (std::span< const std::byte > data) -> void
 Bulk write operation.
 
auto sent_bytes () const -> const std::vector< std::uint8_t > &
 Get vector of all bytes sent via transfer() and write().
 
auto transfer_count () const -> std::size_t
 Get total number of bytes transferred.
 
auto queue_response (std::uint8_t byte) -> void
 Queue a response byte for next transfer() call.
 
auto reset () -> void
 Reset bus state for new test.
 

Member Function Documentation

◆ queue_response()

auto epaper::hal::MockSpiBus::queue_response ( std::uint8_t  byte) -> void
inline

Queue a response byte for next transfer() call.

Parameters
byteByte to return on next transfer()
Examples
/mnt/nas/libepaper/include/epaper/hal/mock_spi.hpp.

◆ reset()

auto epaper::hal::MockSpiBus::reset ( ) -> void
inline

Reset bus state for new test.

Examples
/mnt/nas/libepaper/include/epaper/hal/mock_spi.hpp.

◆ sent_bytes()

auto epaper::hal::MockSpiBus::sent_bytes ( ) const -> const std::vector<std::uint8_t> &
inline

Get vector of all bytes sent via transfer() and write().

Returns
Reference to sent bytes vector
Examples
/mnt/nas/libepaper/include/epaper/hal/mock_spi.hpp.

◆ transfer()

auto epaper::hal::MockSpiBus::transfer ( std::uint8_t  byte) -> std::uint8_t
inline

Full-duplex byte transfer.

Records sent byte and returns queued response (or 0x00 if queue empty).

Parameters
byteByte to send
Returns
Response byte from queue, or 0x00
Examples
/mnt/nas/libepaper/include/epaper/hal/mock_spi.hpp.

◆ transfer_count()

auto epaper::hal::MockSpiBus::transfer_count ( ) const -> std::size_t
inline

Get total number of bytes transferred.

Returns
Byte count
Examples
/mnt/nas/libepaper/include/epaper/hal/mock_spi.hpp.

◆ write()

auto epaper::hal::MockSpiBus::write ( std::span< const std::byte >  data) -> void
inline

Bulk write operation.

Records all sent bytes.

Parameters
dataSpan of bytes to write
Examples
/mnt/nas/libepaper/include/epaper/hal/mock_spi.hpp.

The documentation for this class was generated from the following file: