主要内容

SPI 设备

R2026b
读取和写入连接到 Arduino® 硬件的 SPI 设备

在使用 SPI 函数之前,请使用 arduino 创建一个 Arduino 对象。有关详细信息,请参阅Connect to Arduino Hardware。您可以使用 Arduino 资源管理器以交互方式配置 SPI 通信接口,以在 MATLAB® 和 MATLAB Online™ 中对连接到 Arduino 和其他受支持硬件的 SPI 设备读取和写入数据。有关详细信息,请参阅 Connect to SPI Device Using Arduino Explorer App。

有关安装版 MATLAB 中支持的硬件的完整列表,请参阅Supported Hardware。有关 MATLAB Online 支持的板、工作流和平台的详细信息,请参阅Get Started with MATLAB Online for Arduino。

注意

所有函数都使用 MATLAB Function 模块生成代码。有关详细信息,请参阅Deploy Arduino Functions to Arduino Hardware Using MATLAB Function Block。

函数

deviceConnection to device on SPI bus on Arduino or ESP32 hardware
writeReadWrite and read data from SPI device

主题