spi
Create SPI object
Description
S = spi(
constructs an Vendor
,BoardIndex
,Port
);spi
object associated with
Vendor
, BoardIndex
, and
Port
. Vendor
must be set to either
'aardvark'
, for use with a Total Phase Aardvark adaptor,
or to 'ni845x'
, for use with the NI-845x adaptor board, to
use this interface. BoardIndex
specifies the board index of
the hardware and is usually 0
. Port
specifies the port number within the device and must be set to
0
.
SPI, or Serial Peripheral Interface, is a synchronous serial data link standard that operates in full duplex mode. Instrument Control Toolbox™ SPI support lets you open connections with individual chips and to read and write over the connections to individual chips using an Aardvark host adaptor.
The primary uses for the spi
interface involve the
write
, read
, and
writeAndRead
functions for synchronously reading and
writing binary data. To identify SPI devices in the Instrument Control Toolbox, use the instrhwinfo
function on the SPI
interface, called spi
.
Once the SPI object is created, there are properties that can be used to change communication settings. These includes properties for clock speed, clock phase, and clock polarity. For a list of all the properties and information about setting them, see the link for “Using Properties on the SPI Object” at the end of the Examples section.
Note
To get a list of options you can use on a function, press the Tab key after entering a function on the MATLAB® command line. The list expands, and you can scroll to choose a property or value. For information about using this advanced tab completion feature, see Using Tab Completion for Functions.
Examples
Input Arguments
Version History
Introduced in R2013b