Added type gOrientation to replace V2.x orientation_t, and values gOrientationX replace GDISP_ROTATE_X
parent
d9258efd4d
commit
e61f0ae424
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -92,7 +92,7 @@ void benchmark(void) {
|
|||
gColor random_color;
|
||||
gFont font;
|
||||
|
||||
gdispSetOrientation(GDISP_ROTATE_90);
|
||||
gdispSetOrientation(gOrientation90);
|
||||
|
||||
width = gdispGetWidth();
|
||||
height = gdispGetHeight();
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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]);
|
||||
|
||||
|
|
|
@ -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 //
|
||||
|
|
|
@ -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 //
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||