Skip to content

Commit

Permalink
Version 1.2.5
Browse files Browse the repository at this point in the history
- added support for GDEW1248T3 12.84" b/w panel on Waveshare 12.48 e-paper display frame
- tested with Waveshare Epaper ESP32 Driver Board mounted on connection board
- tested with Arduino UNO mounted on connection board, is extremely slow
- doesn't work with Arduino MEGA on connection board with switch set to ICSP and pins bent out of way, reason unknown
- not tested with other processors
- caution: wiring connector is on 5V side of level converters!
  • Loading branch information
ZinggJM committed Feb 12, 2020
1 parent aa576a3 commit 6a33935
Show file tree
Hide file tree
Showing 15 changed files with 11,053 additions and 25 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
### issues:
- please post only issues that are real issues with this library!
- please add all information according to the issue template
- issues are disabled because above rules were not obeyed

### pull requests:
- in general, I will not merge pull request.
- I will not merge pull request. There may be exceptions to this. I may add (modified) fixes.
- pull requests are useful to inform users and me about interesting additions in forked repositories.
- I will close or remove pull request at will.
- enhancements as separate classes are preferred.
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,23 @@
- GDEW075T7 7.5" b/w 800x480
- GDEW075Z09 7.5" b/w/r
- GDEW075Z08 7.5" b/w/r 800x480
- GDEW1248T3 12.48 b/w 1304x984
#### Supported SPI e-paper panels & boards from Waveshare: compare with Good Display, same panel
#### other supported panels
- ED060SCT 6" grey levels, on Waveshare e-Paper IT8951 Driver HAT

### Version 1.2.4
### I can and will only support e-paper panels I have!
- promotion panels from suppliers are welcome, to add support to GxEPD2
- donation panels from users are welcome, to add support to GxEPD2

### Version 1.2.5
- added support for GDEW1248T3 12.84" b/w panel on Waveshare 12.48 e-paper display frame
- tested with Waveshare Epaper ESP32 Driver Board mounted on connection board
- tested with Arduino UNO mounted on connection board, is extremely slow
- doesn't work with Arduino MEGA on connection board with switch set to ICSP and pins bent out of way, reason unknown
- not tested with other processors
- caution: wiring connector is on 5V side of level converters!
#### Version 1.2.4
- added support for GDEH0154D67 1.54" b/w, replacement for GDEP015OC1
- added GxEPD2_SerialFlash_Loader, WiFi bitmap downloader for SPI-flash
- added GxEPD2_SerialFlash_Example, SPI-flash example, e.g. for Winbond 25Q16BVSIG
Expand Down
39 changes: 38 additions & 1 deletion examples/GxEPD2_Example/GxEPD2_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,17 @@
//GxEPD2_3C<GxEPD2_583c, GxEPD2_583c::HEIGHT> display(GxEPD2_583c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
//GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT> display(GxEPD2_750c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
//GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT> display(GxEPD2_750c_Z08(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW075Z08 800x480

// grey levels parallel IF e-papers on Waveshare e-Paper IT8951 Driver HAT
// HRDY -> 4, RST -> 16, CS -> SS(5), SCK -> SCK(18), MOSI -> MOSI(23), MISO -> MISO(19), GND -> GND, 5V -> 5V
// note: 5V supply needs to be exact and strong; 5V over diode from USB (e.g. Wemos D1 mini) doesn't work!
//GxEPD2_BW<GxEPD2_it60, GxEPD2_it60::HEIGHT> display(GxEPD2_it60(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));

// Waveshare 12.48 b/w SPI display board and frame or Good Display 12.48 b/w panel GDEW1248T3
// general constructor for use with all parameters, e.g. for Waveshare ESP32 driver board mounted on connection board
//GxEPD2_BW < GxEPD2_1248, GxEPD2_1248::HEIGHT / 4 >
//display(GxEPD2_1248(/*sck=*/ 13, /*miso=*/ 12, /*mosi=*/ 14, /*cs_m1=*/ 23, /*cs_s1=*/ 22, /*cs_m2=*/ 16, /*cs_s2=*/ 19,
// /*dc1=*/ 25, /*dc2=*/ 17, /*rst1=*/ 33, /*rst2=*/ 5, /*busy_m1=*/ 32, /*busy_s1=*/ 26, /*busy_m2=*/ 18, /*busy_s2=*/ 4));
#endif

#if defined(_BOARD_GENERIC_STM32F103C_H_)
Expand Down Expand Up @@ -180,7 +187,11 @@
#endif

