◆ Port
I2C Port definition.
Enumerator |
---|
I2C_PORT_1 | I2C Port 1
|
I2C_PORT_2 | I2C Port 2
|
NUM_I2C_PORTS | Number of I2C ports
|
◆ I2C()
Constructs an I2C object with provided payload data.
- Parameters
-
data | Reference to payload data |
◆ deserialize()
void deserialize |
( |
std::string & |
i2cDatagramPayload | ) |
|
Deserializes I2C data from payload string.
- Parameters
-
i2cDatagramPayload | String containing serialized I2C data |
◆ getBuffer()
const uint8_t * getBuffer |
( |
| ) |
const |
Gets the I2C buffer.
- Returns
- Pointer to the buffer array
◆ getBufferLength()
size_t getBufferLength |
( |
| ) |
const |
Gets the I2C buffer length.
- Returns
- Buffer length
◆ getI2CPort()
Gets the target I2C port.
- Returns
- Target port
◆ serialize()
std::string serialize |
( |
const CommandCode & |
commandCode | ) |
const |
Serializes I2C data with command code for transmission.
- Parameters
-
commandCode | Command code to include in serialized data |
- Returns
- Serialized string containing I2C data
◆ setBuffer()
void setBuffer |
( |
const uint8_t * |
data, |
|
|
size_t |
length |
|
) |
| |
Sets data in the I2C buffer.
- Parameters
-
data | Pointer to data to copy into buffer |
length | Length of data to copy |
◆ setI2CPort()
void setI2CPort |
( |
const Port & |
i2cPort | ) |
|
Sets the target I2C port.
- Parameters
-
i2cPort | Port to set as target |
◆ I2C_MAX_BUFFER_SIZE
constexpr size_t I2C_MAX_BUFFER_SIZE = 256 |
|
staticconstexpr |
Maximum permitted buffer size
◆ m_i2cDatagram
The documentation for this class was generated from the following files:
- simulation/common/inc/i2c_datagram.h
- simulation/common/src/i2c_datagram.cc