Browse Source

Added type gOrientation to replace V2.x orientation_t, and values gOrientationX replace GDISP_ROTATE_X

remotes/origin_old/release/v2.9
inmarket 5 years ago
parent
commit
e61f0ae424
  1. 21
      changelog.txt
  2. 2
      demos/applications/combo/gfxconf.h
  3. 2
      demos/benchmarks/main.c
  4. 2
      demos/games/tetris/gfxconf.h
  5. 4
      demos/modules/gwin/button/main.c
  6. 2
      demos/modules/gwin/frame/gfxconf.h
  7. 2
      demos/modules/gwin/imagebox/gfxconf.h
  8. 2
      demos/modules/gwin/keyboard/gfxconf.h
  9. 2
      demos/modules/gwin/widgets/gfxconf.h
  10. 36
      drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c
  11. 24
      drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c
  12. 36
      drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c
  13. 16
      drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c
  14. 40
      drivers/gdisp/ILI9225/gdisp_lld_ili9225.c
  15. 32
      drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c
  16. 32
      drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c
  17. 16
      drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c
  18. 16
      drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c
  19. 32
      drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c
  20. 16
      drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c
  21. 16
      drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c
  22. 16
      drivers/gdisp/KS0108/gdisp_lld_KS0108.c
  23. 32
      drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c
  24. 16
      drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c
  25. 40
      drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c
  26. 36
      drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c
  27. 36
      drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c
  28. 2
      drivers/gdisp/QImage/gdisp_lld_driver.c
  29. 32
      drivers/gdisp/R61505U/gdisp_lld_R61505U.c
  30. 16
      drivers/gdisp/RA6963/gdisp_lld_RA6963.c
  31. 16
      drivers/gdisp/RA8875/gdisp_lld_RA8875.c
  32. 32
      drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c
  33. 18
      drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c
  34. 32
      drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c
  35. 40
      drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c
  36. 32
      drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c
  37. 16
      drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c
  38. 16
      drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c
  39. 40
      drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
  40. 24
      drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c
  41. 32
      drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
  42. 32
      drivers/gdisp/ST7565/gdisp_lld_ST7565.c
  43. 16
      drivers/gdisp/ST7735/gdisp_lld_ST7735.c
  44. 48
      drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c
  45. 2
      drivers/gdisp/STM32LTDC/gdisp_lld_config.h
  46. 36
      drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c
  47. 2
      drivers/gdisp/TestStub/gdisp_lld_TestStub.c
  48. 36
      drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c
  49. 20
      drivers/gdisp/UC1610/gdisp_lld_UC1610.c
  50. 10
      drivers/gdisp/UC8173/gdisp_lld_UC8173.c
  51. 40
      drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c
  52. 36
      drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c
  53. 8
      drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c
  54. 8
      drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c
  55. 8
      drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c
  56. 8
      drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c
  57. 2
      drivers/multiple/SDL/gdisp_lld_SDL.c
  58. 88
      drivers/multiple/Win32/gdisp_lld_Win32.c
  59. 2
      drivers/multiple/X/gdisp_lld_X.c
  60. 16
      drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c
  61. 16
      drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp
  62. 2
      gfxconf.example.h
  63. 12
      src/gdisp/gdisp.c
  64. 89
      src/gdisp/gdisp.h
  65. 2
      src/gdisp/gdisp_driver.h
  66. 2
      src/gdisp/gdisp_options.h
  67. 36
      src/gdisp/gdisp_pixmap.c
  68. 30
      src/ginput/ginput_mouse.c

21
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

2
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
///////////////////////////////////////////////////////////////////////////

2
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();

2
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

4
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]);

2
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 //

2
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 //

2
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

2
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
///////////////////////////////////////////////////////////////////////////

36
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:

24
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:

36
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:

16
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:

40
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)

32
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:

32
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:

16
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:

16
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:

32
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:

16
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:

16
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:

16
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:

32
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);