Skip to Content
Block descriptionsSPISPI Transmit only

SPI Transmit only Peripheral Block Description

This block handles the SPI peripheral interface in Transmit only mode. It is used to transmit data to an SPI Slave device. This block is useful in scenarios where the SPI device only requires data transmission without the need to receive any data back, such as with certain display drivers, sensors, or memory modules.



SPI Transmit only block

Table of Contents

Inputs

Input NameTypeDescription
TX data[ ]uint8Data to be transmitted. The amount of data depends on the Transmit size parameter.

Outputs

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

Block Parameters

ParameterDescription
SPI NumberSPI module number
Chip SelectOption to enable the Chip Select pin selection. If disabled, the CS pin will not be available or the Hardware NSS Signal must be used.
Chip Select PortConditional Parameter
GPIO port for the Chip Select pin. This parameter is available if the Chip Select option is enabled.
Chip Select PinConditional Parameter
GPIO pin for the Chip Select pin. This parameter is available if the Chip Select option is enabled.
ModeSPI block operating mode:
Transmit only - transmission mode
Receive only - reception mode
Transmit and receive - simultaneous transmission and reception mode
Receive after transmit - sequential transmission and subsequent reception mode
Transmit sizeData transfer size in bytes. This parameter determines the amount of data that will be transmitted in one transmission cycle.
TimeoutThe time to wait for the transmission to complete. If the transmission does not finish within this period, the block returns an error status.
Sample time [s]Function refresh period


Block parameters for SPI Transmit only

CubeMX Configuration for a Given MCU Model

Configuration of CubeMX for the SPI interface can be found in the CubeMX Configuration for a Given MCU Model section.

See Also

Last updated on