Classes | |
class | pw::spi::ChipSelector |
class | pw::spi::DigitalOutChipSelector |
class | pw::spi::MockChipSelector |
class | pw::spi::Device |
class | pw::spi::BitsPerWord |
struct | pw::spi::Config |
class | pw::spi::Initiator |
class | pw::spi::MockTransaction |
class | pw::spi::MockInitiator |
Enumerations | |
enum class | pw::spi::ChipSelectBehavior : uint8_t { kPerWriteRead , kPerTransaction } |
enum class | pw::spi::ClockPolarity : uint8_t { kActiveHigh , kActiveLow } |
enum class | pw::spi::ClockPhase : uint8_t { kRisingEdge , kFallingEdge } |
enum class | pw::spi::BitOrder : uint8_t { kLsbFirst , kMsbFirst } |
Functions | |
constexpr | pw::spi::MockTransaction::MockTransaction (Status expected_return_value, ConstByteSpan write_buffer, ConstByteSpan read_buffer) |
Same set of parameters as Initiator::WriteRead() . | |
ConstByteSpan | pw::spi::MockTransaction::read_buffer () const |
Gets the buffer that is virtually read. | |
ConstByteSpan | pw::spi::MockTransaction::write_buffer () const |
Gets the buffer that should be written by the driver. | |
Status | pw::spi::MockTransaction::return_value () const |
Gets the expected return value. | |
constexpr MockTransaction | pw::spi::MockReadTransaction (Status expected_return_value, ConstByteSpan read_buffer) |
A helper that constructs a read only transaction. | |
constexpr MockTransaction | pw::spi::MockWriteTransaction (Status expected_return_value, ConstByteSpan write_buffer) |
A helper that constructs a write only transaction. | |
constexpr | pw::spi::MockInitiator::MockInitiator (span< MockTransaction > transaction_list) |
Status | pw::spi::MockInitiator::Finalize () const |
pw::spi::MockInitiator::~MockInitiator () override | |
Runs Finalize() regardless of whether it was already optionally finalized. | |
pw::Status | pw::spi::MockInitiator::DoWriteRead (pw::ConstByteSpan, pw::ByteSpan) override |
template<size_t kSize> | |
constexpr std::array< MockTransaction, kSize > | pw::spi::MakeExpectedTransactionArray (const MockTransaction(&transactions)[kSize]) |
Makes a new SPI transactions list. | |
|
strong |
Configuration parameter, specifying the bit order for data clocked over the SPI bus; whether least-significant bit first, or most-significant bit first
|
strong |
Configuration data used to determine how the Chip Select signal is controlled throughout a transaction.
kPerWriteRead
indicates that the chip-select signal should be activated/deactivated between calls to WriteRead()
|
strong |
A configuration parameter that specifies whether the phase of the SPI bus clock is rising edge or falling edge.
|
strong |
A configuration parameter that specifies whether a SPI bus clock signal is active low, or active high.
|
inlineoverrideprivatevirtual |
Implements pw::spi::Initiator.
|
overrideprivatevirtual |
Implements a mocked backend for the SPI initiator.
Expects (via Gtest): tx_buffer == expected_transaction_tx_buffer tx_buffer.size() == expected_transaction_tx_buffer.size() rx_buffer.size() == expected_transaction_rx_buffer.size()
Asserts: When the number of calls to this method exceed the number of expected transactions.
Returns: Specified transaction return type
Implements pw::spi::Initiator.
|
inline |
Should be called at the end of the test to ensure that all expected transactions have been met. Returns: Ok - Success. OutOfRange - The mocked set of transactions has not been exhausted.