主要内容

SPI Controller Transfer

Write to and read from SPI device connected to NVIDIA Jetson board

Since R2026a

  • SPI Controller Transfer block

Libraries:
NVIDIA Jetson and NVIDIA DRIVE / Communication

Description

Add-On Required: This feature requires the MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms add-on.

The SPI Controller Transfer block writes data to and reads data from a Serial Peripheral Interface (SPI) device connected to an NVIDIA® Jetson™ boards.

Ports

Input

expand all

Data to write, specified as a scalar or vector.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Output

expand all

Data read from the register of the SPI device, returned as a scalar or vector. The output data is the same size and data type as the input data.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Hardware board to deploy the model to.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

To get the block parameter value programmatically, use the get_param (Simulink) function.

Parameter: Board
Values: "NVIDIA Jetson TX2 Developer Kit" | "NVIDIA Jetson AGX Xavier Developer Kit" | "NVIDIA Jetson AGX Orin Developer Kit" | "NVIDIA Jetson Xavier NX Developer Kit" | "NVIDIA Jetson Orin Nano Developer Kit" | "NVIDIA Jetson Nano Developer Kit"

Example: set_param(gcb,"Board","NVIDIA Jetson Orin Nano Developer Kit")

Pin connected to the SPI peripheral device. For TX2 boards, the default value is SPI3_CS0. For other boards, the default value is SPI0_CS0.

Dependencies

The available options depend on the Board parameter. This table shows the available interfaces for each board.

BoardSPI Interfaces

NVIDIA Jetson AGX Xavier Developer Kit

SPI0

NVIDIA Jetson TX2 Developer Kit

SPI3

NVIDIA Jetson Orin Nano Developer Kit

SPI0 and SPI1

NVIDIA Jetson Nano Developer Kit

SPI0 and SPI1

NVIDIA Jetson AGX Orin Developer Kit

SPI0 and SPI2

NVIDIA Jetson Xavier NX Developer Kit

SPI0 and SPI2

Mode to use for SPI communication. This table shows the clock polarity and clock phase for each setting.

ModeClock PolarityClock Phase
000
101
210
311

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

To get the block parameter value programmatically, use the get_param (Simulink) function.

Parameter: ClockMode
Values: "0" (default) | "1" | "2" | "3"

Example: set_param(gcb,"ClockMode","2")

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced in R2026a