I2C Transmit and Receive Block Description
This block supports the I2C peripheral interface in Transmit and Receive mode. It is used to directly transmit and immediately receive a data stream from the microcontroller (acting as Master) to a peripheral device (Slave). This block combines the functionalities of both the I2C Transmit and I2C Receive blocks.

Table of Contents
Inputs
| Input Name | Type | Description |
|---|---|---|
| TX Data[ ] | uint8[ ] | Data to be transmitted via the I2C interface. The size of the input depends on the value of the Transmit size parameter. |
Outputs
| Output Name | Type | Description |
|---|---|---|
| Status | uint8 | Transmission status. Returns:1 transmission successful0 transmission failed |
| RX data[ ] | uint8[ ] | Data received via the I2C interface. The size of the output depends on the value of the Receive size parameter. |
Block Parameters
| Parameter | Description |
|---|---|
| I2C Number | I2C module number (for a single MCU I2C, this should be set to 0) |
| Slave address | Address of the slave device |
| Mode | Block operating mode |
| Transmit size | Size of the data to be transmitted. Determines the amount of data read from the TX Data input. |
| Receive size | Size of the data to be received. Determines the amount of data read from the RX Data output. |
| Timeout | How long the system will wait for the block execution |
| Sample time [s] | Function refresh rate |

CubeMX Configuration for a Given MCU
The configuration for the interface can be found on the subpage CubeMX Configuration for a Given MCU.
See Also
Last updated on