#if defined(__AVR)
#if defined (ARDUINO_AVR_MEGA2560)
#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200
#else
#define MAX_DISPLAY_BUFFER_SIZE 800 //
#endif
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
// select one and adapt to your mapping
//GxEPD2_BW<GxEPD2_154, MAX_HEIGHT(GxEPD2_154)> display(GxEPD2_154(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEP015OC1 no longer available
Expand Down Expand Up @@ -240,6 +251,12 @@
//GxEPD2_3C<GxEPD2_583c, MAX_HEIGHT_3C(GxEPD2_583c)> display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_750c, MAX_HEIGHT_3C(GxEPD2_750c)> display(GxEPD2_750c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_750c_Z08, MAX_HEIGHT_3C(GxEPD2_750c_Z08)> display(GxEPD2_750c_Z08(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW075Z08 800x480

// Waveshare 12.48 b/w SPI display board and frame or Good Display 12.48 b/w panel GDEW1248T3
// general constructor for use with standard SPI pins, default SCK, MISO and MOSI, for UNO on UNO connectors
//GxEPD2_BW < GxEPD2_1248, MAX_HEIGHT(GxEPD2_1248)>
//display(GxEPD2_1248(/*cs_m1=*/ 2, /*cs_s1=*/ 3, /*cs_m2=*/ A4, /*cs_s2=*/ A0, /*dc1=*/ 6, /*dc2=*/ A3, /*rst1=*/ 5, /*rst2=*/ A2,
// /*busy_m1=*/ 4, /*busy_s1=*/ 7, /*busy_m2=*/ A1, /*busy_s2=*/ A5));
#endif

#include "GxEPD2_boards_added.h"
Expand Down Expand Up @@ -271,6 +288,9 @@
#include "bitmaps/Bitmaps3c800x480.h" // 7.5" b/w/r
#include "bitmaps/WS_Bitmaps800x600.h" // 6.0" grey
#endif
#if defined(ESP32)
#include "bitmaps/Bitmaps1304x984.h" // 12.48" b/w
#endif

#else

Expand Down Expand Up @@ -324,6 +344,10 @@ void setup()
//showBox(16, 56, 48, 32, true);
display.powerOff();
deepSleepTest();
#if defined(ESP32) && defined(_GxBitmaps1304x984_H_)
drawBitmaps1304x984();
display.powerOff();
#endif
Serial.println("setup done");
}

Expand Down Expand Up @@ -822,6 +846,9 @@ void drawBitmaps()
#endif
#ifdef _WS_Bitmaps800x600_H_
drawBitmaps800x600();
#endif
#if defined(ESP32) && defined(_GxBitmaps1304x984_H_)
drawBitmaps1304x984();
#endif
// 3-color
#ifdef _GxBitmaps3c104x212_H_
Expand Down Expand Up @@ -1212,7 +1239,7 @@ void drawBitmaps800x480()
}
if (display.epd2.panel == GxEPD2::GDEW075T7)
{
// avoid ghosting caused by OTP waveform
// avoid ghosting caused by OTP waveform
display.clearScreen();
display.refresh(false); // full update
}
Expand Down Expand Up @@ -1240,6 +1267,16 @@ void drawBitmaps800x600()
}
#endif

#if defined(ESP32) && defined(_GxBitmaps1304x984_H_)
void drawBitmaps1304x984()
{
if (display.epd2.panel == GxEPD2::GDEW1248T3)
{
display.drawImage(Bitmap1304x984, 0, 0, display.epd2.WIDTH, display.epd2.HEIGHT, false, false, true);
}
}
#endif

