From e61f0ae4248bdafeace54c330d488904a495c045 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sun, 8 Jul 2018 13:51:20 +1000 Subject: [PATCH] Added type gOrientation to replace V2.x orientation_t, and values gOrientationX replace GDISP_ROTATE_X --- changelog.txt | 21 ++--- demos/applications/combo/gfxconf.h | 2 +- demos/benchmarks/main.c | 2 +- demos/games/tetris/gfxconf.h | 2 +- demos/modules/gwin/button/main.c | 4 +- demos/modules/gwin/frame/gfxconf.h | 2 +- demos/modules/gwin/imagebox/gfxconf.h | 2 +- demos/modules/gwin/keyboard/gfxconf.h | 2 +- demos/modules/gwin/widgets/gfxconf.h | 2 +- .../gdisp_lld_alteraframereader.c | 36 ++++---- drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c | 24 ++--- drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c | 36 ++++---- drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c | 16 ++-- drivers/gdisp/ILI9225/gdisp_lld_ili9225.c | 40 ++++----- drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c | 32 +++---- drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c | 32 +++---- drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c | 16 ++-- drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c | 16 ++-- drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c | 32 +++---- drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c | 16 ++-- drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c | 16 ++-- drivers/gdisp/KS0108/gdisp_lld_KS0108.c | 16 ++-- drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c | 32 +++---- .../Nokia6610GE12/gdisp_lld_Nokia6610GE12.c | 16 ++-- .../Nokia6610GE8/gdisp_lld_Nokia6610GE8.c | 40 ++++----- drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c | 36 ++++---- drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c | 36 ++++---- drivers/gdisp/QImage/gdisp_lld_driver.c | 2 +- drivers/gdisp/R61505U/gdisp_lld_R61505U.c | 32 +++---- drivers/gdisp/RA6963/gdisp_lld_RA6963.c | 16 ++-- drivers/gdisp/RA8875/gdisp_lld_RA8875.c | 16 ++-- drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c | 32 +++---- .../gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c | 18 ++-- drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c | 32 +++---- drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | 40 ++++----- drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c | 32 +++---- drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c | 16 ++-- drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c | 16 ++-- drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c | 40 ++++----- drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c | 24 ++--- drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c | 32 +++---- drivers/gdisp/ST7565/gdisp_lld_ST7565.c | 32 +++---- drivers/gdisp/ST7735/gdisp_lld_ST7735.c | 16 ++-- drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c | 48 +++++----- drivers/gdisp/STM32LTDC/gdisp_lld_config.h | 2 +- drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c | 36 ++++---- drivers/gdisp/TestStub/gdisp_lld_TestStub.c | 2 +- drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c | 36 ++++---- drivers/gdisp/UC1610/gdisp_lld_UC1610.c | 20 ++--- drivers/gdisp/UC8173/gdisp_lld_UC8173.c | 10 +-- drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c | 40 ++++----- .../gdisp/framebuffer/gdisp_lld_framebuffer.c | 36 ++++---- .../ginput/touch/FT5x06/gmouse_lld_FT5x06.c | 8 +- .../ginput/touch/FT6x06/gmouse_lld_FT6x06.c | 8 +- .../touch/STMPE610/gmouse_lld_STMPE610.c | 8 +- .../touch/STMPE811/gmouse_lld_STMPE811.c | 8 +- drivers/multiple/SDL/gdisp_lld_SDL.c | 2 +- drivers/multiple/Win32/gdisp_lld_Win32.c | 88 +++++++++--------- drivers/multiple/X/gdisp_lld_X.c | 2 +- drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c | 16 ++-- .../gdisp_lld_uGFXnetESP8266.cpp | 16 ++-- gfxconf.example.h | 2 +- src/gdisp/gdisp.c | 12 +-- src/gdisp/gdisp.h | 89 ++++++++++--------- src/gdisp/gdisp_driver.h | 2 +- src/gdisp/gdisp_options.h | 2 +- src/gdisp/gdisp_pixmap.c | 36 ++++---- src/ginput/ginput_mouse.c | 30 +++---- 68 files changed, 745 insertions(+), 737 deletions(-) diff --git a/changelog.txt b/changelog.txt index 77606947..9586ff90 100644 --- a/changelog.txt +++ b/changelog.txt @@ -14,20 +14,21 @@ FEATURE: Added GFX_COMPAT_V2 to maintain source compatibility with V2.x programs FEATURE: Added GFX_COMPAT_OLDCOLORS to allow V2.x Red, Green, Blue color names. It is turned on by default. CHANGE: Added GFX_RED, GFX_BLUE, GFX_GREEN etc to replace V2.x Red, Gree, Blue color names CHANGE: Added GFXON/GFXOFF to replace V2.x TRUE/FALSE for configuration options. -CHANGE: Added gBool type and gTrue/gFalse to replace TRUE/FALSE for booleans. CHANGE: Added types gI8, gU8 .. gI32, gU32 to replace V2.x int8_t etc +CHANGE: Added type gBool to replace V2.x bool_t, and values gTrue/gFalse to replace TRUE/FALSE +CHANGE: Added type gPoint to replace V2.x point and point_t +CHANGE: Added type gCoord to replace V2.x coord_t +CHANGE: Added type gPixel to replace V2.x pixel_t +CHANGE: Added type gColor to replace V2.x color_t +CHANGE: Added type gFont to replace V2.x font_t +CHANGE: Added type gPowermode to replace V2.x powermode_t, and values gPowerXXX replace powerXXX +CHANGE: Added type gJustify to replace V2.x justify_t, and values gJustifyXXX replace justifyXXX +CHANGE: Added type gFontmetric to replace V2.x fontmetric_t, and values gFontXXX replace fontXXX +CHANGE: Added type gOrientation to replace V2.x orientation_t, and values gOrientationX replace GDISP_ROTATE_X +CHANGE: Added macros JUSTIFYMASK_HORIZONTAL, JUSTIFYMASK_VERTICAL to replace macros JUSTIFYMASK_LEFTRIGHT, JUSTIFYMASK_TOPBOTTOM FEATURE: Added types gPtr and gPtrDiff FEATURE: Added gI64 and gU64 when the compiler supports it. GFX_TYPE_64 macro is defined as GFXON if it does. FEATURE: Fixed headers to ensure size_t, NULL are always defined. size_t is not used as it may be 64bit. -CHANGE: Added type gPoint to replace V2.x point and point_t -CHANGE: Added type gCoord to replace V2.x coord_t -CHANGE: Added type gPixel to replace V2.x pixel_t -CHANGE: Added type gColor to replace V2.x color_t -CHANGE: Added type gFont to replace V2.x font_t -CHANGE: Added type gPowermode to replace V2.x powermode_t, and values gPowerXXX replace powerXXX -CHANGE: Added type gJustify to replace V2.x justify_t, and values gJustifyXXX replace justifyXXX -CHANGE: Added type gFontmetric to replace V2.x fontmetric_t, and values gFontXXX replace fontXXX -CHANGE: Added macros JUSTIFYMASK_HORIZONTAL, JUSTIFYMASK_VERTICAL to replace macros JUSTIFYMASK_LEFTRIGHT, JUSTIFYMASK_TOPBOTTOM FIX: Added gfxRealloc() to Qt port FIX: Fixed UC1610 driver private area initialisation FIX: Fixed ST7735 driver and added kapacuk changes diff --git a/demos/applications/combo/gfxconf.h b/demos/applications/combo/gfxconf.h index cf218206..801a76f5 100644 --- a/demos/applications/combo/gfxconf.h +++ b/demos/applications/combo/gfxconf.h @@ -44,7 +44,7 @@ #define GDISP_NEED_IMAGE_BMP GFXON #define GDISP_NEED_IMAGE_GIF GFXON -#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE +#define GDISP_DEFAULT_ORIENTATION gOrientationLandscape #define GDISP_NEED_MULTITHREAD GFXON /////////////////////////////////////////////////////////////////////////// diff --git a/demos/benchmarks/main.c b/demos/benchmarks/main.c index 43af099e..fa7f0b9a 100644 --- a/demos/benchmarks/main.c +++ b/demos/benchmarks/main.c @@ -92,7 +92,7 @@ void benchmark(void) { gColor random_color; gFont font; - gdispSetOrientation(GDISP_ROTATE_90); + gdispSetOrientation(gOrientation90); width = gdispGetWidth(); height = gdispGetHeight(); diff --git a/demos/games/tetris/gfxconf.h b/demos/games/tetris/gfxconf.h index 72df36c7..779c1138 100644 --- a/demos/games/tetris/gfxconf.h +++ b/demos/games/tetris/gfxconf.h @@ -53,7 +53,7 @@ /* Comment these out if it conflicts with your hardware */ #define GDISP_NEED_CONTROL GFXON -#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_PORTRAIT +#define GDISP_DEFAULT_ORIENTATION gOrientationPortrait #define GDISP_SCREEN_WIDTH 240 #define GDISP_SCREEN_HEIGHT 320 diff --git a/demos/modules/gwin/button/main.c b/demos/modules/gwin/button/main.c index 6e766e74..ab70d1a0 100644 --- a/demos/modules/gwin/button/main.c +++ b/demos/modules/gwin/button/main.c @@ -52,13 +52,13 @@ static void createWidgets(void) { int main(void) { GEvent* pe; - static const orientation_t orients[] = { GDISP_ROTATE_0, GDISP_ROTATE_90, GDISP_ROTATE_180, GDISP_ROTATE_270 }; + static const gOrientation orients[] = { gOrientation0, gOrientation90, gOrientation180, gOrientation270 }; unsigned which; // Initialize the display gfxInit(); - // We are currently at GDISP_ROTATE_0 + // We are currently at gOrientation0 which = 0; gdispSetOrientation(orients[which]); diff --git a/demos/modules/gwin/frame/gfxconf.h b/demos/modules/gwin/frame/gfxconf.h index 853bcd76..5cd2d760 100644 --- a/demos/modules/gwin/frame/gfxconf.h +++ b/demos/modules/gwin/frame/gfxconf.h @@ -39,7 +39,7 @@ #define GDISP_INCLUDE_FONT_UI2 GFXON #define GDISP_NEED_MULTITHREAD GFXON -#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE +#define GDISP_DEFAULT_ORIENTATION gOrientationLandscape /////////////////////////////////////////////////////////////////////////// // GWIN // diff --git a/demos/modules/gwin/imagebox/gfxconf.h b/demos/modules/gwin/imagebox/gfxconf.h index e186e140..ec1b1bef 100644 --- a/demos/modules/gwin/imagebox/gfxconf.h +++ b/demos/modules/gwin/imagebox/gfxconf.h @@ -43,7 +43,7 @@ #define GDISP_NEED_IMAGE_BMP GFXON #define GDISP_NEED_IMAGE_BMP_24 GFXON -#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE +#define GDISP_DEFAULT_ORIENTATION gOrientationLandscape /////////////////////////////////////////////////////////////////////////// // GWIN // diff --git a/demos/modules/gwin/keyboard/gfxconf.h b/demos/modules/gwin/keyboard/gfxconf.h index 79d443dc..48272724 100644 --- a/demos/modules/gwin/keyboard/gfxconf.h +++ b/demos/modules/gwin/keyboard/gfxconf.h @@ -33,7 +33,7 @@ #define GDISP_INCLUDE_FONT_UI2 GFXON //#define GDISP_NEED_CONTROL GFXON -//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE +//#define GDISP_DEFAULT_ORIENTATION gOrientationLandscape #define GDISP_NEED_MULTITHREAD GFXON #define GFX_USE_GWIN GFXON diff --git a/demos/modules/gwin/widgets/gfxconf.h b/demos/modules/gwin/widgets/gfxconf.h index 79ef8795..6db15d67 100644 --- a/demos/modules/gwin/widgets/gfxconf.h +++ b/demos/modules/gwin/widgets/gfxconf.h @@ -42,7 +42,7 @@ #define GDISP_NEED_IMAGE GFXON #define GDISP_NEED_IMAGE_GIF GFXON -#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE +#define GDISP_DEFAULT_ORIENTATION gOrientationLandscape #define GDISP_NEED_MULTITHREAD GFXON /////////////////////////////////////////////////////////////////////////// diff --git a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c index 57856ee8..d9d32742 100644 --- a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c +++ b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c @@ -60,7 +60,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) g->g.Height = SCREEN_HEIGHT; g->g.Backlight = 100; g->g.Contrast = 50; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->board = 0; PRIV(g)->linelen = g->g.Width * sizeof(LLDCOLOR_TYPE); // bytes per line @@ -103,17 +103,17 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g) #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -131,17 +131,17 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -171,12 +171,12 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -184,9 +184,9 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -197,7 +197,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c index 0e2e7599..a77445ba 100644 --- a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c +++ b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c @@ -448,7 +448,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = 100; g->g.Contrast = 100; @@ -489,25 +489,25 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: bx = g->p.x / EINK_BLOCKWIDTH; dx = g->p.x % EINK_BLOCKWIDTH; by = g->p.y / EINK_BLOCKHEIGHT; dy = g->p.y % EINK_BLOCKHEIGHT; break; - case GDISP_ROTATE_90: + case gOrientation90: bx = g->p.y / EINK_BLOCKWIDTH; dx = g->p.y % EINK_BLOCKWIDTH; by = (GDISP_SCREEN_HEIGHT-1 - g->p.x) / EINK_BLOCKHEIGHT; dy = (GDISP_SCREEN_HEIGHT-1 - g->p.x) % EINK_BLOCKHEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: bx = (GDISP_SCREEN_WIDTH-1 - g->p.x) / EINK_BLOCKWIDTH; dx = (GDISP_SCREEN_WIDTH-1 - g->p.x) % EINK_BLOCKWIDTH; by = (GDISP_SCREEN_HEIGHT-1 - g->p.y) / EINK_BLOCKHEIGHT; dy = (GDISP_SCREEN_HEIGHT-1 - g->p.y) % EINK_BLOCKHEIGHT; break; - case GDISP_ROTATE_270: + case gOrientation270: bx = (GDISP_SCREEN_WIDTH-1 - g->p.y) / EINK_BLOCKWIDTH; dx = (GDISP_SCREEN_WIDTH-1 - g->p.y) % EINK_BLOCKWIDTH; by = g->p.x / EINK_BLOCKHEIGHT; @@ -551,23 +551,23 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; default: diff --git a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c index 6aed9809..db6154b7 100644 --- a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c +++ b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c @@ -48,7 +48,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { ((fbPriv *)g->priv)->fbi.linelen = 0; // Initialize the GDISP structure - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->board = 0; // preinitialize board_init(g, &((fbPriv *)g->priv)->fbi); @@ -68,17 +68,17 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -105,17 +105,17 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -149,12 +149,12 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -162,9 +162,9 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -175,7 +175,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c index 14aa981b..b64c05a8 100644 --- a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c +++ b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c @@ -148,7 +148,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -174,10 +174,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_control(GDisplay *g) { switch(g->p.x) { case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, HX8347D_REG_MAC, 0x08); /* Memory access control */ release_bus(g); @@ -185,7 +185,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, HX8347D_REG_MAC, 0x68); /* Memory access control */ release_bus(g); @@ -193,7 +193,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, HX8347D_REG_MAC, 0xc8); /* Memory access control */ release_bus(g); @@ -201,7 +201,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, HX8347D_REG_MAC, 0xa8); /* Memory access control */ release_bus(g); @@ -212,7 +212,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c b/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c index 57b2a680..d1e71689 100644 --- a/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c +++ b/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c @@ -132,7 +132,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -142,14 +142,14 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { static void set_cursor(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, ILI9225_RAM_ADDR_SET1, g->p.x); write_reg(g, ILI9225_RAM_ADDR_SET2, g->p.y); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, ILI9225_RAM_ADDR_SET1, g->p.y); write_reg(g, ILI9225_RAM_ADDR_SET2, g->p.x); break; @@ -160,16 +160,16 @@ static void set_cursor(GDisplay *g) { static void set_viewport(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, ILI9225_HORIZONTAL_WINDOW_ADDR2, g->p.x); write_reg(g, ILI9225_HORIZONTAL_WINDOW_ADDR1, g->p.x + g->p.cx - 1); write_reg(g, ILI9225_VERTICAL_WINDOW_ADDR2, g->p.y); write_reg(g, ILI9225_VERTICAL_WINDOW_ADDR1, g->p.y + g->p.cy - 1); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, ILI9225_HORIZONTAL_WINDOW_ADDR2, g->p.y); write_reg(g, ILI9225_HORIZONTAL_WINDOW_ADDR1, g->p.y + g->p.cy - 1); write_reg(g, ILI9225_VERTICAL_WINDOW_ADDR2, g->p.x); @@ -190,12 +190,12 @@ LLDSPEC void gdisp_lld_write_start(GDisplay *g) { // save viewport switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: svx = g->p.x; svy = g->p.y; svcx = g->p.cx; svcy = g->p.cy; break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: svx = g->p.y; svy = g->p.x; svcx = g->p.cy; svcy = g->p.cx; break; } @@ -327,10 +327,10 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: // correct + switch((gOrientation)g->p.ptr) { + case gOrientation0: // correct acquire_bus(g); write_reg(g, ILI9225_DRIVER_OUTPUT_CTRL, 0x011C); write_reg(g, ILI9225_ENTRY_MODE, 0x1030); @@ -338,7 +338,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; release_bus(g); break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, ILI9225_DRIVER_OUTPUT_CTRL, 0x031C); write_reg(g, ILI9225_ENTRY_MODE, 0x1038); @@ -346,7 +346,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; release_bus(g); break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, ILI9225_DRIVER_OUTPUT_CTRL, 0x021C); write_reg(g, ILI9225_ENTRY_MODE, 0x1030); @@ -354,7 +354,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; release_bus(g); break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, ILI9225_DRIVER_OUTPUT_CTRL, 0x001C); write_reg(g, ILI9225_ENTRY_MODE, 0x1038); @@ -365,7 +365,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: if ((unsigned)g->p.ptr > 100) diff --git a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c index 96b12cfd..36bfa5b1 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c +++ b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c @@ -57,14 +57,14 @@ static void set_cursor(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x20, g->p.x); write_reg(g, 0x21, g->p.y); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x20, g->p.y); write_reg(g, 0x21, g->p.x); break; @@ -75,16 +75,16 @@ static void set_cursor(GDisplay *g) { static void set_viewport(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x50, g->p.x); write_reg(g, 0x51, g->p.x + g->p.cx - 1); write_reg(g, 0x52, g->p.y); write_reg(g, 0x53, g->p.y + g->p.cy - 1); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x50, g->p.y); write_reg(g, 0x51, g->p.y + g->p.cy - 1); write_reg(g, 0x52, g->p.x); @@ -186,7 +186,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -310,10 +310,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1038); @@ -324,7 +324,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1030); @@ -335,7 +335,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1030); @@ -346,7 +346,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1038); @@ -360,7 +360,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c index 37b25d4d..094870ac 100644 --- a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c +++ b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c @@ -58,14 +58,14 @@ static void set_cursor(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x20, g->p.x); write_reg(g, 0x21, g->p.y); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x20, g->p.y); write_reg(g, 0x21, g->p.x); break; @@ -76,16 +76,16 @@ static void set_cursor(GDisplay *g) { static void set_viewport(GDisplay* g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x50, g->p.x); write_reg(g, 0x51, g->p.x + g->p.cx - 1); write_reg(g, 0x52, g->p.y); write_reg(g, 0x53, g->p.y + g->p.cy - 1); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x50, g->p.y); write_reg(g, 0x51, g->p.y + g->p.cy - 1); write_reg(g, 0x52, g->p.x); @@ -184,7 +184,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -300,10 +300,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1038); @@ -313,7 +313,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1030); @@ -323,7 +323,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1038); @@ -333,7 +333,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1030); @@ -347,7 +347,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c index 1ba14608..4062fe7d 100644 --- a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c +++ b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c @@ -227,7 +227,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -294,31 +294,31 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, 0x36, 0x48); /* X and Y axes non-inverted */ release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, 0x36, 0xE8); /* Invert X and Y axes */ release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, 0x36, 0x88); /* X and Y axes non-inverted */ release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, 0x36, 0x28); /* Invert X and Y axes */ release_bus(g); @@ -328,7 +328,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c index c493e17d..56703570 100644 --- a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c +++ b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c @@ -231,7 +231,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -298,31 +298,31 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, 0x36, 0x08); release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, 0x36, 0x68); release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, 0x36, 0xC8); release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, 0x36, 0xA8); release_bus(g); @@ -332,7 +332,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c index bda49d60..c50015b9 100644 --- a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c +++ b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c @@ -63,14 +63,14 @@ static GFXINLINE uint16_t read_reg(GDisplay *g, uint32_t reg) { static void set_cursor(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x20, g->p.x); write_reg(g, 0x21, g->p.y); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x20, g->p.y); write_reg(g, 0x21, g->p.x); break; @@ -81,16 +81,16 @@ static void set_cursor(GDisplay *g) { static void set_viewport(GDisplay* g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x50, g->p.x); write_reg(g, 0x51, g->p.x + g->p.cx - 1); write_reg(g, 0x52, g->p.y); write_reg(g, 0x53, g->p.y + g->p.cy - 1); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x50, g->p.y); write_reg(g, 0x51, g->p.y + g->p.cy - 1); write_reg(g, 0x52, g->p.x); @@ -256,7 +256,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -373,10 +373,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1030); @@ -386,7 +386,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1038); @@ -396,7 +396,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1030); @@ -406,7 +406,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1038); @@ -420,7 +420,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c index 57465aac..79b5b743 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c +++ b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c @@ -193,7 +193,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -263,10 +263,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, 0xC0, 0x03); @@ -276,7 +276,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, 0xC0, 0x02); @@ -286,7 +286,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, 0xC0, 0x06); @@ -296,7 +296,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, 0xC0, 0x07); @@ -309,7 +309,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; //case GDISP_CONTROL_BACKLIGHT: //case GDISP_CONTROL_CONTRAST: diff --git a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c index e32ab556..e176e52d 100644 --- a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c +++ b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c @@ -189,7 +189,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Initialise the GDISP structure g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -275,11 +275,11 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_index(g, 0x36); @@ -290,7 +290,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_index(g, 0x36); @@ -301,7 +301,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_index(g, 0x36); @@ -312,7 +312,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_index(g, 0x36); @@ -327,7 +327,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; default: diff --git a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c index 35726d85..8d6a004f 100644 --- a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c +++ b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c @@ -134,7 +134,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Initialise the GDISP structure g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -263,11 +263,11 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_index(g, 0x36); @@ -278,7 +278,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_index(g, 0x36); @@ -289,7 +289,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_index(g, 0x36); @@ -300,7 +300,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_index(g, 0x36); @@ -315,7 +315,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; default: diff --git a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c index d94708e6..5683a847 100644 --- a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c +++ b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c @@ -58,14 +58,14 @@ static void set_cursor(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x20, g->p.x); write_reg(g, 0x21, g->p.y); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x20, g->p.y); write_reg(g, 0x21, g->p.x); break; @@ -76,16 +76,16 @@ static void set_cursor(GDisplay *g) { static void set_viewport(GDisplay* g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x50, g->p.x); write_reg(g, 0x51, g->p.x + g->p.cx - 1); write_reg(g, 0x52, g->p.y); write_reg(g, 0x53, g->p.y + g->p.cy - 1); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x50, g->p.y); write_reg(g, 0x51, g->p.y + g->p.cy - 1); write_reg(g, 0x52, g->p.x); @@ -178,7 +178,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -294,10 +294,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1030); @@ -307,7 +307,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1038); @@ -317,7 +317,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1030); @@ -327,7 +327,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1038); @@ -341,7 +341,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c index 38cec2be..f76077b3 100644 --- a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c +++ b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c @@ -125,7 +125,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure to match */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -202,31 +202,31 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, MADCTL, 0x00); release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, MADCTL, 0xA0); // MY, MX, V, LAO, RGB, X, X, X release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, MADCTL, 0xC0); release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, MADCTL, 0x60); release_bus(g); @@ -236,7 +236,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index 977ad10a..b37b9a53 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -134,19 +134,19 @@ #if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set break; - case GDISP_ROTATE_90: + case gOrientation90: write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y); write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); break; - case GDISP_ROTATE_180: + case gOrientation180: write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); break; - case GDISP_ROTATE_270: + case gOrientation270: write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x); break; @@ -163,19 +163,19 @@ static GFXINLINE void set_viewport(GDisplay* g) { #if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x+g->p.cx-1); // Column address set write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y+g->p.cy-1); // Page address set break; - case GDISP_ROTATE_90: + case gOrientation90: write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y+g->p.cy-1); write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->g.Width-g->p.x-g->p.cx, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); break; - case GDISP_ROTATE_180: + case gOrientation180: write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->g.Width-g->p.x-g->p.cx, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->g.Height-g->p.y-g->p.cy, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); break; - case GDISP_ROTATE_270: + case gOrientation270: write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->g.Height-g->p.y-g->p.cy, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x+g->p.cx-1); break; @@ -239,7 +239,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { set_backlight(g, GDISP_INITIAL_BACKLIGHT); /* Initialise the GDISP structure to match */ - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -373,10 +373,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { */ switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: x = 0; y = 0; break; - case GDISP_ROTATE_90: x = g->p.cx-1; y = 0; break; - case GDISP_ROTATE_180: x = g->p.cx-1; y = g->p.cy-1; break; - case GDISP_ROTATE_270: x = 0; y = g->p.cy-1; break; + case gOrientation0: x = 0; y = 0; break; + case gOrientation90: x = g->p.cx-1; y = 0; break; + case gOrientation180: x = g->p.cx-1; y = g->p.cy-1; break; + case gOrientation270: x = 0; y = g->p.cy-1; break; } #if !GDISP_PACKED_PIXELS @@ -543,26 +543,26 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; #if GDISP_NOKIA_ORIENTATION case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; acquire_bus(g); - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: write_cmd3(g, DATCTL, 0x00, 0x00, 0x02); // P1: page normal, column normal, scan in column direction g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: write_cmd3(g, DATCTL, 0x05, 0x00, 0x02); // P1: page reverse, column normal, scan in page direction g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: write_cmd3(g, DATCTL, 0x03, 0x00, 0x02); // P1: page reverse, column reverse, scan in column direction g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: write_cmd3(g, DATCTL, 0x06, 0x00, 0x02); // P1: page normal, column reverse, scan in page direction g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; @@ -572,7 +572,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; } release_bus(g); - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; #endif case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c index f05d7186..a81782db 100644 --- a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c +++ b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c @@ -86,7 +86,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -122,19 +122,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = g->g.Width - g->p.x - 1; break; - case GDISP_ROTATE_180: + case gOrientation180: x = g->g.Width - g->p.x - 1; y = g->g.Height - g->p.y - 1; break; - case GDISP_ROTATE_270: + case gOrientation270: x = g->g.Height - g->p.y - 1; y = g->p.x; break; @@ -160,19 +160,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_WIDTH-1 - g->p.y; y = g->p.x; break; @@ -203,12 +203,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -216,9 +216,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -229,7 +229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c index ca2a16eb..bc8c14d6 100644 --- a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c +++ b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c @@ -96,7 +96,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -132,19 +132,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = g->g.Width - g->p.x - 1; break; - case GDISP_ROTATE_180: + case gOrientation180: x = g->g.Width - g->p.x - 1; y = g->g.Height - g->p.y - 1; break; - case GDISP_ROTATE_270: + case gOrientation270: x = g->g.Height - g->p.y - 1; y = g->p.x; break; @@ -170,19 +170,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_WIDTH-1 - g->p.y; y = g->p.x; break; @@ -213,12 +213,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -226,9 +226,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -239,7 +239,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/QImage/gdisp_lld_driver.c b/drivers/gdisp/QImage/gdisp_lld_driver.c index c42bfbcd..3c8d71d0 100644 --- a/drivers/gdisp/QImage/gdisp_lld_driver.c +++ b/drivers/gdisp/QImage/gdisp_lld_driver.c @@ -39,7 +39,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; diff --git a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c index 1e18e1cd..c5b10d36 100644 --- a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c +++ b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c @@ -57,14 +57,14 @@ static void set_cursor(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x20, g->p.x); write_reg(g, 0x21, g->p.y); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x20, g->p.y); write_reg(g, 0x21, g->p.x); break; @@ -75,16 +75,16 @@ static void set_cursor(GDisplay *g) { static void set_viewport(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, 0x50, g->p.x); write_reg(g, 0x51, g->p.x + g->p.cx - 1); write_reg(g, 0x52, g->p.y); write_reg(g, 0x53, g->p.y + g->p.cy - 1); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, 0x50, g->p.y); write_reg(g, 0x51, g->p.y + g->p.cy - 1); write_reg(g, 0x52, g->p.x); @@ -194,7 +194,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -318,10 +318,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1038); @@ -332,7 +332,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1030); @@ -343,7 +343,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1030); @@ -354,7 +354,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1038); @@ -368,7 +368,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c index 369eac8a..d440b621 100755 --- a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c +++ b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c @@ -202,7 +202,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Initialise the GDISP structure g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -349,11 +349,11 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_index(g, 0x36); @@ -364,7 +364,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_index(g, 0x36); @@ -375,7 +375,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_index(g, 0x36); @@ -386,7 +386,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_index(g, 0x36); @@ -401,7 +401,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; default: diff --git a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c index 95d4a11d..30f30b87 100644 --- a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c +++ b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c @@ -166,7 +166,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -221,31 +221,31 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if 0 case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); // TODO release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); // TODO release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); // TODO release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); // TODO release_bus(g); @@ -255,7 +255,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; #endif diff --git a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c index 79b28c51..ec0a4320 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c +++ b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c @@ -58,19 +58,19 @@ static GFXINLINE void set_cursor(GDisplay *g) { */ switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: write_reg(g, 0x20, g->p.x & 0x00FF); write_reg(g, 0x21, g->p.y & 0x01FF); break; - case GDISP_ROTATE_90: + case gOrientation90: write_reg(g, 0x20, g->p.y & 0x00FF); write_reg(g, 0x21, (GDISP_SCREEN_HEIGHT - 1 - g->p.x) & 0x01FF); break; - case GDISP_ROTATE_180: + case gOrientation180: write_reg(g, 0x20, (GDISP_SCREEN_WIDTH - 1 - g->p.x) & 0x00FF); write_reg(g, 0x21, (GDISP_SCREEN_HEIGHT - 1 - g->p.y) & 0x01FF); break; - case GDISP_ROTATE_270: + case gOrientation270: write_reg(g, 0x20, (GDISP_SCREEN_WIDTH - 1 - g->p.y) & 0x00FF); write_reg(g, 0x21, g->p.x & 0x01FF); break; @@ -86,23 +86,23 @@ static GFXINLINE void set_viewport(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: write_reg(g, 0x46, (((g->p.x + g->p.cx - 1) << 8) & 0xFF00 ) | (g->p.x & 0x00FF)); write_reg(g, 0x48, g->p.y & 0x01FF); write_reg(g, 0x47, (g->p.y + g->p.cy - 1) & 0x01FF); break; - case GDISP_ROTATE_90: + case gOrientation90: write_reg(g, 0x46, (((g->p.y + g->p.cy - 1) << 8) & 0xFF00) | (g->p.y & 0x00FF)); write_reg(g, 0x48, (GDISP_SCREEN_HEIGHT - (g->p.x + g->p.cx)) & 0x01FF); write_reg(g, 0x47, (GDISP_SCREEN_HEIGHT-1 - g->p.x) & 0x01FF); break; - case GDISP_ROTATE_180: + case gOrientation180: write_reg(g, 0x46, (((GDISP_SCREEN_WIDTH-1 - g->p.x) & 0x00FF) << 8) | ((GDISP_SCREEN_WIDTH - (g->p.x + g->p.cx)) & 0x00FF)); write_reg(g, 0x48, (GDISP_SCREEN_HEIGHT - (g->p.y + g->p.cy)) & 0x01FF); write_reg(g, 0x47, (GDISP_SCREEN_HEIGHT-1 - g->p.y) & 0x01FF); break; - case GDISP_ROTATE_270: + case gOrientation270: write_reg(g, 0x46, (((GDISP_SCREEN_WIDTH-1 - g->p.y) & 0x00FF) << 8) | ((GDISP_SCREEN_WIDTH - (g->p.y + g->p.cy)) & 0x00FF)); write_reg(g, 0x48, g->p.x & 0x01FF); @@ -203,7 +203,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -277,31 +277,31 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_reg(g, 0x03, 0b0011); release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_reg(g, 0x03, 0b1001); release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_reg(g, 0x03, 0b0000); release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_reg(g, 0x03, 0b1010); release_bus(g); @@ -311,7 +311,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c index 037a1265..c6b37c98 100644 --- a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c +++ b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c @@ -136,7 +136,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) // Initialise the GDISP structure to match g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -208,11 +208,11 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x0100); @@ -221,7 +221,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x01A0); @@ -230,7 +230,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x01C0); @@ -239,7 +239,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x0160); @@ -249,11 +249,11 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) break; default: - // GDISP_ROTATE_PORTRAIT and GDISP_ROTATE_LANDSCAPE are handled by the higher level code + // gOrientationPortrait and gOrientationLandscape are handled by the higher level code return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; } diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c index a573a70b..5f0e2a84 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c +++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c @@ -54,19 +54,19 @@ static void set_cursor(GDisplay *g) { */ switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: write_reg(g, 0x4e, g->p.x & 0x00FF); write_reg(g, 0x4f, g->p.y & 0x01FF); break; - case GDISP_ROTATE_90: + case gOrientation90: write_reg(g, 0x4e, g->p.y & 0x00FF); write_reg(g, 0x4f, (GDISP_SCREEN_HEIGHT-1-g->p.x) & 0x01FF); break; - case GDISP_ROTATE_180: + case gOrientation180: write_reg(g, 0x4e, (GDISP_SCREEN_WIDTH-1-g->p.x) & 0x00FF); write_reg(g, 0x4f, (GDISP_SCREEN_HEIGHT-1-g->p.y) & 0x01FF); break; - case GDISP_ROTATE_270: + case gOrientation270: write_reg(g, 0x4e, (GDISP_SCREEN_WIDTH-1-g->p.y) & 0x00FF); write_reg(g, 0x4f, g->p.x & 0x01FF); break; @@ -86,22 +86,22 @@ static void set_viewport(GDisplay* g) { */ switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: write_reg(g, 0x44, (((g->p.x+g->p.cx-1) << 8) & 0xFF00 ) | (g->p.x & 0x00FF)); write_reg(g, 0x45, g->p.y & 0x01FF); write_reg(g, 0x46, (g->p.y+g->p.cy-1) & 0x01FF); break; - case GDISP_ROTATE_90: + case gOrientation90: write_reg(g, 0x44, (((g->p.y+g->p.cy-1) << 8) & 0xFF00 ) | (g->p.y & 0x00FF)); write_reg(g, 0x45, (GDISP_SCREEN_HEIGHT-(g->p.x+g->p.cx)) & 0x01FF); write_reg(g, 0x46, (GDISP_SCREEN_HEIGHT-1-g->p.x) & 0x01FF); break; - case GDISP_ROTATE_180: + case gOrientation180: write_reg(g, 0x44, (((GDISP_SCREEN_WIDTH-1-g->p.x) & 0x00FF) << 8) | ((GDISP_SCREEN_WIDTH - (g->p.x+g->p.cx)) & 0x00FF)); write_reg(g, 0x45, (GDISP_SCREEN_HEIGHT-(g->p.y+g->p.cy)) & 0x01FF); write_reg(g, 0x46, (GDISP_SCREEN_HEIGHT-1-g->p.y) & 0x01FF); break; - case GDISP_ROTATE_270: + case gOrientation270: write_reg(g, 0x44, (((GDISP_SCREEN_WIDTH-1-g->p.y) & 0x00FF) << 8) | ((GDISP_SCREEN_WIDTH-(g->p.y+g->p.cy)) & 0x00FF)); write_reg(g, 0x45, g->p.x & 0x01FF); write_reg(g, 0x46, (g->p.x+g->p.cx-1) & 0x01FF); @@ -187,7 +187,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -310,10 +310,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); /* ID = 11 AM = 0 */ write_reg(g, 0x11, 0x6070); @@ -321,7 +321,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); /* ID = 01 AM = 1 */ write_reg(g, 0x11, 0x6058); @@ -329,7 +329,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); /* ID = 00 AM = 0 */ write_reg(g, 0x11, 0x6040); @@ -337,7 +337,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); /* ID = 10 AM = 1 */ write_reg(g, 0x11, 0x6068); @@ -348,7 +348,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c index ff907e6d..ac2cd05c 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c +++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c @@ -130,7 +130,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -178,25 +178,25 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: sx = g->p.x; ex = g->p.x + g->p.cx - 1; sy = g->p.y; ey = sy + g->p.cy - 1; break; - case GDISP_ROTATE_90: + case gOrientation90: sx = g->p.y; ex = g->p.y + g->p.cy - 1; sy = GDISP_SCREEN_HEIGHT - g->p.x - g->p.cx; ey = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: sx = GDISP_SCREEN_WIDTH - g->p.x - g->p.cx; ex = GDISP_SCREEN_WIDTH-1 - g->p.x; sy = GDISP_SCREEN_HEIGHT - g->p.y - g->p.cy; ey = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: sx = GDISP_SCREEN_WIDTH - g->p.y - g->p.cy; ex = GDISP_SCREEN_WIDTH-1 - g->p.y; sy = g->p.x; @@ -240,19 +240,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_WIDTH-1 - g->p.y; y = g->p.x; break; @@ -271,19 +271,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_WIDTH-1 - g->p.y; y = g->p.x; break; @@ -318,24 +318,24 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { + switch((gOrientation)g->p.ptr) { /* Rotation is handled by the drawing routines */ - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_CONTRAST: diff --git a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c index 2a956687..9822c1e1 100644 --- a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c +++ b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c @@ -148,7 +148,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_180; + g->g.Orientation = gOrientation180; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -194,19 +194,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_WIDTH-1 - g->p.y; y = g->p.x; break; @@ -225,19 +225,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_WIDTH-1 - g->p.y; y = g->p.x; break; @@ -273,24 +273,24 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { + switch((gOrientation)g->p.ptr) { /* Rotation is handled by the drawing routines */ - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; } } diff --git a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c index 5080aeef..60d6c344 100644 --- a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c +++ b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c @@ -120,7 +120,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -269,31 +269,31 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); //TODO release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); //TODO release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); //TODO release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); //TODO release_bus(g); @@ -303,7 +303,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; */ diff --git a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c index 762eac19..03de499d 100644 --- a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c +++ b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c @@ -131,7 +131,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -209,31 +209,31 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); //TODO release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); //TODO release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); //TODO release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); //TODO release_bus(g); @@ -243,7 +243,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c index e2b86968..0a41f13c 100644 --- a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c +++ b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c @@ -74,7 +74,7 @@ static void set_viewport (GDisplay* g) switch (g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: spi_write_cmd (g, SSD1848_HV_COLUMN_ADDRESS); spi_write_data2 (g, (uint8_t) (g->p.x / 8), (uint8_t) ((g->p.x + g->p.cx - 1) / 8)); spi_write_cmd (g, SSD1848_HV_PAGE_ADDRESS); @@ -82,7 +82,7 @@ static void set_viewport (GDisplay* g) spi_write_cmd (g, SSD1848_WRITE_DISP_DATA); break; - case GDISP_ROTATE_90: + case gOrientation90: spi_write_cmd (g, SSD1848_HV_COLUMN_ADDRESS); spi_write_data2 (g, g->p.y, g->p.y + g->p.cy - 1); spi_write_cmd (g, SSD1848_HV_PAGE_ADDRESS); @@ -90,7 +90,7 @@ static void set_viewport (GDisplay* g) spi_write_cmd (g, SSD1848_WRITE_DISP_DATA); break; - case GDISP_ROTATE_180: + case gOrientation180: spi_write_cmd (g, SSD1848_HV_COLUMN_ADDRESS); spi_write_data2 (g, g->g.Width - g->p.x - g->p.cx, g->g.Width - 1 - g->p.x); spi_write_cmd (g, SSD1848_HV_PAGE_ADDRESS); @@ -98,7 +98,7 @@ static void set_viewport (GDisplay* g) spi_write_cmd (g, SSD1848_WRITE_DISP_DATA); break; - case GDISP_ROTATE_270: + case gOrientation270: spi_write_cmd (g, SSD1848_HV_COLUMN_ADDRESS); spi_write_data2 (g, g->g.Height - g->p.y - g->p.cy, g->g.Height - 1 - g->p.y); spi_write_cmd (g, SSD1848_HV_PAGE_ADDRESS); @@ -213,7 +213,7 @@ LLDSPEC gBool gdisp_lld_init (GDisplay *g) /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -405,22 +405,22 @@ LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g) switch (g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT - 1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH - 1 - g->p.x; y = GDISP_SCREEN_HEIGHT - 1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_WIDTH - 1 - g->p.y; y = g->p.x; break; @@ -441,22 +441,22 @@ LLDSPEC gColor gdisp_lld_get_pixel_color (GDisplay *g) switch (g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT - 1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH - 1 - g->p.x; y = GDISP_SCREEN_HEIGHT - 1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_WIDTH - 1 - g->p.y; y = g->p.x; break; @@ -506,19 +506,19 @@ LLDSPEC void gdisp_lld_control (GDisplay *g) return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t) g->p.ptr) + if (g->g.Orientation == (gOrientation) g->p.ptr) return; - switch ((orientation_t) g->p.ptr) + switch ((gOrientation) g->p.ptr) { /* Rotation is handled by the drawing routines */ - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; @@ -526,7 +526,7 @@ LLDSPEC void gdisp_lld_control (GDisplay *g) default: return; } - g->g.Orientation = (orientation_t) g->p.ptr; + g->g.Orientation = (gOrientation) g->p.ptr; return; case GDISP_CONTROL_CONTRAST: diff --git a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c index 64c67b70..cfaccb9f 100644 --- a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c +++ b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c @@ -79,7 +79,7 @@ typedef struct LCD_Parameters { static GFXINLINE void set_viewport(GDisplay* g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: write_index(g, SSD1963_SET_COLUMN_ADDRESS); write_data16(g, g->p.x); write_data16(g, g->p.x+g->p.cx-1); @@ -88,7 +88,7 @@ static GFXINLINE void set_viewport(GDisplay* g) { write_data16(g, g->p.y+g->p.cy-1); write_index(g, SSD1963_WRITE_MEMORY_START); break; - case GDISP_ROTATE_90: + case gOrientation90: write_index(g, SSD1963_SET_COLUMN_ADDRESS); write_data16(g, g->p.y); write_data16(g, g->p.y+g->p.cy-1); @@ -97,7 +97,7 @@ static GFXINLINE void set_viewport(GDisplay* g) { write_data16(g, g->g.Width-1 - g->p.x); write_index(g, SSD1963_WRITE_MEMORY_START); break; - case GDISP_ROTATE_180: + case gOrientation180: write_index(g, SSD1963_SET_COLUMN_ADDRESS); write_data16(g, g->g.Width - g->p.x - g->p.cx); write_data16(g, g->g.Width-1 - g->p.x); @@ -106,7 +106,7 @@ static GFXINLINE void set_viewport(GDisplay* g) { write_data16(g, g->g.Height-1 - g->p.y); write_index(g, SSD1963_WRITE_MEMORY_START); break; - case GDISP_ROTATE_270: + case gOrientation270: write_index(g, SSD1963_SET_COLUMN_ADDRESS); write_data16(g, g->g.Height - g->p.y - g->p.cy); write_data16(g, g->g.Height-1 - g->p.y); @@ -267,7 +267,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = lcdp->width; g->g.Height = lcdp->height; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -336,10 +336,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_index(g, SSD1963_SET_ADDRESS_MODE); write_data(g, 0x00); @@ -347,7 +347,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = ((LCD_Parameters *)g->priv)->height; g->g.Width = ((LCD_Parameters *)g->priv)->width; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_index(g, SSD1963_SET_ADDRESS_MODE); write_data(g, SSD1963_ADDR_MODE_PAGE_ADDR_ORDER | SSD1963_ADDR_MODE_PAG_COL_ADDR_ORDER ); @@ -355,7 +355,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = ((LCD_Parameters *)g->priv)->width; g->g.Width = ((LCD_Parameters *)g->priv)->height; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_index(g, SSD1963_SET_ADDRESS_MODE); write_data(g, SSD1963_ADDR_MODE_PAGE_ADDR_ORDER | SSD1963_ADDR_MODE_COL_ADDR_ORDER); @@ -363,7 +363,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = ((LCD_Parameters *)g->priv)->height; g->g.Width = ((LCD_Parameters *)g->priv)->width; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_index(g, SSD1963_SET_ADDRESS_MODE); write_data(g, SSD1963_ADDR_MODE_COL_ADDR_ORDER | SSD1963_ADDR_MODE_PAG_COL_ADDR_ORDER ); @@ -374,7 +374,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c index 3d1a3693..6b0870cf 100644 --- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c +++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c @@ -55,19 +55,19 @@ static void set_cursor(GDisplay* g) { */ switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: write_reg(g, SSD2119_REG_X_RAM_ADDR, g->p.x & 0x01FF); write_reg(g, SSD2119_REG_Y_RAM_ADDR, g->p.y & 0x00FF); break; - case GDISP_ROTATE_90: + case gOrientation90: write_reg(g, SSD2119_REG_X_RAM_ADDR, g->p.y & 0x01FF); write_reg(g, SSD2119_REG_Y_RAM_ADDR, (GDISP_SCREEN_HEIGHT-1 - g->p.x) & 0x00FF); break; - case GDISP_ROTATE_180: + case gOrientation180: write_reg(g, SSD2119_REG_X_RAM_ADDR, (GDISP_SCREEN_WIDTH-1 - g->p.x) & 0x01FF); write_reg(g, SSD2119_REG_Y_RAM_ADDR, (GDISP_SCREEN_HEIGHT-1 - g->p.y) & 0x00FF); break; - case GDISP_ROTATE_270: + case gOrientation270: write_reg(g, SSD2119_REG_X_RAM_ADDR, (GDISP_SCREEN_WIDTH-1 - g->p.y) & 0x01FF); write_reg(g, SSD2119_REG_Y_RAM_ADDR, g->p.x & 0x00FF); break; @@ -86,22 +86,22 @@ static void set_viewport(GDisplay* g) { */ switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: write_reg(g, SSD2119_REG_V_RAM_POS, (((g->p.y + g->p.cy - 1) << 8) & 0xFF00 ) | (g->p.y & 0x00FF)); write_reg(g, SSD2119_REG_H_RAM_START, (g->p.x & 0x01FF)); write_reg(g, SSD2119_REG_H_RAM_END, (g->p.x + g->p.cx - 1) & 0x01FF); break; - case GDISP_ROTATE_90: + case gOrientation90: write_reg(g, SSD2119_REG_V_RAM_POS, (((GDISP_SCREEN_HEIGHT-1 - g->p.x) & 0x00FF) << 8) | ((GDISP_SCREEN_HEIGHT - (g->p.x + g->p.cx)) & 0x00FF)); write_reg(g, SSD2119_REG_H_RAM_START, (g->p.y & 0x01FF)); write_reg(g, SSD2119_REG_H_RAM_END, (g->p.y + g->p.cy - 1) & 0x01FF); break; - case GDISP_ROTATE_180: + case gOrientation180: write_reg(g, SSD2119_REG_V_RAM_POS, (((GDISP_SCREEN_HEIGHT-1 - g->p.y) & 0x00FF) << 8) | ((GDISP_SCREEN_HEIGHT - (g->p.y + g->p.cy)) & 0x00FF)); write_reg(g, SSD2119_REG_H_RAM_START, (GDISP_SCREEN_WIDTH - (g->p.x + g->p.cx)) & 0x01FF); write_reg(g, SSD2119_REG_H_RAM_END, (GDISP_SCREEN_WIDTH-1 - g->p.x) & 0x01FF); break; - case GDISP_ROTATE_270: + case gOrientation270: write_reg(g, SSD2119_REG_V_RAM_POS, (((g->p.x + g->p.cx - 1) << 8) & 0xFF00 ) | (g->p.x & 0x00FF)); write_reg(g, SSD2119_REG_H_RAM_START, (GDISP_SCREEN_WIDTH - (g->p.y + g->p.cy)) & 0x01FF); write_reg(g, SSD2119_REG_H_RAM_END, (GDISP_SCREEN_WIDTH-1 - g->p.y) & 0x01FF); @@ -228,7 +228,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -360,10 +360,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); /* ID = 11 AM = 0 */ write_reg(g, SSD2119_REG_ENTRY_MODE, 0x6830); @@ -371,7 +371,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); /* ID = 01 AM = 1 */ write_reg(g, SSD2119_REG_ENTRY_MODE, 0x6818); @@ -379,7 +379,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); /* ID = 00 AM = 0 */ write_reg(g, SSD2119_REG_ENTRY_MODE, 0x6800); @@ -387,7 +387,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); /* ID = 10 AM = 1 */ write_reg(g, SSD2119_REG_ENTRY_MODE, 0x6828); @@ -398,7 +398,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c index 2b153230..a9200698 100644 --- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c +++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c @@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Initialise the GDISP structure g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -170,19 +170,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_HEIGHT-1 - g->p.y; y = g->p.x; break; @@ -201,19 +201,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_HEIGHT-1 - g->p.y; x = g->p.x; break; @@ -248,24 +248,24 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { + switch((gOrientation)g->p.ptr) { // Rotation is handled by the drawing routines - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_CONTRAST: diff --git a/drivers/gdisp/ST7735/gdisp_lld_ST7735.c b/drivers/gdisp/ST7735/gdisp_lld_ST7735.c index df4b75ef..bc6b8084 100644 --- a/drivers/gdisp/ST7735/gdisp_lld_ST7735.c +++ b/drivers/gdisp/ST7735/gdisp_lld_ST7735.c @@ -260,7 +260,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -344,10 +344,10 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: acquire_bus(g); write_cmd(g, ST7735_MADCTL); write_data_byte(g, 0xC0|ST7735_MADCTRL_COLOR); @@ -355,7 +355,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; release_bus(g); break; - case GDISP_ROTATE_90: + case gOrientation90: acquire_bus(g); write_cmd(g, ST7735_MADCTL); write_data_byte(g, 0xA0|ST7735_MADCTRL_COLOR); @@ -363,7 +363,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { g->g.Width = GDISP_SCREEN_HEIGHT; release_bus(g); break; - case GDISP_ROTATE_180: + case gOrientation180: acquire_bus(g); write_cmd(g, ST7735_MADCTL); write_data_byte(g, 0x00|ST7735_MADCTRL_COLOR); @@ -371,7 +371,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; release_bus(g); break; - case GDISP_ROTATE_270: + case gOrientation270: acquire_bus(g); write_cmd(g, ST7735_MADCTL); write_data_byte(g, 0x60|ST7735_MADCTRL_COLOR); @@ -382,7 +382,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: if ((unsigned)g->p.ptr > 100) diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c index 5d3a1380..dbd2d8e4 100644 --- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c +++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c @@ -287,7 +287,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { // Initialise the GDISP structure g->g.Width = ((ltdcLayerConfig *)g->priv)->width; g->g.Height = ((ltdcLayerConfig *)g->priv)->height; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -300,17 +300,17 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -338,17 +338,17 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -376,12 +376,12 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { LLDSPEC void gdisp_lld_control(GDisplay* g) { switch(g->p.x) { case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -389,9 +389,9 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -402,7 +402,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: @@ -452,23 +452,23 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); lineadd = g->g.Width - g->p.cx; shape = (g->p.cx << 16) | (g->p.cy); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-g->p.cx); lineadd = g->g.Height - g->p.cy; shape = (g->p.cy << 16) | (g->p.cx); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-g->p.cx, g->g.Height-g->p.y-g->p.cy); lineadd = g->g.Width - g->p.cx; shape = (g->p.cx << 16) | (g->p.cy); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-g->p.cy, g->p.x); lineadd = g->g.Height - g->p.cy; shape = (g->p.cy << 16) | (g->p.cx); @@ -520,7 +520,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { DMA2D->CR = DMA2D_CR_MODE_R2M | DMA2D_CR_START; } - /* Oops - the DMA2D only supports GDISP_ROTATE_0. + /* Oops - the DMA2D only supports gOrientation0. * * Where the width is 1 we can trick it for other orientations. * That is worthwhile as a width of 1 is common. For other @@ -531,7 +531,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { * other formats we also need to fall back to pixel pushing. * * As the code to actually do all that for other than the - * simplest case (orientation == GDISP_ROTATE_0 and + * simplest case (orientation == gOrientation0 and * GDISP_PIXELFORMAT == GDISP_LLD_PIXELFORMAT) is very complex * we will always pixel push for now. In practice that is OK as * access to the framebuffer is fast - probably faster than DMA2D. diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_config.h b/drivers/gdisp/STM32LTDC/gdisp_lld_config.h index 7777a1bc..2e3967c6 100644 --- a/drivers/gdisp/STM32LTDC/gdisp_lld_config.h +++ b/drivers/gdisp/STM32LTDC/gdisp_lld_config.h @@ -40,7 +40,7 @@ // DMA2D supports accelerated fills #define GDISP_HARDWARE_FILLS GFXON - // Accelerated bitfills are also possible but only for GDISP_ROTATE_0 + // Accelerated bitfills are also possible but only for gOrientation0 // and if no color translation is required (for now) #if !GDISP_NEED_CONTROL && !defined(GDISP_PIXELFORMAT) #define GDISP_HARDWARE_BITFILLS GFXON diff --git a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c index 80613719..128ffc5c 100644 --- a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c +++ b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c @@ -100,7 +100,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_TLS8204_WIDTH; g->g.Height = GDISP_TLS8204_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -138,19 +138,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = g->g.Width - g->p.x - 1; break; - case GDISP_ROTATE_180: + case gOrientation180: x = g->g.Width - g->p.x - 1; y = g->g.Height - g->p.y - 1; break; - case GDISP_ROTATE_270: + case gOrientation270: x = g->g.Height - g->p.y - 1; y = g->p.x; break; @@ -176,19 +176,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_TLS8204_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_TLS8204_WIDTH-1 - g->p.x; y = GDISP_TLS8204_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_TLS8204_WIDTH-1 - g->p.y; y = g->p.x; break; @@ -223,12 +223,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -236,9 +236,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -249,7 +249,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c index fa2fdc71..0fdd5314 100644 --- a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c +++ b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c @@ -33,7 +33,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; diff --git a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c index fb82f676..9b801ea5 100644 --- a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c +++ b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c @@ -107,7 +107,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -143,19 +143,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = g->g.Width - g->p.x - 1; break; - case GDISP_ROTATE_180: + case gOrientation180: x = g->g.Width - g->p.x - 1; y = g->g.Height - g->p.y - 1; break; - case GDISP_ROTATE_270: + case gOrientation270: x = g->g.Height - g->p.y - 1; y = g->p.x; break; @@ -181,19 +181,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_WIDTH-1 - g->p.y; y = g->p.x; break; @@ -228,12 +228,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -241,9 +241,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -254,7 +254,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c index 123f3a32..e79173c2 100644 --- a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c +++ b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c @@ -124,7 +124,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -142,11 +142,11 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90 : + case gOrientation90 : y = g->p.x; x = g->p.y; break; - case GDISP_ROTATE_270 : + case gOrientation270 : y = g->p.x; x = g->p.y; break; @@ -254,9 +254,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) { return; } - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + if (g->g.Orientation == (gOrientation)g->p.ptr) { return; } + switch((gOrientation)g->p.ptr) { + case gOrientation0: g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; cmdBuffer[0] = UC1610_SET_MAPPING_CONTROL; @@ -265,7 +265,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { release_bus(g); flush_screen(g); break; - case GDISP_ROTATE_180: // we can rotate 180° without modify screen buffer RAM(g) + case gOrientation180: // we can rotate 180° without modify screen buffer RAM(g) g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; cmdBuffer[0] = UC1610_SET_MAPPING_CONTROL | UC1610_SET_MAPPING_CONTROL_MY_MASK | UC1610_SET_MAPPING_CONTROL_MX_MASK; @@ -274,7 +274,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { release_bus(g); flush_screen(g); break; - case GDISP_ROTATE_90: // needs clearing screen and updating RAM(g) + case gOrientation90: // needs clearing screen and updating RAM(g) g->g.Width = GDISP_SCREEN_HEIGHT; g->g.Height = GDISP_SCREEN_WIDTH; cmdBuffer[0] = UC1610_SET_MAPPING_CONTROL | UC1610_SET_MAPPING_CONTROL_MX_MASK; @@ -282,7 +282,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { write_cmd(g, cmdBuffer, 1); release_bus(g); break; - case GDISP_ROTATE_270: // needs clearing screen and updating RAM(g) + case gOrientation270: // needs clearing screen and updating RAM(g) g->g.Width = GDISP_SCREEN_HEIGHT; g->g.Height = GDISP_SCREEN_WIDTH; cmdBuffer[0] = UC1610_SET_MAPPING_CONTROL | UC1610_SET_MAPPING_CONTROL_MY_MASK; @@ -293,7 +293,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c index 4a3c4ba4..6b860926 100644 --- a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c +++ b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c @@ -298,7 +298,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) // Initialise the GDISP structure g->g.Width = UC8173_WIDTH; g->g.Height = UC8173_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = 0; g->g.Contrast = 0; @@ -399,7 +399,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) #if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: #if FB_REVERSEAXIS_X x = FB_WIDTH-1 - g->p.x; #else @@ -411,7 +411,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) y = g->p.y; #endif break; - case GDISP_ROTATE_90: + case gOrientation90: #if FB_REVERSEAXIS_X x = FB_WIDTH-1 - g->p.y; #else @@ -423,7 +423,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) y = FB_HEIGHT-1 - g->p.x; #endif break; - case GDISP_ROTATE_180: + case gOrientation180: #if FB_REVERSEAXIS_X x = g->p.x; #else @@ -435,7 +435,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) y = FB_HEIGHT-1 - g->p.y; #endif break; - case GDISP_ROTATE_270: + case gOrientation270: #if FB_REVERSEAXIS_X x = g->p.y; #else diff --git a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c index b3f6a6cc..f1793ff4 100644 --- a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c +++ b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c @@ -104,7 +104,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Initialise the GDISP structure */ g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; return gTrue; } @@ -118,14 +118,14 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg(g, SET_RAM_X_CNT, g->p.x / WS29EPD_PPB); write_reg_data(g, SET_RAM_Y_CNT, dataY, 2); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg(g, SET_RAM_Y_CNT, g->p.x / WS29EPD_PPB); write_reg_data(g, SET_RAM_X_CNT, dataY, 2); break; @@ -147,13 +147,13 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: write_reg_data(g, SET_RAM_X_ADR, dataX, 2); write_reg_data(g, SET_RAM_Y_ADR, dataY, 4); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: write_reg_data(g, SET_RAM_X_ADR, dataY, 4); write_reg_data(g, SET_RAM_Y_ADR, dataX, 2); break; @@ -167,19 +167,19 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { switch(g->g.Orientation) { default: - case GDISP_ROTATE_0: + case gOrientation0: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = GDISP_SCREEN_HEIGHT-1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = GDISP_SCREEN_WIDTH-1 - g->p.x; y = GDISP_SCREEN_HEIGHT-1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = GDISP_SCREEN_HEIGHT-1 - g->p.y; y = g->p.x; break; @@ -239,29 +239,29 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: + switch((gOrientation)g->p.ptr) { + case gOrientation0: g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_90: + case gOrientation90: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_180: + case gOrientation180: g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; - case GDISP_ROTATE_270: + case gOrientation270: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; default: return; diff --git a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c index fb09d1c9..ad46da3c 100644 --- a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c +++ b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c @@ -44,7 +44,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { ((fbPriv *)g->priv)->fbi.linelen = 0; // Initialize the GDISP structure - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->board = 0; // preinitialize board_init(g, &((fbPriv *)g->priv)->fbi); @@ -63,17 +63,17 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -90,17 +90,17 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -129,12 +129,12 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { return; case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -142,9 +142,9 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -155,7 +155,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: diff --git a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c index aef4de42..bf34654a 100644 --- a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c +++ b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c @@ -77,13 +77,13 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) #if GDISP_NEED_CONTROL switch(gdispGGetOrientation(m->display)) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: pdr->x = gdispGGetWidth(m->display) - pdr->x / (4096/gdispGGetWidth(m->display)); pdr->y = pdr->y / (4096/gdispGGetHeight(m->display)); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: pdr->x = gdispGGetHeight(m->display) - pdr->x / (4096/gdispGGetHeight(m->display)); pdr->y = pdr->y / (4096/gdispGGetWidth(m->display)); break; diff --git a/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c b/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c index 674a057a..eb563c43 100644 --- a/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c +++ b/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c @@ -77,13 +77,13 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) #if GDISP_NEED_CONTROL switch(gdispGGetOrientation(m->display)) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: pdr->x = gdispGGetWidth(m->display) - pdr->x / (4096/gdispGGetWidth(m->display)); pdr->y = pdr->y / (4096/gdispGGetHeight(m->display)); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: pdr->x = gdispGGetHeight(m->display) - pdr->x / (4096/gdispGGetHeight(m->display)); pdr->y = pdr->y / (4096/gdispGGetWidth(m->display)); break; diff --git a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c index 3d3acc55..39fe0a24 100644 --- a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c +++ b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c @@ -211,14 +211,14 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) #if GDISP_NEED_CONTROL switch(gdispGGetOrientation(m->display)) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: default: pdr->x = pdr->x / (4096/gdispGGetWidth(m->display)); pdr->y = pdr->y / (4096/gdispGGetHeight(m->display)); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: pdr->x = pdr->x / (4096/gdispGGetHeight(m->display)); pdr->y = pdr->y / (4096/gdispGGetWidth(m->display)); break; diff --git a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c index 6f8b442e..dca750c4 100644 --- a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c +++ b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c @@ -211,13 +211,13 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) #if GDISP_NEED_CONTROL switch(gdispGGetOrientation(m->display)) { default: - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + case gOrientation0: + case gOrientation180: pdr->x = gdispGGetWidth(m->display) - pdr->x / (4096/gdispGGetWidth(m->display)); pdr->y = pdr->y / (4096/gdispGGetHeight(m->display)); break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: pdr->x = gdispGGetHeight(m->display) - pdr->x / (4096/gdispGGetHeight(m->display)); pdr->y = pdr->y / (4096/gdispGGetWidth(m->display)); break; diff --git a/drivers/multiple/SDL/gdisp_lld_SDL.c b/drivers/multiple/SDL/gdisp_lld_SDL.c index 6603ef7b..e594e649 100644 --- a/drivers/multiple/SDL/gdisp_lld_SDL.c +++ b/drivers/multiple/SDL/gdisp_lld_SDL.c @@ -372,7 +372,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GINPUT_NEED_MOUSE gdriverRegister((const GDriverVMT *)GMOUSE_DRIVER_VMT, g); #endif - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = 100; diff --git a/drivers/multiple/Win32/gdisp_lld_Win32.c b/drivers/multiple/Win32/gdisp_lld_Win32.c index 6c0d7df2..fff7fd58 100644 --- a/drivers/multiple/Win32/gdisp_lld_Win32.c +++ b/drivers/multiple/Win32/gdisp_lld_Win32.c @@ -849,7 +849,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { } // Initialise the GDISP structure - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = 100; g->g.Contrast = 50; @@ -952,20 +952,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: x = priv->x; y = priv->y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = priv->y; y = g->g.Width - 1 - priv->x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = g->g.Width - 1 - priv->x; y = g->g.Height - 1 - priv->y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = g->g.Height - 1 - priv->y; y = priv->x; break; @@ -1061,17 +1061,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { WaitForSingleObject(drawMutex, INFINITE); #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: color = GetPixel(priv->dcBuffer, priv->x, priv->y); break; - case GDISP_ROTATE_90: + case gOrientation90: color = GetPixel(priv->dcBuffer, priv->y, g->g.Width - 1 - priv->x); break; - case GDISP_ROTATE_180: + case gOrientation180: color = GetPixel(priv->dcBuffer, g->g.Width - 1 - priv->x, g->g.Height - 1 - priv->y); break; - case GDISP_ROTATE_270: + case gOrientation270: color = GetPixel(priv->dcBuffer, g->g.Height - 1 - priv->y, priv->x); break; } @@ -1109,20 +1109,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: x = g->p.x; y = g->p.y; break; - case GDISP_ROTATE_90: + case gOrientation90: x = g->p.y; y = g->g.Width - 1 - g->p.x; break; - case GDISP_ROTATE_180: + case gOrientation180: x = g->g.Width - 1 - g->p.x; y = g->g.Height - 1 - g->p.y; break; - case GDISP_ROTATE_270: + case gOrientation270: x = g->g.Height - 1 - g->p.y; y = g->p.x; break; @@ -1170,26 +1170,26 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: rect.top = g->p.y; rect.bottom = rect.top + g->p.cy; rect.left = g->p.x; rect.right = rect.left + g->p.cx; break; - case GDISP_ROTATE_90: + case gOrientation90: rect.bottom = g->g.Width - g->p.x; rect.top = rect.bottom - g->p.cx; rect.left = g->p.y; rect.right = rect.left + g->p.cy; break; - case GDISP_ROTATE_180: + case gOrientation180: rect.bottom = g->g.Height - g->p.y; rect.top = rect.bottom - g->p.cy; rect.right = g->g.Width - g->p.x; rect.left = rect.right - g->p.cx; break; - case GDISP_ROTATE_270: + case gOrientation270: rect.top = g->p.x; rect.bottom = rect.top + g->p.cx; rect.right = g->g.Height - g->p.y; @@ -1238,22 +1238,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Copy the bits we need switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: return 0; // not handled as it doesn't need to be. - case GDISP_ROTATE_90: + case gOrientation90: for(src = buffer+g->p.x1, j = 0; j < g->p.cy; j++, src += g->p.x2 - g->p.cx) { dst = dstbuf+sz-g->p.cy+j; for(i = 0; i < g->p.cx; i++, dst -= g->p.cy) *dst = *src++; } break; - case GDISP_ROTATE_180: + case gOrientation180: for(dst = dstbuf+sz, src = buffer+g->p.x1, j = 0; j < g->p.cy; j++, src += g->p.x2 - g->p.cx) for(i = 0; i < g->p.cx; i++) *--dst = *src++; break; - case GDISP_ROTATE_270: + case gOrientation270: for(src = buffer+g->p.x1, j = 0; j < g->p.cy; j++, src += g->p.x2 - g->p.cx) { dst = dstbuf+g->p.cy-j-1; for(i = 0; i < g->p.cx; i++, dst += g->p.cy) @@ -1298,7 +1298,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: bmpInfo.bV4SizeImage = (g->p.cy*g->p.x2) * sizeof(gPixel); bmpInfo.bV4Width = g->p.x2; @@ -1308,7 +1308,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { rect.left = g->p.x; rect.right = rect.left+g->p.cx; break; - case GDISP_ROTATE_90: + case gOrientation90: if (!(buffer = rotateimg(g, buffer))) return; bmpInfo.bV4SizeImage = (g->p.cy*g->p.cx) * sizeof(gPixel); bmpInfo.bV4Width = g->p.cy; @@ -1318,7 +1318,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { rect.left = g->p.y; rect.right = rect.left+g->p.cy; break; - case GDISP_ROTATE_180: + case gOrientation180: if (!(buffer = rotateimg(g, buffer))) return; bmpInfo.bV4SizeImage = (g->p.cy*g->p.cx) * sizeof(gPixel); bmpInfo.bV4Width = g->p.cx; @@ -1328,7 +1328,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { rect.right = g->g.Width - g->p.x; rect.left = rect.right-g->p.cx; break; - case GDISP_ROTATE_270: + case gOrientation270: if (!(buffer = rotateimg(g, buffer))) return; bmpInfo.bV4SizeImage = (g->p.cy*g->p.cx) * sizeof(gPixel); bmpInfo.bV4Width = g->p.cy; @@ -1381,17 +1381,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { WaitForSingleObject(drawMutex, INFINITE); #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: color = GetPixel(priv->dcBuffer, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: color = GetPixel(priv->dcBuffer, g->p.y, g->g.Width - 1 - g->p.x); break; - case GDISP_ROTATE_180: + case gOrientation180: color = GetPixel(priv->dcBuffer, g->g.Width - 1 - g->p.x, g->g.Height - 1 - g->p.y); break; - case GDISP_ROTATE_270: + case gOrientation270: color = GetPixel(priv->dcBuffer, g->g.Height - 1 - g->p.y, g->p.x); break; } @@ -1414,7 +1414,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: rect.top = g->p.y; rect.bottom = rect.top+g->p.cy; @@ -1422,14 +1422,14 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { rect.right = rect.left+g->p.cx; lines = -g->p.y1; goto vertical_scroll; - case GDISP_ROTATE_90: + case gOrientation90: rect.bottom = g->g.Width - g->p.x; rect.top = rect.bottom-g->p.cx; rect.left = g->p.y; rect.right = rect.left+g->p.cy; lines = -g->p.y1; goto horizontal_scroll; - case GDISP_ROTATE_180: + case gOrientation180: rect.bottom = g->g.Height - g->p.y; rect.top = rect.bottom-g->p.cy; rect.right = g->g.Width - g->p.x; @@ -1458,7 +1458,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif } break; - case GDISP_ROTATE_270: + case gOrientation270: rect.top = g->p.x; rect.bottom = rect.top+g->p.cx; rect.right = g->g.Height - g->p.y; @@ -1523,23 +1523,23 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_control(GDisplay *g) { switch(g->p.x) { case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; /* case GDISP_CONTROL_POWER: @@ -1574,19 +1574,19 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { gCoord t; switch(gdispGGetOrientation(m->display)) { - case GDISP_ROTATE_0: + case gOrientation0: default: break; - case GDISP_ROTATE_90: + case gOrientation90: t = pt->x; pt->x = g->g.Width - 1 - pt->y; pt->y = t; break; - case GDISP_ROTATE_180: + case gOrientation180: pt->x = g->g.Width - 1 - pt->x; pt->y = g->g.Height - 1 - pt->y; break; - case GDISP_ROTATE_270: + case gOrientation270: t = pt->y; pt->y = g->g.Height - 1 - pt->x; pt->x = t; diff --git a/drivers/multiple/X/gdisp_lld_X.c b/drivers/multiple/X/gdisp_lld_X.c index 3f1c548c..7e5c85f9 100644 --- a/drivers/multiple/X/gdisp_lld_X.c +++ b/drivers/multiple/X/gdisp_lld_X.c @@ -397,7 +397,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { gfxSleepMilliseconds(100); /* Initialise the GDISP structure to match */ - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = 100; g->g.Contrast = 50; diff --git a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c index 573e4bb0..d1f78fac 100644 --- a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c +++ b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c @@ -452,7 +452,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif // Initialise the GDISP structure - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = 100; g->g.Contrast = 50; @@ -649,7 +649,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Check if we might support the code switch(g->p.x) { case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; break; case GDISP_CONTROL_POWER: @@ -689,21 +689,21 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Update the local stuff switch(g->p.x) { case GDISP_CONTROL_ORIENTATION: - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; break; case GDISP_CONTROL_POWER: g->g.Powermode = (gPowermode)g->p.ptr; diff --git a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp index d94b0c34..e9221419 100644 --- a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp +++ b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp @@ -335,7 +335,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif // Initialise the GDISP structure - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = 100; g->g.Contrast = 50; @@ -532,7 +532,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Check if we might support the code switch(g->p.x) { case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; break; case GDISP_CONTROL_POWER: @@ -572,21 +572,21 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Update the local stuff switch(g->p.x) { case GDISP_CONTROL_ORIENTATION: - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: + case gOrientation90: + case gOrientation270: g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; break; case GDISP_CONTROL_POWER: g->g.Powermode = (gPowermode)g->p.ptr; diff --git a/gfxconf.example.h b/gfxconf.example.h index 995a58e5..c5def9dd 100644 --- a/gfxconf.example.h +++ b/gfxconf.example.h @@ -157,7 +157,7 @@ //#define GDISP_NEED_PIXMAP GFXOFF // #define GDISP_NEED_PIXMAP_IMAGE GFXOFF -//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used. +//#define GDISP_DEFAULT_ORIENTATION gOrientationLandscape // If not defined the native hardware orientation is used. //#define GDISP_LINEBUF_SIZE 128 //#define GDISP_STARTUP_COLOR GFX_BLACK //#define GDISP_NEED_STARTUP_LOGO GFXON diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c index b1180b92..d8f58da6 100644 --- a/src/gdisp/gdisp.c +++ b/src/gdisp/gdisp.c @@ -712,7 +712,7 @@ unsigned gdispGetDisplayCount(void) { gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; } gCoord gdispGGetHeight(GDisplay *g) { return g->g.Height; } gPowermode gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; } -orientation_t gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; } +gOrientation gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; } uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; } uint8_t gdispGGetContrast(GDisplay *g) { return g->g.Contrast; } @@ -2874,12 +2874,12 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor g->p.x = what; g->p.ptr = value; if (what == GDISP_CONTROL_ORIENTATION) { - switch ((orientation_t) value) { - case GDISP_ROTATE_LANDSCAPE: - g->p.ptr = g->g.Width >= g->g.Height ? (void *)GDISP_ROTATE_0 : (void *)GDISP_ROTATE_90; + switch ((gOrientation) value) { + case gOrientationLandscape: + g->p.ptr = g->g.Width >= g->g.Height ? (void *)gOrientation0 : (void *)gOrientation90; break; - case GDISP_ROTATE_PORTRAIT: - g->p.ptr = g->g.Width >= g->g.Height ? (void *)GDISP_ROTATE_90 : (void *)GDISP_ROTATE_0; + case gOrientationPortrait: + g->p.ptr = g->g.Width >= g->g.Height ? (void *)gOrientation90 : (void *)gOrientation0; break; default: break; diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h index 8a573456..39493257 100644 --- a/src/gdisp/gdisp.h +++ b/src/gdisp/gdisp.h @@ -93,19 +93,19 @@ typedef enum gFontmetric { typedef const struct mf_font_s* gFont; /** - * @enum orientation + * @enum gOrientation * @brief Type for the screen orientation. - * @note GDISP_ROTATE_LANDSCAPE and GDISP_ROTATE_PORTRAIT are internally converted to the + * @note gOrientationLandscape and gOrientationPortrait are internally converted to the * most appropriate other orientation. */ -typedef enum orientation { - GDISP_ROTATE_0 = 0, /**< Don't rotate. This is the displays native orientation. */ - GDISP_ROTATE_90 = 90, /**< Rotate by 90 degrees absolute to the native rotation. */ - GDISP_ROTATE_180 = 180, /**< Rotate by 180 degrees absolute to the native rotation. */ - GDISP_ROTATE_270 = 270, /**< Rotate by 270 degrees absolute to the native rotation. */ - GDISP_ROTATE_PORTRAIT = 1000, /**< Put the display into portrait mode. */ - GDISP_ROTATE_LANDSCAPE = 1001 /**< Put the display into landscape mode. */ -} orientation_t; +typedef enum gOrientation { + gOrientation0 = 0, /**< Don't rotate. This is the displays native orientation. */ + gOrientation90 = 90, /**< Rotate by 90 degrees absolute to the native rotation. */ + gOrientation180 = 180, /**< Rotate by 180 degrees absolute to the native rotation. */ + gOrientation270 = 270, /**< Rotate by 270 degrees absolute to the native rotation. */ + gOrientationPortrait = 1000, /**< Put the display into portrait mode. */ + gOrientationLandscape = 1001 /**< Put the display into landscape mode. */ +} gOrientation; /** * @enum gPowermode @@ -334,7 +334,7 @@ gPowermode gdispGGetPowerMode(GDisplay *g); * * @api */ -orientation_t gdispGGetOrientation(GDisplay *g); +gOrientation gdispGGetOrientation(GDisplay *g); #define gdispGetOrientation() gdispGGetOrientation(GDISP) /** @@ -1230,38 +1230,45 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor /* V2 compatibility */ #if GFX_COMPAT_V2 - typedef gColor color_t; - typedef gPixel pixel_t; - typedef gCoord coord_t; - typedef gPoint point, point_t; - typedef gFont font_t; - typedef gPowermode powermode_t; - #define powerOff gPowerOff - #define powerDeepSleep gPowerDeepSleep - #define powerSleep gPowerSleep - #define powerOn gPowerOn - typedef gJustify justify_t; - #define justifyLeft gJustifyLeft - #define justifyCenter gJustifyCenter - #define justifyRight gJustifyRight - #define justifyTop gJustifyTop - #define justifyMiddle gJustifyMiddle - #define justifyBottom gJustifyBottom - #define justifyWordWrap gJustifyWordWrap - #define justifyNoWordWrap gJustifyNoWordWrap - #define justifyPad gJustifyPad - #define justifyNoPad gJustifyNoPad + typedef gColor color_t; + typedef gPixel pixel_t; + typedef gCoord coord_t; + typedef gPoint point, point_t; + typedef gFont font_t; + typedef gPowermode powermode_t; + #define powerOff gPowerOff + #define powerDeepSleep gPowerDeepSleep + #define powerSleep gPowerSleep + #define powerOn gPowerOn + typedef gOrientation orientation_t; + #define GDISP_ROTATE_0 gOrientation0 + #define GDISP_ROTATE_90 gOrientation90 + #define GDISP_ROTATE_180 gOrientation180 + #define GDISP_ROTATE_270 gOrientation270 + #define GDISP_ROTATE_PORTRAIT gOrientationPortrait + #define GDISP_ROTATE_LANDSCAPE gOrientationLandscape + typedef gJustify justify_t; + #define justifyLeft gJustifyLeft + #define justifyCenter gJustifyCenter + #define justifyRight gJustifyRight + #define justifyTop gJustifyTop + #define justifyMiddle gJustifyMiddle + #define justifyBottom gJustifyBottom + #define justifyWordWrap gJustifyWordWrap + #define justifyNoWordWrap gJustifyNoWordWrap + #define justifyPad gJustifyPad + #define justifyNoPad gJustifyNoPad #define JUSTIFYMASK_LEFTRIGHT JUSTIFYMASK_HORIZONTAL #define JUSTIFYMASK_TOPBOTTOM JUSTIFYMASK_VERTICAL - typedef gFontmetric fontmetric_t; - #define fontHeight gFontHeight - #define fontDescendersHeight gFontDescendersHeight - #define fontLineSpacing gFontLineSpacing - #define fontCharPadding gFontCharPadding - #define fontMinWidth gFontMinWidth - #define fontMaxWidth gFontMaxWidth - #define fontBaselineX gFontBaselineX - #define fontBaselineY gFontBaselineY + typedef gFontmetric fontmetric_t; + #define fontHeight gFontHeight + #define fontDescendersHeight gFontDescendersHeight + #define fontLineSpacing gFontLineSpacing + #define fontCharPadding gFontCharPadding + #define fontMinWidth gFontMinWidth + #define fontMaxWidth gFontMaxWidth + #define fontBaselineX gFontBaselineX + #define fontBaselineY gFontBaselineY #endif #endif /* GFX_USE_GDISP */ diff --git a/src/gdisp/gdisp_driver.h b/src/gdisp/gdisp_driver.h index 7d0d7ef3..40a07c12 100644 --- a/src/gdisp/gdisp_driver.h +++ b/src/gdisp/gdisp_driver.h @@ -320,7 +320,7 @@ struct GDisplay { struct GDISPControl { gCoord Width; gCoord Height; - orientation_t Orientation; + gOrientation Orientation; gPowermode Powermode; uint8_t Backlight; uint8_t Contrast; diff --git a/src/gdisp/gdisp_options.h b/src/gdisp/gdisp_options.h index 7398d381..d624a763 100644 --- a/src/gdisp/gdisp_options.h +++ b/src/gdisp/gdisp_options.h @@ -230,7 +230,7 @@ * @note GDISP_NEED_CONTROL must also be set (and the hardware must support it) * @note If not specified then displays default to the native hardware orientation */ - // #define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE + // #define GDISP_DEFAULT_ORIENTATION gOrientationLandscape /** * @brief The size of pixel buffer (in pixels) used for optimization. * @details Set to zero to guarantee disabling of the buffer. diff --git a/src/gdisp/gdisp_pixmap.c b/src/gdisp/gdisp_pixmap.c index e65e6e71..92075646 100644 --- a/src/gdisp/gdisp_pixmap.c +++ b/src/gdisp/gdisp_pixmap.c @@ -122,7 +122,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Height = ((gCoord *)((pixmap *)g->priv)->pixels)[1]; g->g.Backlight = 100; g->g.Contrast = 50; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->board = 0; @@ -138,17 +138,17 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = g->p.y * g->g.Width + g->p.x; break; - case GDISP_ROTATE_90: + case gOrientation90: pos = (g->g.Width-g->p.x-1) * g->g.Height + g->p.y; break; - case GDISP_ROTATE_180: + case gOrientation180: pos = (g->g.Height-g->p.y-1) * g->g.Width + g->g.Width-g->p.x-1; break; - case GDISP_ROTATE_270: + case gOrientation270: pos = g->p.x * g->g.Height + g->g.Height-g->p.y-1; break; } @@ -164,17 +164,17 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = g->p.y * g->g.Width + g->p.x; break; - case GDISP_ROTATE_90: + case gOrientation90: pos = (g->g.Width-g->p.x-1) * g->g.Height + g->p.y; break; - case GDISP_ROTATE_180: + case gOrientation180: pos = (g->g.Height-g->p.y-1) * g->g.Width + g->g.Width-g->p.x-1; break; - case GDISP_ROTATE_270: + case gOrientation270: pos = g->p.x * g->g.Height + g->g.Height-g->p.y-1; break; } @@ -189,12 +189,12 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { LLDSPEC void gdisp_lld_control(GDisplay *g) { switch(g->p.x) { case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -202,9 +202,9 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -215,7 +215,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; } } diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c index af65a60a..d071dc4e 100644 --- a/src/ginput/ginput_mouse.c +++ b/src/ginput/ginput_mouse.c @@ -208,18 +208,18 @@ static void GetMouseReading(GMouse *m) { gCoord t; switch(gdispGGetOrientation(m->display)) { - case GDISP_ROTATE_0: + case gOrientation0: break; - case GDISP_ROTATE_90: + case gOrientation90: t = r.x; r.x = w - 1 - r.y; r.y = t; break; - case GDISP_ROTATE_180: + case gOrientation180: r.x = w - 1 - r.x; r.y = h - 1 - r.y; break; - case GDISP_ROTATE_270: + case gOrientation270: t = r.y; r.y = h - 1 - r.x; r.x = t; @@ -382,22 +382,22 @@ static void MousePoll(void *param) { #if GDISP_NEED_CONTROL if (!(gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) { - /* Convert all cross points back to GDISP_ROTATE_0 convention + /* Convert all cross points back to gOrientation0 convention * before calculating the calibration matrix. */ switch(gdispGGetOrientation(m->display)) { - case GDISP_ROTATE_90: + case gOrientation90: c0 = cross[0].y; c1 = cross[1].y; c2 = cross[2].y; break; - case GDISP_ROTATE_180: + case gOrientation180: c0 = c1 = c2 = gdispGGetWidth(m->display) - 1; c0 -= cross[0].x; c1 -= cross[1].x; c2 -= cross[2].x; break; - case GDISP_ROTATE_270: + case gOrientation270: c0 = c1 = c2 = gdispGGetHeight(m->display) - 1; c0 -= cross[0].y; c1 -= cross[1].y; @@ -429,19 +429,19 @@ static void MousePoll(void *param) { #if GDISP_NEED_CONTROL if (!(gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) { switch(gdispGGetOrientation(m->display)) { - case GDISP_ROTATE_90: + case gOrientation90: c0 = c1 = c2 = gdispGGetWidth(m->display) - 1; c0 -= cross[0].x; c1 -= cross[1].x; c2 -= cross[2].x; break; - case GDISP_ROTATE_180: + case gOrientation180: c0 = c1 = c2 = gdispGGetHeight(m->display) - 1; c0 -= cross[0].y; c1 -= cross[1].y; c2 -= cross[2].y; break; - case GDISP_ROTATE_270: + case gOrientation270: c0 = cross[0].x; c1 = cross[1].x; c2 = cross[2].x; @@ -573,18 +573,18 @@ static void MousePoll(void *param) { gCoord t; switch(gdispGGetOrientation(m->display)) { - case GDISP_ROTATE_0: + case gOrientation0: break; - case GDISP_ROTATE_90: + case gOrientation90: t = points[3].x; points[3].x = w - 1 - points[3].y; points[3].y = t; break; - case GDISP_ROTATE_180: + case gOrientation180: points[3].x = w - 1 - points[3].x; points[3].y = h - 1 - points[3].y; break; - case GDISP_ROTATE_270: + case gOrientation270: t = points[3].y; points[3].y = h - 1 - points[3].x; points[3].x = t;