adafruit / Adafruit_SHARP_Memory_Display

This is an Arduino library for the Adafruit Monochrome SHARP Memory Displays
http://www.adafruit.com/products/1393
Other
60 stars 54 forks source link

Split the SPI initialization part of begin() into begin_spi() #20

Closed bavis-m closed 2 years ago

bavis-m commented 2 years ago

Split the SPI initialization part of begin() into begin_spi(). You may need to call this part of initialization manually if you use more than once device on the same SPI bus as the Sharp Memory display, as the pins will need to be reset after the other SPI bus closes (depending on the bus code that driver uses).

Does not change the functionality of begin().

ladyada commented 2 years ago

?? the root cause is quite odd - using the SPI bus with other devices should not affect this library - so this is covering some other bug

bavis-m commented 2 years ago

I wonder if it's something like I'm trying to use the ports on both the hardware SPI device and as a software device, and the pins are getting remapped or something? I'm going back through my old tests on this project to see what I uncovered about the bug.

bavis-m commented 2 years ago

I think you are write, this is an issue with the other drivers I was using (SPIMemory) for other devices on the bus. It looks like SPIMemory doesn't correctly select whichever hardware SPI controller you tell it on the esp32, and I believe this caused my original issue, which was causing my Sharp display to also not work on the hardware controller. I had switched the Sharp to use software SPI (handled by the underlying Adafruit_SPIDevice I guess), and probably the io mux on the esp32 was confused between the old hardware SPI reference using those pins, and the Adafruit_SPIDevices attempt to use them as gpio. I'll remove this pull request.