Skip to Content

I2C Transmit Block Description

This block supports the I2C peripheral interface in Transmit mode. It is used to directly transmit a data stream from the microcontroller (acting as Master) to a peripheral device (Slave). The block generates a START signal, sends the device address, and then transmits the data provided to the block input, ending the sequence with a STOP signal.



I2C Transmit block

Table of Contents

Inputs

Input NameTypeDescription
TX Datauint8[ ]Data to be transmitted via the I2C interface. The size of the input depends on the value of the Transmit size parameter.

Outputs

Output NameTypeDescription
Statusuint8Transmission status. Returns:
1 transmission successful
0 transmission failed

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
Transmit sizeSize of the data to be transmitted. Determines the amount of data read from the TX Data input.
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