Skip to Content

I2C Receive Block Description

This block supports the I2C peripheral interface in Receive mode. It is used to directly receive a data stream by the microcontroller (acting as Master) from a peripheral device (Slave). The block sends the device address with a read request and writes the received bytes to its output port.



I2C Receive block

Table of Contents

Inputs

There are no inputs in this operating mode.

Outputs

Output NameTypeDescription
Statusuint8Transmission status. Returns:
1 transmission successful
0 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

ParameterDescription
I2C NumberI2C module number (for a single MCU I2C, this should be set to 0)
Slave addressAddress of the slave device
ModeBlock operating mode
Receive sizeSize of the data to be received. Determines the amount of data returned by the RX Data output.
TimeoutHow long the system will wait for the block execution
Sample time [s]Function refresh rate


Block parameters for I2C

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