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

release/v2.9
inmarket 2018-07-08 13:51:20 +10:00
parent d9258efd4d
commit e61f0ae424
68 changed files with 745 additions and 737 deletions

View File

@ -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

View File

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

View File

@ -92,7 +92,7 @@ void benchmark(void) {
gColor random_color;
gFont font;
gdispSetOrientation(GDISP_ROTATE_90);
gdispSetOrientation(gOrientation90);
width = gdispGetWidth();
height = gdispGetHeight();

View File

@ -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

View File

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

View File

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

View File

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

View File

@ -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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;

View File

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

View File

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

View File

@ -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

View File

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

View File

@ -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;
}

View File

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

View File

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

View File

@ -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;
}
}

View File

@ -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;
*/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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.

View File

@ -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

View File

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

View File

@ -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;

View File

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

View File

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

View File

@ -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

View File

@ -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;

View File

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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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 */

View File

@ -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;

View File

@ -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.

View File

@ -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;
}
}

View File

@ -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;