A generic mocked backend for pw::spi::Initiator
. Represents a complete parameter set for the pw::spi::Initiator::WriteRead()
. This is specifically intended for use when developing drivers for SPI devices. It's structured around a set of "transactions" where each transaction contains a write, read, and a status. A transaction list can then be passed to the MockInitiator
, where each consecutive call to read/write will iterate to the next transaction in the list.
Public Member Functions | |
constexpr | MockTransaction (Status expected_return_value, ConstByteSpan write_buffer, ConstByteSpan read_buffer) |
Same set of parameters as Initiator::WriteRead() . | |
ConstByteSpan | read_buffer () const |
Gets the buffer that is virtually read. | |
ConstByteSpan | write_buffer () const |
Gets the buffer that should be written by the driver. | |
Status | return_value () const |
Gets the expected return value. | |