MotoHawk Slave SPI Read

This MotoHawk™ block allows data sent to the Slave by the Master to be read.

Block ID

Slave Read SPI

Library

motohawk_SPI_lib

Description

This block allows data sent to the Slave by the Master to be read.

The block reads the input port specified number of frames from the referenced SPI slave device and exports that data on the Data output port along with a status and the number of frames of data that was in the receipt buffer at the time. No more than Max Frames to get of data can be recovered, even if the input port requests more data than this. The receipt buffer is sized to be the largest Max Frames to Load value (attribute of the Slave SPI Reload block) in the model and will suffer overrun if the Master sends more data frames than this.

An application may contain multiple SPI slave read blocks, however they all read from the same buffer associated with the SPI slave definition.

Status Description

Status Value Status Description
0 All buffer data was acquired.
1 Data was acquired, but more data was available.
2 Request for more data than was available.
3 Buffer Overrun. More frames of data were received than could be buffered.

Block Parameters

Parameter Field Values Comments/Description
Slave SPI Definition Name Single quote enclosed alphanumeric Name of the SPI slave definition whose buffer is to be read.
Max Frames to get Numeric Maximum number of frames that can be read from the buffer by this instance of the block.
Frame Size Drop-down list Selectable frame size, either 8 bit or 16 bit. This specifies the number of bits in one frame of data.