DLN_I2C_SLAVE_WRITE_EV Event

The DLN_I2C_SLAVE_WRITE_EV event is sent when I2C bus master sends data to PC-I2C adapter. The event contains the I2C slave address and data sent by the I2C master device.

 typedef struct
 {
    DLN_MSG_HEADER header;
    uint16_t eventCount;
    uint8_t eventType;
    uint8_t port;
    uint8_t slaveAddress;
    uint16_t size;
    uint8_t buffer[DLN_I2C_SLAVE_BUFFER_SIZE];
 } __PACKED_ATTR DLN_I2C_SLAVE_WRITE_EV;

Members:

header

Defines the DLN message header DLN_MSG_HEADER. The event header contains the following fields:

Field Description
size The size of the message. It is equal to the size of the DLN_I2C_SLAVE_WRITE_EV structure.
msgId Contains the event id. For the DLN_I2C_SLAVE_WRITE_EV event it is set to 0x0C11. The DLN_MSG_ID_I2C_SLAVE_WRITE_EV constant can be used to check the event ID.
echoCounter Number of events sent since the DLN-series adapter is powered on. This counter increments on every event (not only on DLN_I2C_SLAVE_WRITE_EV event). See eventCount member to get the number of DLN_I2C_SLAVE_WRITE_EV events sent after the SPI slave module is configured.
handle A handle to the DLN-series adapter. You can use the handle field to determine the adapter that have sent the event.
eventCount
A number of I2C events sent after the configuration was changed.
eventType
Contains the condition for event generation on the I2C-slave port.
port
A number of the I2C slave port.
slaveAddress
The I2C address that was used in current I2C write transaction. The DLN-series adapter responds to the I2C slave addresses specified with the DlnI2cSlaveGetEvent() function.
size
A number of bytes that we sent by the I2C master device.
buffer
Data sent by the I2C master device.