Hello,
I am using a C3 Mini from wemos:
https://www.wemos.cc/en/latest/c3/c3_mini.html
Lolin EPD 2.3" BWR SSD1680:
https://www.wemos.cc/en/latest/d1_mini_shield/epd_2_13_ssd1680.html
I am able to use the EPD with the Lolin Library: 2 link limit, cannot link
In the LOLIN library example, I just have to change the #defined pin numbers, including MOSI and CLK. The pin numbers from a D1 do not coordinate identically to a C3 mini.
So after having successfully redefined the pins in the Lolin library. I attempted to understand how that would be done in the GXEPD2 library example for ESP32
GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display(GxEPD2_DRIVER_CLASS(/*CS=*/ 15, /*DC=*/ 27, /*RST=*/ 26, /*BUSY=*/ 25));
#endif
I changed the pins in this driver class to whatever my C3 was connected to and worked with the Lolin Library example.
But when it comes to the MOSI and CLK pins, I don't know if I've found the correct location in which they are defined.
I assumed it was here:
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println("setup");
// *** special handling for Waveshare ESP32 Driver board *** //
// ********************************************************* //
#if defined(ESP32) && defined(USE_HSPI_FOR_EPD)
hspi.begin(13, 12, 14, 15); // remap hspi for EPD (swap pins)
hspi.begin has pins listed but I don't know the true order and cannot find reference to it elsewhere in the code, perhaps I would have to dive into one of the included headers?
I tried to understand this comment of the code, but it does not have a mapping example for MOSI even though the text description discusses MOSI.
// mapping of Waveshare ESP32 Driver Board
// BUSY -> 25, RST -> 26, DC -> 27, CS-> 15, CLK -> 13, DIN -> 14
// NOTE: this board uses "unusual" SPI pins and requires re-mapping of HW SPI to these pins in SPIClass
// this example shows how this can be done easily, updated for use with HSPI
//
// The Wavehare ESP32 Driver Board uses uncommon SPI pins for the FPC connector. It uses HSPI pins, but SCK and MOSI are swapped.
// To use HW SPI with the ESP32 Driver Board, HW SPI pins need be re-mapped in any case. Can be done using either HSPI or VSPI.
// Other SPI clients can either be connected to the same SPI bus as the e-paper, or to the other HW SPI bus, or through SW SPI.
// The logical configuration would be to use the e-paper connection on HSPI with re-mapped pins, and use VSPI for other SPI clients.
// VSPI with standard VSPI pins is used by the global SPI instance of the Arduino IDE ESP32 package.
Any guidance is appreciated. All of my arduino experience is just through hacky hobbyist methods, reverse engineering my understanding of the smallest amount of information I understand until things work.