SPI 通信
SPI(即串行外围设备接口),是一种以全双工模式运行的同步串行数据链路标准。它通常用于测试和测量领域。典型用途包括与微控制器、EEPROM、A2D 设备、嵌入式控制器等通信。使用 Instrument Control Toolbox™ SPI 支持,您可以打开与单个芯片的连接并通过连接进行读写。
使用 spi 函数创建接口对象,并使用 read 和 write 函数进行通信。要使用 SPI 接口,您必须安装 Total Phase Aardvark 主机适配器或 NI-845x 适配器板。请参阅Configuring SPI Communication了解详细信息。
函数
instrhwinfo | Information about available hardware |
spi | Create SPI object |
read | Read binary data from SPI instrument |
write | Write binary data to SPI instrument |
writeAndRead | Write and read binary data from SPI instrument |
methods | Class method names and descriptions |
disp | Display instrument object summary information |
connect | Connect device object to instrument |
disconnect | Disconnect device object from instrument |
clear | Remove instrument objects from MATLAB workspace |
主题
- Configuring SPI Communication
You must have a Total Phase Aardvark host adaptor or an NI-845x adaptor board installed to use the
spiinterface. - Transmitting Data over the SPI Interface
The typical workflow for transmitting data over the SPI interface involves adaptor discovery, connection, communication, and cleanup. This example covers the whole workflow.
- Using Properties on the SPI Object
Use interface-specific properties with the
spiobject. - SPI Interface Overview
The 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 or NI-845x host adaptor.
- SPI Interface Usage Requirements and Guidelines
These requirements and tips apply to the use of the SPI interface.
疑难解答
Try these tips if you have problems using the toolbox with the SPI interface. Includes information about SPI supported platforms, adapter requirements, and configuration and connection.
