Pigweed
 
Loading...
Searching...
No Matches
pw::i2c::Transaction Class Reference

#include <initiator_mock.h>

Public Member Functions

constexpr Transaction (Status expected_return_value, Address device_address, ConstByteSpan write_buffer, ConstByteSpan read_buffer, std::optional< chrono::SystemClock::duration > timeout=std::nullopt)
 
constexpr Transaction (Status expected_return_value, Address device_address, std::optional< chrono::SystemClock::duration > timeout=std::nullopt)
 Alternative constructor for creating probe transactions.
 
ConstByteSpan read_buffer () const
 Gets the buffer that is virtually read.
 
ConstByteSpan write_buffer () const
 Gets the buffer that the I2C device should write to.
 
std::optional< chrono::SystemClock::durationtimeout () const
 Gets the minimum duration to wait for a blocking I2C transaction.
 
Address address () const
 Gets the I2C address that the I2C transaction is targeting.
 
Status return_value () const
 Gets the expected return value for the transaction.
 

Detailed Description

DEPRECATED: This file is deprecated in favor of initiator_message_mock.h Base class for creating transaction instances. For read-only, write-only, or probe transactions, improve code readability by using one of the following helpers instead:

  • pw::i2c::ReadTransaction
  • pw::i2c::WriteTransaction
  • pw::i2c::ProbeTransaction

If you need to create a write-then-read transaction, you can use this class.

Constructor & Destructor Documentation

◆ Transaction()

constexpr pw::i2c::Transaction::Transaction ( Status  expected_return_value,
Address  device_address,
ConstByteSpan  write_buffer,
ConstByteSpan  read_buffer,
std::optional< chrono::SystemClock::duration timeout = std::nullopt 
)
inlineconstexpr

Constructor for creating write-only, read-only, or write-then-read transactions.


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