I2C Callback Events

group group_scb_i2c_macros_callback_events

Macros to check I2C events passed by cy_cb_scb_i2c_handle_events_t callback.

Each event is encoded in a separate bit, and therefore it is possible to notify about multiple events.

Defines

CY_SCB_I2C_SLAVE_READ_EVENT

Indicates that the slave was addressed and the master wants to read data.

This event can be used to configure the slave Read buffer.

CY_SCB_I2C_SLAVE_WRITE_EVENT

Indicates that the slave was addressed and the master wants to write data.

This event can be used to configure the slave Write buffer.

CY_SCB_I2C_SLAVE_RD_IN_FIFO_EVENT

All slave data from the configured Read buffer has been loaded into the TX FIFO.

The content of the Read buffer can be modified. Applicable only if the TX FIFO is used.

CY_SCB_I2C_SLAVE_RD_BUF_EMPTY_EVENT

The master has read all data out of the configured Read buffer.

This event can be used to configure the next Read buffer. If the buffer remains empty, the CY_SCB_I2C_DEFAULT_TX bytes are returned to the master.

CY_SCB_I2C_SLAVE_RD_CMPLT_EVENT

Indicates the master completed reading from the slave (set by the master NAK or Stop)

CY_SCB_I2C_SLAVE_WR_CMPLT_EVENT

Indicates the master completed writing to the slave (set by the master Stop or Restart)

CY_SCB_I2C_SLAVE_ERR_EVENT

Indicates the I2C hardware detected an error.

Check Cy_SCB_I2C_SlaveGetStatus to determine the source of the error.

CY_SCB_I2C_MASTER_WR_IN_FIFO_EVENT

All data specified by Cy_SCB_I2C_MasterWrite has been loaded into the TX FIFO.

The content of the master write buffer can be modified. Applicable only if the TX FIFO is used.

CY_SCB_I2C_MASTER_WR_CMPLT_EVENT

The master write started by Cy_SCB_I2C_MasterWrite is complete.

CY_SCB_I2C_MASTER_RD_CMPLT_EVENT

The master read started by Cy_SCB_I2C_MasterRead is complete.

CY_SCB_I2C_MASTER_ERR_EVENT

Indicates the I2C hardware has detected an error.

It occurs together with CY_SCB_I2C_MASTER_RD_CMPLT_EVENT or CY_SCB_I2C_MASTER_WR_CMPLT_EVENT depends on the direction of the transfer. Check Cy_SCB_I2C_MasterGetStatus to determine the source of the error.