SPI Controller Transfer
Write data to and read data from SPI peripheral device
Simulink Support Package for Raspberry Pi Hardware / Communication
Write data to and read data from an SPI peripheral device. To open the pin map of the Raspberry Pi board, click the View pin map button.
Port_1 — Input port to write data to SPI
[Nx1] or [1xN] array
The input port through which the block accepts a single dimensional array of values to write to the peripheral device.
Port_1 — Output port to read data from an SPI peripheral
Output port from which the block receives data from SPI peripheral device.
Board — Specific board used for SPI communication
Pi 2 Model
B (default) |
Model B Rev1 |
Model B Rev2 |
Model B+ |
Pi 3 Model B
Select the specific board that you are using. Changing the board updates the pin choices that you get.
Chip select pin — Chip select pin to which the SPI peripheral device is connected
SPI0_CE0 (default) | SPI0_CE1
Select the pin number on the Raspberry Pi® board to which the SPI peripheral device is connected.
Mode (Clock polarity and phase) — Mode of SPI communication
0 (default) | 1 | 2 | 3
Select the mode for SPI communication.
For more information on mode, refer to SPI Transfer Modes
Introduced in R2017a