DEKI/ENGINE 文档
deki-spi 0.20.2
Deki 包参考
deki-spi

SPI 总线及其设备。一个启动步骤只启动一次总线,显示屏、SD 卡和无线模块共用它。

仓库:github.com/dekiengine/deki-spi · 最新版本:0.20.0 · 需要引擎 0.20.0 或更高版本

使用 DekiEditor --packages-add deki-spi <project> 或通过包管理器安装。引擎自身的组件和 C++ API 见 Deki 文档。

在编辑器中显示为 **SPI**。

组件

组件 类别 说明
SPIBusComponent 系统 启动时开启一条 SPI 总线。该总线上的所有设备(显示屏、SD 卡、无线电)共用它。

组件参考

SPIBusComponent

启动时开启一条 SPI 总线。该总线上的所有设备(显示屏、SD 卡、无线电)共用它。

检视器中的名称:SPI 总线组件 · 类别:系统 · 类型:DekiSpi::SPIBusComponent

属性 类型 默认值 约束 说明
spiHost int32 1 0 到 3 使用芯片的哪个 SPI 控制器,按平台的编号。在 ESP32-S3 上:1 = SPI2,2 = SPI3。
sclkPin int32 -1 -1 到 48 传输时钟(SCK)的 GPIO。此总线上的所有设备共用。
mosiPin int32 -1 -1 到 48 传输数据输出(MOSI)的 GPIO;在四线总线上为 IO0。
misoPin int32 -1 -1 到 48 传输数据输入(MISO)的 GPIO;在四线总线上为 IO1。总线上不读取任何数据时为 -1。
io2Pin int32 -1 -1 到 48 四线总线的 IO2(例如通过 QSPI 连接的 AMOLED 面板)。普通 SPI 总线为 -1。
io3Pin int32 -1 -1 到 48 四线总线的 IO3。普通 SPI 总线为 -1。
maxTransferBytes int32 32768 64 到 262144 总线一次能处理的最长传输。显示屏以这个长度的传输发送像素,因此在接有显示屏的总线上,请保持为芯片的上限(ESP32-S3 上为 32768)。

更新日志

更新日志为英文。

0.20.0

Changed

  • minEngine 0.20.0: built against engine 0.20.0. A build of this package from before does not load and is rebuilt.

Added

  • The package: IDekiSPIBus and IDekiSPIDevice, the DekiSPI registry the platform's factory and the buses are found in, and SPIBusComponent, which starts a bus from the boot scene. A transfer has optional command and address phases, one, two or four data lines, a data/command pin level and a chip select that can stay asserted into the next transfer; long writes are queued for DMA and waited for. A queued transfer of four bytes or less is copied, so a command can be queued from the stack.
  • DeviceConfig::readClockHz: a device read at a slower clock than it is written (a display written at 80 MHz and read back at 10), and DeviceConfig::threeWire, for a device that answers on MOSI.

更早的版本:CHANGELOG.md


由包的反射数据生成(引擎 0.20.2)。属性名就是场景文件中使用的键。重命名后会保留别名(兼容性)。