#include <message.h>
Public Member Functions | |
bool | IsRead () const |
bool | IsTenBit () const |
bool | IsWriteContinuation () const |
Address | GetAddress () const |
ByteSpan | GetMutableData () const |
ConstByteSpan | GetData () const |
Static Public Member Functions | |
static constexpr Message | WriteMessage (Address address, ConstByteSpan data) |
static constexpr Message | WriteMessageContinuation (ConstByteSpan data) |
static constexpr Message | ReadMessage (Address address, ByteSpan data) |
A struct that represents I2C read and write messages.
Individual messages can be accumulated into a span and transmitted in one atomic i2c transaction using an Initiator implementation.
|
inline |
Getter for the address component.
|
inline |
Getter for the data component.
|
inline |
Getter for the data component.
This method is only valid for Read messages and will runtime ASSERT on other messages.
|
inline |
Getter for whether this object represents a read operation.
|
inline |
Getter for whether this object represents an operation addressed with a ten-bit address. When true, communicate on the wire using the i2c 10-bit addressing protocol.
|
inline |
Getter for whether this object represents a continued write.
|
inlinestaticconstexpr |
Creates a pw::i2c::Message
instance for an i2c read message.
This Message can be passed to Initiator::TransferFor().
pw::i2c::Message
instance.
|
inlinestaticconstexpr |
Creates a pw::i2c::Message
instance for an i2c write message.
This Message can be passed to Initiator::TransferFor().
pw::i2c::Message
instance.
|
inlinestaticconstexpr |
Creates a pw::i2c::Message
instance for an i2c write message without a start condition sent on the bus. Chaining one or more of these messages after a regular Write message allows the client to send non-contiguous blocks of memory as one single write message to the i2c target.
Note: This message must follow another write message.
Note: No addresses is needed and no address will be transmitted. The data should immediately follow the data from the previous write message.
This Message can be passed to Initiator::TransferFor().
pw::i2c::Message
instance.