Added type gPowermode to replace V2.x powermode_t, and values gPowerXXX replace powerXXX

release/v2.9
inmarket 2018-07-08 11:47:36 +10:00
parent f9c848e985
commit bda8c738b1
60 changed files with 336 additions and 330 deletions

View File

@ -22,7 +22,7 @@
(void) percent;
}
static void board_power(GDisplay* g, powermode_t pwr)
static void board_power(GDisplay* g, gPowermode pwr)
{
(void) g;
(void) pwr;

View File

@ -213,7 +213,7 @@
(void) percent;
}
static void board_power(GDisplay *g, powermode_t pwr) {
static void board_power(GDisplay *g, gPowermode pwr) {
(void) g;
(void) pwr;
}

View File

@ -80,7 +80,7 @@
(void) percent;
}
static void board_power(GDisplay *g, powermode_t pwr) {
static void board_power(GDisplay *g, gPowermode pwr) {
(void) g;
(void) pwr;
}

View File

@ -84,7 +84,7 @@
(void) percent;
}
static void board_power(GDisplay *g, powermode_t pwr) {
static void board_power(GDisplay *g, gPowermode pwr) {
// Not implemented yet.
(void) g;
(void) pwr;

View File

@ -23,6 +23,7 @@ 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 gPowermode to replace V2.x powermode_t, and values gPowerXXX replace powerXXX
FIX: Added gfxRealloc() to Qt port
FIX: Fixed UC1610 driver private area initialisation
FIX: Fixed ST7735 driver and added kapacuk changes

View File

@ -22,7 +22,7 @@
(void)percent;
}
static void board_power(GDisplay* g, powermode_t pwr)
static void board_power(GDisplay* g, gPowermode pwr)
{
(void)g;
(void)pwr;

View File

@ -61,7 +61,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->board = 0;
PRIV(g)->linelen = g->g.Width * sizeof(LLDCOLOR_TYPE); // bytes per line
PRIV(g)->pixels = PRIV(g)->frame0;
@ -158,16 +158,16 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g)
{
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff: case powerOn: case powerSleep: case powerDeepSleep:
board_power(g, (powermode_t)g->p.ptr);
switch((gPowermode)g->p.ptr) {
case gPowerOff: case gPowerOn: case gPowerSleep: case gPowerDeepSleep:
board_power(g, (gPowermode)g->p.ptr);
break;
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -449,7 +449,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 100;
return gTrue;
@ -532,22 +532,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
case powerSleep:
case powerDeepSleep:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
case gPowerSleep:
case gPowerDeepSleep:
gdisp_lld_flush(g);
power_off(g);
break;
case powerOn:
case gPowerOn:
power_on(g);
break;
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -42,7 +42,7 @@ command:
The buffers are also flushed whenever you turn the display off using:
gdispSetPowerMode(powerOff);
gdispSetPowerMode(gPowerOff);

View File

@ -47,7 +47,7 @@
(void) percent;
}
static void board_power(GDisplay *g, powermode_t pwr) {
static void board_power(GDisplay *g, gPowermode pwr) {
// TODO: Can be an empty function if your hardware doesn't support this
(void) g;
(void) pwr;

View File

@ -49,7 +49,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialize the GDISP structure
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->board = 0; // preinitialize
board_init(g, &((fbPriv *)g->priv)->fbi);
@ -136,16 +136,16 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff: case powerOn: case powerSleep: case powerDeepSleep:
board_power(g, (powermode_t)g->p.ptr);
switch((gPowermode)g->p.ptr) {
case gPowerOff: case gPowerOn: case gPowerSleep: case gPowerDeepSleep:
board_power(g, (gPowermode)g->p.ptr);
break;
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -149,7 +149,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;

View File

@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -254,10 +254,10 @@ LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_reg(g, ILI9225_DISP_CTRL1, 0x0000); // Display off
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
@ -268,8 +268,8 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
release_bus();
set_backlight(g, 0);
break;
case powerSleep:
case powerDeepSleep:
case gPowerSleep:
case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, ILI9225_DISP_CTRL1, 0x0000); // Display off
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
@ -281,7 +281,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
release_bus(g);
set_backlight(g, 0);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
write_reg(g, ILI9225_POWER_CTRL2, 0x0000); // Set APON,PON,AON,VCI1EN,VC
@ -323,7 +323,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -187,7 +187,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -238,10 +238,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@ -253,7 +253,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
case powerOn:
case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@ -275,7 +275,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -289,7 +289,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
case powerDeepSleep:
case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -306,7 +306,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -185,7 +185,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@ -232,10 +232,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@ -246,7 +246,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
case powerOn:
case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@ -267,7 +267,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -280,7 +280,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
gdisp_lld_backlight(g, 0);
break;
case powerDeepSleep:
case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -296,7 +296,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -228,7 +228,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -272,17 +272,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
case powerSleep:
case powerDeepSleep:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
case gPowerSleep:
case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
release_bus(g);
@ -290,7 +290,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -232,7 +232,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -276,17 +276,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
case powerSleep:
case powerDeepSleep:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
case gPowerSleep:
case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
release_bus(g);
@ -294,7 +294,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -257,7 +257,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@ -305,10 +305,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@ -319,7 +319,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
case powerOn:
case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@ -340,7 +340,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -353,7 +353,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
case powerDeepSleep:
case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -369,7 +369,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -194,7 +194,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -236,22 +236,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
release_bus(g);
if (g->g.Powermode != powerSleep)
if (g->g.Powermode != gPowerSleep)
gdisp_lld_init(g);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
release_bus(g);
@ -259,7 +259,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -190,7 +190,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@ -237,11 +237,11 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@ -249,17 +249,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_index(g, 0x11);
gfxSleepMilliseconds(120);
write_index(g, 0x29);
release_bus(g);
if (g->g.Powermode != powerSleep)
if (g->g.Powermode != gPowerSleep)
gdisp_lld_init(g);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@ -271,7 +271,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -135,7 +135,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@ -225,11 +225,11 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@ -237,17 +237,17 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_index(g, 0x11);
gfxSleepMilliseconds(120);
write_index(g, 0x29);
release_bus(g);
if (g->g.Powermode != powerSleep)
if (g->g.Powermode != gPowerSleep)
gdisp_lld_init(g);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@ -259,7 +259,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -179,7 +179,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@ -226,10 +226,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@ -240,7 +240,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
case powerOn:
case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -274,7 +274,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
case powerDeepSleep:
case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -290,7 +290,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -126,7 +126,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -172,22 +172,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
*/
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_index(g, SLEEPIN);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_index(g, SLEEPOUT);
delayms(20);
write_index(g, NORON); // Set Normal mode (my)
release_bus(g);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_index(g, SLEEPOUT);
delayms(20);
@ -198,7 +198,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -240,7 +240,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
/* Initialise the GDISP structure to match */
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
g->g.Width = GDISP_SCREEN_WIDTH;
@ -493,18 +493,18 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
*/
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
acquire_bus(g);
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
set_backlight(g, 0); // Turn off the backlight
write_index(g, DISOFF); // Turn off the display
write_cmd1(g, PWRCTR, 0x00); // Power control - all off
write_index(g, SLPIN); // Sleep in
write_index(g, OSCOFF); // Internal oscillator off
break;
case powerOn:
case gPowerOn:
write_index(g, OSCON); // Internal oscillator on
write_index(g, SLPOUT); // Sleep out
write_cmd1(g, PWRCTR, 0x0F); // Power control - reference voltage regulator on, circuit voltage follower on, BOOST ON
@ -514,7 +514,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
write_index(g, PTLOUT); // Remove sleep window
set_backlight(g, g->g.Backlight); // Turn on the backlight
break;
case powerSleep:
case gPowerSleep:
write_index(g, OSCON); // Internal oscillator on
write_index(g, SLPOUT); // Sleep out
write_cmd1(g, PWRCTR, 0x0F); // Power control - reference voltage regulator on, circuit voltage follower on, BOOST ON
@ -524,7 +524,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
write_cmd2(g, PTLIN, GDISP_SLEEP_POS/4, (GDISP_SLEEP_POS+GDISP_SLEEP_SIZE)/4); // Sleep Window
set_backlight(g, g->g.Backlight); // Turn on the backlight
break;
case powerDeepSleep:
case gPowerDeepSleep:
write_index(g, OSCON); // Internal oscillator on
write_index(g, SLPOUT); // Sleep out
write_cmd1(g, PWRCTR, 0x0F); // Power control - reference voltage regulator on, circuit voltage follower on, BOOST ON
@ -539,7 +539,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
return;
}
release_bus(g);
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
#if GDISP_NOKIA_ORIENTATION
case GDISP_CONTROL_ORIENTATION:

View File

@ -87,7 +87,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@ -185,21 +185,21 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
case powerSleep:
case powerDeepSleep:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
case gPowerSleep:
case gPowerDeepSleep:
write_cmd(g, PCD8544_SET_FUNC | PCD8544_PD);
break;
case powerOn:
case gPowerOn:
write_cmd(g, PCD8544_SET_FUNC);
break;
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -97,7 +97,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@ -195,21 +195,21 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
case powerSleep:
case powerDeepSleep:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
case gPowerSleep:
case gPowerDeepSleep:
write_cmd(g, PCF8812_SET_FUNC | PCF8812_PD);
break;
case powerOn:
case gPowerOn:
write_cmd(g, PCF8812_SET_FUNC);
break;
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -40,7 +40,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g)
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;

View File

@ -195,7 +195,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -246,10 +246,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
case powerOn:
case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@ -283,7 +283,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -297,7 +297,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
case powerDeepSleep:
case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@ -314,7 +314,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -203,7 +203,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@ -311,11 +311,11 @@ LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@ -323,17 +323,17 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_index(g, 0x11);
gfxSleepMilliseconds(120);
write_index(g, 0x29);
release_bus(g);
if (g->g.Powermode != powerSleep)
if (g->g.Powermode != gPowerSleep)
gdisp_lld_init(g);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@ -345,7 +345,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:

View File

@ -167,7 +167,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -194,20 +194,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
switch(g->p.x) {
#if 0
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
acquire_bus(g);
// TODO
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
// TODO
release_bus(g);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
// TODO
release_bus(g);
@ -215,7 +215,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
return;
#endif

View File

@ -204,7 +204,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -251,20 +251,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
switch(g->p.x) {
#if 0
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff: