SPI Register Read
Read data from SPI slave device register
Simulink Support Package for Raspberry Pi Hardware / Communication
The SPI Register Read block initiates an SPI read operation from an SPI slave register. You can specify the data type and data length to get data from the slave registers. To open the pin map of the Raspberry Pi board, click the View pin map button.
Port_1 — Output port to read data
This port is the output port to read data from an SPI slave register.
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.
Slave select pin — Pin connected to the SPI slave device
SPI0_CE0 (default) | SPI0_CE1
Select the pin number on the Raspberry Pi board to which the SPI slave device is connected.
Mode (Clock polarity and phase) — Mode of SPI communication
0 (default) | 1 | 2 | 3
Select the mode of SPI communication.
Register address — Register address to read the data
0 (default) | uint8 array
Enter the SPI slave register address to read the data.
Output data type — Data type for output
int8 (default) | uint8 | int16 | uint16 | int32 | uint32 | single | double
Select the data type for SPI communication.
Output data length — Data length for SPI communication
1 (default) | scalar
Enter the output data length of the selected data type to read from the SPI slave register.
Sample time — Interval at which block reads data from SPI slave device
0.1 (default) |
-1 | any nonnegative value
Specify how often this block reads the data from the
SPI slave device, in seconds. When you set this
-1, Simulink® determines the best sample time for
the block based on the block context within the
Introduced in R2017a