st7789 icon indicating copy to clipboard operation
st7789 copied to clipboard

how to share the SPI bus between this crate and another?

Open mutantbob opened this issue 3 years ago • 2 comments
trafficstars

If I want to transfer data between an OV5642 camera (SPI) and an ST7789 display, how do I share the SPI bus?

The display_interface_spi::SPIInterface takes ownership of the SPI object, preventing me from sharing it with the OV5642, and I can not buffer the entire image (320x240 even converted to 16 bits would exceed the RAM on the Arduino Uno).

mutantbob avatar Jun 16 '22 19:06 mutantbob

This is a problem in the HAL of your PAC. I've tried to solve this for the RISC-V MCUs of E310x family by introducing a shared device concept based on this design with this similar implementation in the HAL

So sadly if you need shared bus, the HAL implementor for your SoC will need to add that.

almindor avatar Jun 17 '22 17:06 almindor

As for a workaround you can use release() to get the SPI back and sort of just juggle the around. Display interface has a release() as well which will give you the whole thing back. It's a crappy workaround tho.

almindor avatar Jun 17 '22 17:06 almindor