Skip to content

Struct hal::mock::write_only_spi

ClassList > hal > mock > write_only_spi

Mock spi implementation for use in unit tests and simulations with a spy functions for configure() and a record for thetransfer() out data. The record ignores the in buffer and just stores the data being sent so it can be inspected later.

  • #include <spi.hpp>

Inherits the following classes: hal::spi

Public Attributes

Type Name
spy_handler< settings > spy_configure
Spy handler for hal::spi::configure() __
std::vector< std::vector< hal::byte > > write_record
Record of the out data from hal::spi::transfer() __

Public Static Attributes inherited from hal::spi

See hal::spi

Type Name
constexpr hal::byte default_filler = = hal::byte

Public Functions

Type Name
void reset ()
Reset spy information for both configure() andtransfer() __

Public Functions inherited from hal::spi

See hal::spi

Type Name
status configure (const settings & p_settings)
Configure spi to match the settings supplied.
result< transfer_t > transfer (std::span< const hal::byte > p_data_out, std::span< hal::byte > p_data_in, hal::byte p_filler=default_filler)
Send and receive data between a selected device on the spi bus. This function will block until the entire transfer is finished.
virtual ~spi () = default

Public Attributes Documentation

variable spy_configure

spy_handler<settings> hal::mock::write_only_spi::spy_configure;

variable write_record

std::vector<std::vector<hal::byte> > hal::mock::write_only_spi::write_record;

Public Functions Documentation

function reset

inline void hal::mock::write_only_spi::reset () 

The documentation for this class was generated from the following file libraries/include/libhal-mock/spi.hpp