diff --git a/src/displays.c b/src/displays.c index ffc053af..57355ba5 100644 --- a/src/displays.c +++ b/src/displays.c @@ -5,6 +5,7 @@ const EpdDisplay_t ED060SCT = { .height = 600, .bus_width = 8, .bus_speed = 20, + .mirror_vertically = false, .default_waveform = &epdiy_ED060SCT, .display_type = DISPLAY_TYPE_GENERIC, }; @@ -14,6 +15,7 @@ const EpdDisplay_t ED060XC3 = { .height = 768, .bus_width = 8, .bus_speed = 20, + .mirror_vertically = false, .default_waveform = &epdiy_ED060XC3, .display_type = DISPLAY_TYPE_GENERIC, }; @@ -23,6 +25,7 @@ const EpdDisplay_t ED097OC4 = { .height = 825, .bus_width = 8, .bus_speed = 15, + .mirror_vertically = false, .default_waveform = &epdiy_ED097OC4, .display_type = DISPLAY_TYPE_GENERIC, }; @@ -32,6 +35,7 @@ const EpdDisplay_t ED097TC2 = { .height = 825, .bus_width = 8, .bus_speed = 22, + .mirror_vertically = false, .default_waveform = &epdiy_ED097TC2, .display_type = DISPLAY_TYPE_ED097TC2, }; @@ -41,6 +45,7 @@ const EpdDisplay_t ED133UT2 = { .height = 1200, .bus_width = 8, .bus_speed = 20, + .mirror_vertically = false, .default_waveform = &epdiy_ED097TC2, .display_type = DISPLAY_TYPE_ED097TC2, }; @@ -50,6 +55,7 @@ const EpdDisplay_t ED047TC1 = { .height = 540, .bus_width = 8, .bus_speed = 20, + .mirror_vertically = false, .default_waveform = &epdiy_ED047TC1, .display_type = DISPLAY_TYPE_GENERIC, }; @@ -59,6 +65,7 @@ const EpdDisplay_t ED047TC2 = { .height = 540, .bus_width = 8, .bus_speed = 20, + .mirror_vertically = false, .default_waveform = &epdiy_ED047TC2, .display_type = DISPLAY_TYPE_GENERIC, }; @@ -68,6 +75,17 @@ const EpdDisplay_t ED078KC1 = { .height = 1404, .bus_width = 16, .bus_speed = 11, + .mirror_vertically = false, + .default_waveform = &epdiy_ED047TC2, + .display_type = DISPLAY_TYPE_GENERIC, +}; + +const EpdDisplay_t ED068TG1 = { + .width = 1440, + .height = 1080, + .bus_width = 16, + .bus_speed = 11, + .mirror_vertically = true, .default_waveform = &epdiy_ED047TC2, .display_type = DISPLAY_TYPE_GENERIC, }; diff --git a/src/epd_display.h b/src/epd_display.h index 76566551..68016b0b 100644 --- a/src/epd_display.h +++ b/src/epd_display.h @@ -26,6 +26,9 @@ typedef struct { /// (Only used by the LCD based renderer in V7+) int bus_speed; + /// Changes behaviour of draw functions if the display draws bottom to top + bool mirror_vertically; + /// Default waveform to use. const EpdWaveform* default_waveform; /// Display type @@ -39,4 +42,5 @@ extern const EpdDisplay_t ED097TC2; extern const EpdDisplay_t ED133UT2; extern const EpdDisplay_t ED047TC1; extern const EpdDisplay_t ED047TC2; +extern const EpdDisplay_t ED068TG1; extern const EpdDisplay_t ED078KC1; diff --git a/src/epdiy.c b/src/epdiy.c index 9735df15..be92818a 100644 --- a/src/epdiy.c +++ b/src/epdiy.c @@ -69,6 +69,9 @@ Coord_xy _rotate(uint16_t x, uint16_t y) { y = epd_height() - y - 1; break; } + if (epd_get_display()->mirror_vertically) { + y = epd_height() - y - 1; + } Coord_xy coord = { x, y }; return coord; }