-2

I want to run an SPI display completely via Bluetooth from a Raspberry Pi 4. I have an ESP32 that can be used for a clock signal, chip select, power, etc. I have them communicating via Bluetooth, but I just do not know how I would send the data over Bluetooth instead of through a pin. I am using the ST7789 driver from this library. I need to know what code I would have to change and/or add to make this work.

Thanks!

1 Answers1

0

I would suggest having the communication between the Raspberry Pi and the ESP32 at a higher level of abstraction than the binary data sent on the SPI pins. I would take the parameters for the methods used on the ESP32 and pass them over the Bluetooth Serial connection.

Let's say for example you are using this as the library on the ESP32. It has methods like:

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

You could send data like this over the Bluetooth Serial Port Profile (SPP) connection which would be relatively straight forward to unpack on the ESP32 and populate the commands with the values.

spp.send('fill, 63488') # Fill the entire display with red
spp.send('pixel, 12, 12, 63488') # # Set pixel 12,12 to red
ukBaz
  • 6,985
  • 2
  • 8
  • 31