SPIRead (Read from SPI Peripheral)

The SPIRead instruction synchronously reads the specified number of bytes from the SPI peripheral.

NOTE: Campbell Scientific documentation has been updated to replace legacy industry terms with modern terminology. Controller-peripheral are now used to describe SPI communications. The SPI controller initiates communications and makes requests of peripheral device(s). Peripheral devices process requests and return an appropriate response See https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names for more information.

Syntax

SPIRead ( BeginPort, Dest, NumBytes )

Remarks

Serial Peripheral Interface (SPI) protocol is a clocked synchronous interface, used for short distance communication, generally between embedded devices.

Note that a prior understanding of the operation and details of the SPI protocol is assumed.

Parameters

BeginPort

The beginning port used for the three signals for SPI communications. The first port is the SPI clock signal. The next higher port from the clock port is the Controller Out Peripheral In (COPI) signal, and the next higher port is Controller In Peripheral Out (CIPO). BeginPort can be C1, U1, U5, or U9. If an additional chip select (CS) signal is required, it can be managed with PortSet instructions surrounding the SPI accesses.

Type: Constant

Dest

The variable in which the bytes read in will be stored.

Type: Variable

NumBytes

The number of bytes to clock from the periphreal device.

Type: Variable or constant