README.txt 1.1 KB

123456789101112131415161718192021222324
  1. ### support for SW SPI for GxEPD2
  2. GxEPD2 supports only HW SPI with the unmodified library.
  3. The replacement files in the src directory provide the option to use SW SPI.
  4. This is a workaround and not very elegant, therefore it is provided as a replacement only.
  5. To use SW SPI with GxEPD2:
  6. - copy the files GxEPD2_EPD.h and GxEPD2_EPD.cpp from the subdirectoy .src to the .src directory of the library.
  7. - add the special call to the added init method BEFORE the normal init method:
  8. display.epd2.init(SW_SCK, SW_MOSI, 115200, true, 20, false); // define or replace SW_SCK, SW_MOSI
  9. display.init(115200); // needed to init upper level
  10. To use the modified library with HW SPI
  11. - comment out the special init call:
  12. //display.epd2.init(SW_SCK, SW_MOSI, 115200, true, 20, false); // define or replace SW_SCK, SW_MOSI
  13. display.init(115200);
  14. To switch back to using HW SPI during run time
  15. display.epd2.init(-1, -1, 115200, true, 20, false); // revert to HW SPI
  16. display.init(115200); // needed to init upper level
  17. The SW SPI allows also to read through MOSI pin from DIN of e-paper controller
  18. data = display.epd2._readData();
  19. display.epd2._readData(data, n);