Skip to content

Commit

Permalink
Version for GDEY042T81
Browse files Browse the repository at this point in the history
  • Loading branch information
norbert-walter committed Mar 23, 2024
1 parent 8c73a87 commit 8eb4bab
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 10 deletions.
24 changes: 24 additions & 0 deletions lib/obp60task/OBP60Extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,34 @@
// E-Ink Display
#define GxEPD_WIDTH 400 // Display width
#define GxEPD_HEIGHT 300 // Display height

#ifdef DISPLAY_GDEW042T2
// Set display type and SPI pins for display
GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> display(GxEPD2_420(OBP_SPI_CS, OBP_SPI_DC, OBP_SPI_RST, OBP_SPI_BUSY)); // GDEW042T2 400x300, UC8176 (IL0398)
// Export display in new funktion
GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> & getdisplay(){return display;}
#endif

#ifdef DISPLAY_GDEY042T81
// Set display type and SPI pins for display
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> display(GxEPD2_420_GDEY042T81(OBP_SPI_CS, OBP_SPI_DC, OBP_SPI_RST, OBP_SPI_BUSY)); // GDEW042T2 400x300, UC8176 (IL0398)
// Export display in new funktion
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> & getdisplay(){return display;}
#endif

#ifdef DISPLAY_GYE042A8
// Set display type and SPI pins for display
GxEPD2_BW<GxEPD2_420_GYE042A87, GxEPD2_420_GYE042A87::HEIGHT> display(GxEPD2_420_GYE042A87(OBP_SPI_CS, OBP_SPI_DC, OBP_SPI_RST, OBP_SPI_BUSY)); // GDEW042T2 400x300, UC8176 (IL0398)
// Export display in new funktion
GxEPD2_BW<GxEPD2_420_GYE042A87, GxEPD2_420_GYE042A87::HEIGHT> & getdisplay(){return display;}
#endif

#ifdef DISPLAY_SE0420NQ04
// Set display type and SPI pins for display
GxEPD2_BW<GxEPD2_420_SE0420NQ04, GxEPD2_420_SE0420NQ04::HEIGHT> display(GxEPD2_420_SE0420NQ04(OBP_SPI_CS, OBP_SPI_DC, OBP_SPI_RST, OBP_SPI_BUSY)); // GDEW042T2 400x300, UC8176 (IL0398)
// Export display in new funktion
GxEPD2_BW<GxEPD2_420_SE0420NQ04, GxEPD2_420_SE0420NQ04::HEIGHT> & getdisplay(){return display;}
#endif

// Horter I2C moduls
PCF8574 pcf8574_Out(PCF8574_I2C_ADDR1); // First digital output modul PCF8574 from Horter
Expand Down
14 changes: 14 additions & 0 deletions lib/obp60task/OBP60Extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,21 @@ extern const GFXfont DSEG7Classic_BoldItalic42pt7b;
extern const GFXfont DSEG7Classic_BoldItalic60pt7b;

// Gloabl functions
#ifdef DISPLAY_GDEW042T2
GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> & getdisplay();
#endif

#ifdef DISPLAY_GDEY042T81
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> & getdisplay();
#endif

#ifdef DISPLAY_GYE042A8
GxEPD2_BW<GxEPD2_420_GYE042A87, GxEPD2_420_GYE042A87::HEIGHT> & getdisplay();
#endif

#ifdef DISPLAY_SE0420NQ04
GxEPD2_BW<GxEPD2_420_SE0420NQ04, GxEPD2_420_SE0420NQ04::HEIGHT> & getdisplay();
#endif

void hardwareInit();

Expand Down
25 changes: 17 additions & 8 deletions lib/obp60task/obp60task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ void OBP60Task(GwApi *api){
int pixelcolor = GxEPD_BLACK;
int bgcolor = GxEPD_WHITE;

getdisplay().init(115200, true, 2, false); // Use this for Waveshare boards with "clever" reset circuit, 2ms reset pulse
getdisplay().init(115200); // Init for nolrmal displays
// getdisplay().init(115200, true, 2, false); // Use this for Waveshare boards with "clever" reset circuit, 2ms reset pulse
getdisplay().setRotation(0); // Set display orientation (horizontal)
if(displaycolor == "Normal"){
textcolor = GxEPD_BLACK;
Expand All @@ -262,18 +263,26 @@ void OBP60Task(GwApi *api){
getdisplay().fillScreen(bgcolor); // Draw white sreen
getdisplay().setTextColor(textcolor); // Set display color
getdisplay().nextPage(); // Full Refresh

getdisplay().setPartialWindow(0, 0, getdisplay().width(), getdisplay().height()); // Set partial update
getdisplay().fillScreen(bgcolor); // Draw white sreen
getdisplay().nextPage(); // Fast Refresh
getdisplay().nextPage(); // Fast Refresh
if(String(displaymode) == "Logo + QR Code" || String(displaymode) == "Logo"){
getdisplay().fillScreen(bgcolor); // Draw white sreen
getdisplay().drawBitmap(0, 0, gImage_Logo_OBP_400x300_sw, getdisplay().width(), getdisplay().height(), pixelcolor); // Draw start logo
getdisplay().nextPage(); // Full Refresh
delay(SHOW_TIME); // Logo show time
getdisplay().nextPage(); // Full Refresh
getdisplay().nextPage(); // Fast Refresh
getdisplay().nextPage(); // Fast Refresh
delay(SHOW_TIME); // Logo show time
if(String(displaymode) == "Logo + QR Code"){
qrWiFi(systemname, wifipass, displaycolor); // Show QR code for WiFi connection
delay(SHOW_TIME); // QR code show time
getdisplay().fillScreen(bgcolor); // Draw white sreen
getdisplay().nextPage(); // Full Refresh
qrWiFi(systemname, wifipass, displaycolor); // Show QR code for WiFi connection
getdisplay().nextPage(); // Fast Refresh
getdisplay().nextPage(); // Fast Refresh
delay(SHOW_TIME); // QR code show time
}
getdisplay().fillScreen(bgcolor); // Draw white sreen
getdisplay().nextPage(); // Fast Refresh
getdisplay().nextPage(); // Fast Refresh
}

// Init pages
Expand Down
4 changes: 2 additions & 2 deletions lib/obp60task/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ lib_deps =
build_flags=
-DTIME=$UNIX_TIME
-D BOARD_OBP60S3
-D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm
# -D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm
# -D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm
-D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm
# -D DISPLAY_GYE042A8 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm
# -D DISPLAY_SE0420NQ04 #alternativ E-Ink display from SID Technology, R10 2.2 ohm
${env.build_flags}
Expand Down

0 comments on commit 8eb4bab

Please sign in to comment.