通过蓝牙的 SPI 显示

SPI Display over Bluetooth

我想 运行 从 Raspberry Pi 完全通过蓝牙显示 SPI 4. 我有一个 ESP32,可用于时钟信号,芯片 select,电源,等。我让他们通过蓝牙进行通信,但我只是不知道如何通过蓝牙而不是通过 pin 发送数据。我正在使用 this 库中的 ST7789 驱动程序。我需要知道我必须更改哪些代码 and/or 添加才能使这项工作正常进行。

谢谢!

我建议让 Raspberry Pi 和 ESP32 之间的通信处于比在 SPI 引脚上发送的二进制数据更高的抽象级别。我会获取 ESP32 上使用的方法的参数,并通过蓝牙串行连接传递它们。

例如,假设您将其用作 library on the ESP32. It has methods,例如:

ST7789.fill(color) # Fill the entire display with the specified color.
ST7789.pixel(x, y, color) # Set the specified pixel to the given color.

您可以通过蓝牙串行端口配置文件 (SPP) 连接发送这样的数据,这将相对直接地在 ESP32 上解压缩并使用值填充命令。

spp.send('fill, 63488') # Fill the entire display with red
spp.send('pixel, 12, 12, 63488') # # Set pixel 12,12 to red