DEKI/ENGINE 文档
deki-lora 0.19.0
Deki 包参考
deki-lora

LoRa 射频。Semtech SX1262 驱动,收发数据包,内置占空比限制。

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

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

在编辑器中显示为 **LoRa (SX1262)**。

组件

组件 类别 说明
SX1262LoRaComponent 无线电 通过 SPI 设置 Semtech SX1262 LoRa 无线模块。

组件参考

SX1262LoRaComponent

通过 SPI 设置 Semtech SX1262 LoRa 无线模块。

检视器中的名称:SX1262 LoRa · 类别:无线电 · 类型:DekiLora::SX1262LoRaComponent

属性 类型 默认值 约束 说明
spiHost int32 1 1 到 2 SPI 控制器:1 为 SPI2,2 为 SPI3。与显示屏共用引脚时,请使用显示屏所用的控制器。
sckPin int32 40 -1 到 48
mosiPin int32 41 -1 到 48
misoPin int32 38 -1 到 48
csPin int32 9 0 到 48 无线电模块的片选 (NSS)
busyPin int32 13 0 到 48 无线电模块的 BUSY 引脚
resetPin int32 17 0 到 48 无线电模块的 NRESET 引脚
dio1Pin int32 45 -1 到 48 无线电模块的 DIO1 引脚,即中断线(-1:未连接)。连接后,只有在模块有数据要报告时才通过 SPI 查询,而不是每帧都查询。
spiHz int32 8000000 100000 到 1.6e+07 SPI 时钟。SX1262 最高支持 16 MHz。
tcxoVoltage float 1.8 0 到 3.3 DIO3 为无线电模块的 TCXO 提供的电压 (V);开发板使用普通晶振时为 0。LilyGO 开发板:1.8
dio2AsRfSwitch bool true 由 DIO2 切换天线的发送和接收,大多数 SX1262 模块都是如此
frequencyHz int32 868100000 1.5e+08 到 9.6e+08 载波频率,单位 Hz。必须是你所在地区允许的频率:欧洲为 868100000,美洲为 915000000。
spreadingFactor int32 7 7 到 12 7 最快;每升高一级,空中传输时间翻倍,通信距离也更远
bandwidthKHz int32 125 7 到 500 带宽,单位 kHz:125、250 或 500(62.5 及以下写作 62、41、31、20、15、10、7)
codingRate int32 5 5 到 8 编码率 4/5 到 4/8,用 5 到 8 表示:越大越抗干扰,速度也越慢
txPowerDbm int32 14 -9 到 22 发射功率,单位 dBm。欧洲 868.0-868.6 MHz 频段允许 14。
syncWord int32 18 0 到 255 同步字:无线电只能收到同步字相同的其他设备。0x12 (18) 为私有网络,0x34 (52) 为 LoRaWAN。
dutyCyclePercent float 1 0.1 到 100 无线电发送时间所占比例的上限,单位为百分比:发送一个数据包后,会等待直到满足此限制。欧洲 868.0-868.6 MHz 频段允许 1。设为 100 则取消限制(仅限法律允许的地区)。

更新日志

更新日志为英文。

0.19.0

Changed

  • minEngine 0.19.0: built against engine 0.19.0, whose component metadata records the package each class is in. A build of this package from before does not load and is rebuilt.

Added

  • Japanese, Simplified Chinese and Korean: editor/lang/ja.json, zh.json and ko.json translate the names, tooltips and enum values this package's components show in the Inspector.

0.18.2

Added

  • The package: a Semtech SX1262 LoRa driver (SX1262LoRaComponent for the boot scene, DekiLoRa::GetCurrent() for game code). Sends and receives packets with RSSI and SNR, listens whenever it is not sending, and enforces a duty cycle (1% by default, Europe's 868 MHz rule). Joins an SPI bus the display already uses, as on the LilyGO T-Deck. ESP-IDF only.
  • dio1Pin (45, the T-Deck's): with the radio's interrupt line wired, the radio is asked over SPI only when DIO1 is raised, rather than every frame on a bus the display is sending frames on.

更早的版本:CHANGELOG.md


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