I2C Read Block Description
This block supports the I2C peripheral interface in Mem Read mode. It is used to read data from a specific register or memory address of a Slave device. The block executes a complex sequence: it first sends the register address it wants to read from, then automatically restarts the bus (Repeated START) into read mode, and outputs the retrieved data to the block output.

Table of Contents
Inputs
| Input Name | Type | Description |
|---|---|---|
| Register address | uint8 / uint16 | The address of the register from which data is to be read. The input data type depends on the value of the Register address size parameter. |
Outputs
| Output Name | Type | Description |
|---|---|---|
| Status | uint8 | Transmission status. Returns:1 transmission successful0 transmission failed |
| Read data[ ] | uint8[ ] | Data received via the I2C interface. The size of the output depends on the value of the Read 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 |
| Register address size | Register address size:I2C_MEMADD_SIZE_8BIT - 8-bitI2C_MEMADD_SIZE_16BIT - 16-bit |
| Read size | Size of the data to be read. Determines the amount of data read from the RX Data input. |
| 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