struct bitmap_pair
{
const unsigned char* black;
Expand Down
10 changes: 7 additions & 3 deletions examples/GxEPD2_SD_Example/GxEPD2_SD_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// Version: see library.properties
//
// Library: https://github.com/ZinggJM/GxEPD2
//
// note that BMP bitmaps are drawn at physical position in physical orientation of the screen

// Supporting Arduino Forum Topics:
// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0
Expand Down Expand Up @@ -160,9 +162,11 @@ SdFat SD;
#endif

// function declaration with default parameter
// note that BMP bitmaps are drawn at physical position in physical orientation of the screen
void drawBitmapFromSD(const char *filename, int16_t x, int16_t y, bool with_color = true);

// bitmap drawing using buffered graphics, e.g. for small bitmaps or for GxEPD2_154c
// draws BMP bitmap according to set orientation
// partial_update selects refresh mode (not effective for GxEPD2_154c)
// overwrite = true does not clear buffer before drawing, use only if buffer is full height
void drawBitmapFromSD_Buffered(const char *filename, int16_t x, int16_t y, bool with_color = true, bool partial_update = false, bool overwrite = false);
Expand Down Expand Up @@ -373,7 +377,7 @@ void drawBitmapFromSD(const char *filename, int16_t x, int16_t y, bool with_colo
bool valid = false; // valid format to be handled
bool flip = true; // bitmap is stored bottom-to-top
uint32_t startTime = millis();
if ((x >= display.width()) || (y >= display.height())) return;
if ((x >= display.epd2.WIDTH) || (y >= display.epd2.HEIGHT)) return;
Serial.println();
Serial.print("Loading image '");
Serial.print(filename);
Expand Down Expand Up @@ -424,8 +428,8 @@ void drawBitmapFromSD(const char *filename, int16_t x, int16_t y, bool with_colo
}
uint16_t w = width;
uint16_t h = height;
if ((x + w - 1) >= display.width()) w = display.width() - x;
if ((y + h - 1) >= display.height()) h = display.height() - y;
if ((x + w - 1) >= display.epd2.WIDTH) w = display.epd2.WIDTH - x;
if ((y + h - 1) >= display.epd2.HEIGHT) h = display.epd2.HEIGHT - y;
if (w <= max_row_width) // handle with direct drawing
{
valid = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// this example uses the SerialFlash library from: https://github.com/PaulStoffregen/SerialFlash
// with a modification for use with ESP32 or the STM32 package available here: https://github.com/ZinggJM/SerialFlash
// download it as .zip file and install with Library Mananger method "Add .ZIP Library..."
//
// note that BMP bitmaps are drawn at physical position in physical orientation of the screen

// Supporting Arduino Forum Topics:
// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0
Expand Down Expand Up @@ -49,11 +51,10 @@

#include <SerialFlash.h>

const int FlashChipSelect = D1; // digital pin for flash chip CS pin

#define EPD_CS SS

#if defined (ESP8266)
const int FlashChipSelect = D1; // digital pin for flash chip CS pin
// select one and adapt to your mapping, can use full buffer size (full HEIGHT)
//GxEPD2_BW<GxEPD2_154, GxEPD2_154::HEIGHT> display(GxEPD2_154(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEP015OC1 no longer available
//GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154D67
Expand Down Expand Up @@ -115,6 +116,7 @@ const int FlashChipSelect = D1; // digital pin for flash chip CS pin
#endif

#if defined(ESP32)
const int FlashChipSelect = 17; // as used with my ESP32 breadboard
// select one and adapt to your mapping, can use full buffer size (full HEIGHT)
//GxEPD2_BW<GxEPD2_154, GxEPD2_154::HEIGHT> display(GxEPD2_154(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEP015OC1 no longer available
//GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0154D67
Expand Down Expand Up @@ -143,9 +145,11 @@ const int FlashChipSelect = D1; // digital pin for flash chip CS pin
#endif

// function declaration with default parameter
// note that BMP bitmaps are drawn at physical position in physical orientation of the screen
void drawBitmapFromSerialFlash(const char *filename, int16_t x, int16_t y, bool with_color = true);

// bitmap drawing using buffered graphics, e.g. for small bitmaps or for GxEPD2_154c
// draws BMP bitmap according to set orientation
// partial_update selects refresh mode (not effective for GxEPD2_154c)
// overwrite = true does not clear buffer before drawing, use only if buffer is full height
void drawBitmapFromSerialFlash_Buffered(const char *filename, int16_t x, int16_t y, bool with_color = true, bool partial_update = false, bool overwrite = false);
Expand Down Expand Up @@ -357,7 +361,7 @@ void drawBitmapFromSerialFlash(const char *filename, int16_t x, int16_t y, bool
bool valid = false; // valid format to be handled
bool flip = true; // bitmap is stored bottom-to-top
uint32_t startTime = millis();
if ((x >= display.width()) || (y >= display.height())) return;
if ((x >= display.epd2.WIDTH) || (y >= display.epd2.HEIGHT)) return;
Serial.println();
Serial.print("Loading image '");
Serial.print(filename);
Expand Down Expand Up @@ -400,8 +404,8 @@ void drawBitmapFromSerialFlash(const char *filename, int16_t x, int16_t y, bool
}
uint16_t w = width;
uint16_t h = height;
if ((x + w - 1) >= display.width()) w = display.width() - x;
if ((y + h - 1) >= display.height()) h = display.height() - y;
if ((x + w - 1) >= display.epd2.WIDTH) w = display.epd2.WIDTH - x;
if ((y + h - 1) >= display.epd2.HEIGHT) h = display.epd2.HEIGHT - y;
if (w <= max_row_width) // handle with direct drawing
{
valid = true;
Expand Down
23 changes: 19 additions & 4 deletions examples/GxEPD2_Spiffs_Example/GxEPD2_Spiffs_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// Version: see library.properties
//
// Library: https://github.com/ZinggJM/GxEPD2
//
// note that BMP bitmaps are drawn at physical position in physical orientation of the screen

// Supporting Arduino Forum Topics:
// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0
Expand Down Expand Up @@ -108,12 +110,25 @@
//GxEPD2_3C<GxEPD2_270c, GxEPD2_270c::HEIGHT> display(GxEPD2_270c(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
//GxEPD2_3C<GxEPD2_420c, GxEPD2_420c::HEIGHT> display(GxEPD2_420c(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
//GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT> display(GxEPD2_750c(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));

// grey levels parallel IF e-papers on Waveshare e-Paper IT8951 Driver HAT
// HRDY -> 4, RST -> 16, CS -> SS(5), SCK -> SCK(18), MOSI -> MOSI(23), MISO -> MISO(19), GND -> GND, 5V -> 5V
// note: 5V supply needs to be exact and strong; 5V over diode from USB (e.g. Wemos D1 mini) doesn't work!
//GxEPD2_BW<GxEPD2_it60, GxEPD2_it60::HEIGHT> display(GxEPD2_it60(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));

// Waveshare 12.48 b/w SPI display board and frame or Good Display 12.48 b/w panel GDEW1248T3
// general constructor for use with all parameters, e.g. for Waveshare ESP32 driver board mounted on connection board
//GxEPD2_BW < GxEPD2_1248, GxEPD2_1248::HEIGHT / 4 >
//display(GxEPD2_1248(/*sck=*/ 13, /*miso=*/ 12, /*mosi=*/ 14, /*cs_m1=*/ 23, /*cs_s1=*/ 22, /*cs_m2=*/ 16, /*cs_s2=*/ 19,
// /*dc1=*/ 25, /*dc2=*/ 17, /*rst1=*/ 33, /*rst2=*/ 5, /*busy_m1=*/ 32, /*busy_s1=*/ 26, /*busy_m2=*/ 18, /*busy_s2=*/ 4));
#endif

// function declaration with default parameter
// note that BMP bitmaps are drawn at physical position in physical orientation of the screen
void drawBitmapFromSpiffs(const char *filename, int16_t x, int16_t y, bool with_color = true);

// bitmap drawing using buffered graphics, e.g. for small bitmaps or for GxEPD2_154c
// draws BMP bitmap according to set orientation
// partial_update selects refresh mode (not effective for GxEPD2_154c)
// overwrite = true does not clear buffer before drawing, use only if buffer is full height
void drawBitmapFromSpiffs_Buffered(const char *filename, int16_t x, int16_t y, bool with_color = true, bool partial_update = false, bool overwrite = false);
Expand All @@ -124,7 +139,7 @@ void setup()
Serial.println();
Serial.println("GxEPD2_Spiffs_Example");

display.init();
display.init(115200);

SPIFFS.begin();
Serial.println("SPIFFS started");
Expand Down Expand Up @@ -286,7 +301,7 @@ void drawBitmapFromSpiffs(const char *filename, int16_t x, int16_t y, bool with_
bool valid = false; // valid format to be handled
bool flip = true; // bitmap is stored bottom-to-top
uint32_t startTime = millis();
if ((x >= display.width()) || (y >= display.height())) return;
if ((x >= display.epd2.WIDTH) || (y >= display.epd2.HEIGHT)) return;
Serial.println();
Serial.print("Loading image '");
Serial.print(filename);
Expand Down Expand Up @@ -333,8 +348,8 @@ void drawBitmapFromSpiffs(const char *filename, int16_t x, int16_t y, bool with_
}
uint16_t w = width;
uint16_t h = height;
if ((x + w - 1) >= display.width()) w = display.width() - x;
if ((y + h - 1) >= display.height()) h = display.height() - y;
if ((x + w - 1) >= display.epd2.WIDTH) w = display.epd2.WIDTH - x;
if ((y + h - 1) >= display.epd2.HEIGHT) h = display.epd2.HEIGHT - y;
if (w <= max_row_width) // handle with direct drawing
{
valid = true;
Expand Down
Loading

0 comments on commit 6a33935

Please sign in to comment.