-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose setting to select SPI bus for ESP32 #5
Comments
Hi, Where does this code need to be added? I use a waveshare - GDEW075Z09 7.5" b/w/r Kind regards, |
Hi Ivan, If you're making the modification yourself, it should be enough to drop it somewhere in main.cpp ( You might need to adjust the other pins as well (dc, rst, busy). Unfortunately not currently possible to use the multi-color displays. |
Notes:
Can go both above and below the current I personally do it above, but that's just me. Also, this library requires the default hardware SPI bus pins. My tests with changing those SPI pins ends up with the display doing nothing. There is an internal fork for using Software SPI, but the author does not recommend that. Luckily, the ESP32 has a spare bus (as shown by @sidoh above) that works fine when using it's set of pins. SPI1 isn't usually allowed to be used by users, as it's commonly used for SPI RAM (PSRAM), and SPI0 is the main system flash. (If you wish, you can set up the PSRAM bus, but I would not recommend it) As such, I put forth this suggestion for selecting the 2 free busses. This would fit best on the Hardware tab in the Settings page. |
I started a little bit yesterday, but I got chumped when it came to the Web interface once again 😅 The main bit that matters is this: ...
void initDisplay() {
#if defined(ESP32)
if(settings.hardware.spi_bus != HSPI){
if (settings.hardware.spi_bus == VSPI){
SPI.end();
SPI.begin(18, 23, 19, 5);
}
}
#endif
if (display) {
delete display;
display = NULL;
}
... And in case you're not using an editor that shows the definitions of HSPI/VSPI easily, here are screenshots from VSCode |
@sidoh, we should be good to close this if you feel the new features are satisfactory. :) |
ESP32s have multiple SPI busses.
With GxEPD2, the user is supposed to configure the global
SPI
instance, which it then uses.To change the SPI bus, one must do the following:
The text was updated successfully, but these errors were encountered: