Closed bavis-m closed 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
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.
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.
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().