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

This commit is contained in:
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:
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);
@ -272,7 +272,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

@ -137,7 +137,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;
@ -175,17 +175,17 @@ 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, SPFD54124B_CMD_SLPIN);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_index(g, SPFD54124B_CMD_SLPOUT);
delayms(20);
@ -193,7 +193,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g)
release_bus(g);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_index(g, SPFD54124B_CMD_SLPOUT);
delayms(20);
@ -204,7 +204,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

@ -188,7 +188,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;
@ -280,10 +280,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, 0x10, 0x0000); // leave sleep mode
write_reg(g, 0x07, 0x0000); // halt operation
@ -291,14 +291,14 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
write_reg(g, 0x10, 0x0001); // enter sleep mode
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_reg(g, 0x10, 0x0000); // leave sleep mode
write_reg(g, 0x00, 0x0001); // turn on oscillator
gfxSleepMicroseconds(5);
release_bus(g);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x10, 0x0001); // enter sleep mode
release_bus(g);
@ -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

@ -131,7 +131,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;
@ -296,17 +296,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_cmd(g, SSD1306_DISPLAYOFF);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_cmd(g, SSD1306_DISPLAYON);
release_bus(g);
@ -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

@ -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_180;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@ -251,17 +251,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_cmd(g, CMD_SET_DISPLAY_MODE_OFF);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_cmd(g, CMD_SET_DISPLAY_MODE_ON);
release_bus(g);
@ -269,7 +269,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

@ -121,7 +121,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,17 +246,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_cmd(g, SSD1331_DISPLAY_OFF);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_cmd(g, SSD1331_DISPLAY_ON);
release_bus(g);
@ -264,7 +264,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;
/*

View File

@ -132,7 +132,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;
@ -187,17 +187,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);
//TODO
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
//TODO
release_bus(g);
@ -205,7 +205,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

@ -214,7 +214,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;
@ -471,11 +471,11 @@ 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)
switch ((gPowermode) g->p.ptr)
{
case powerOff:
case gPowerOff:
acquire_bus (g);
spi_write_cmd (g, SSD1848_SETCONTRAST);
spi_write_data2 (g, 0x00, 0x00); /* Drop the contrast & gain */
@ -484,14 +484,14 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
release_bus (g);
break;
case powerSleep:
case powerDeepSleep:
case gPowerSleep:
case gPowerDeepSleep:
acquire_bus (g);
spi_write_cmd (g, SSD1848_ENTERSLEEP);
release_bus (g);
break;
case powerOn:
case gPowerOn:
acquire_bus (g);
spi_write_cmd (g, SSD1848_EXITSLEEP); /* need this in case we were in 'normal' sleep mode */
gfxSleepMilliseconds (5);
@ -502,7 +502,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

@ -268,7 +268,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = lcdp->width;
g->g.Height = lcdp->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;
@ -291,10 +291,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_index(g, SSD1963_EXIT_SLEEP_MODE);
gfxSleepMilliseconds(5);
@ -302,7 +302,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
write_index(g, SSD1963_SET_DEEP_SLEEP);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
setreadmode(g);
dummy_read(g);
@ -315,14 +315,14 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, gdispGGetBacklight(g)); // Restore the back-light
release_bus(g);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
set_backlight(g, 0xFF); // Turn off the back-light pwm from SSD1963
write_index(g, SSD1963_ENTER_SLEEP_MODE);
gfxSleepMilliseconds(5);
release_bus(g);
break;
case powerDeepSleep:
case gPowerDeepSleep:
acquire_bus(g);
set_backlight(g, 0xFF); // Turn off the back-light pwm from SSD1963
write_index(g, SSD1963_ENTER_SLEEP_MODE);
@ -332,7 +332,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

@ -229,7 +229,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;
@ -318,34 +318,34 @@ 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 powerDeepSleep:
switch((gPowermode)g->p.ptr) {
case gPowerOff:
case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0001); // Enter sleep mode
write_reg(g, SSD2119_REG_SLEEP_MODE_2, 0x2999); // Enable deep sleep function
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0000); // Display off
if ((powermode_t)g->p.ptr == powerOff)
if ((gPowermode)g->p.ptr == gPowerOff)
write_reg(g, SSD2119_REG_OSC_START, 0x0000); // Turn off oscillator
release_bus(g);
set_backlight(g, 0);
break;
case powerSleep:
case gPowerSleep:
acquire_bus(g);
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0001); // Enter sleep mode
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0000); // Display off
release_bus(g);
set_backlight(g, 0);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
if (g->g.Powermode == powerOff) {
if (g->g.Powermode == gPowerOff) {
write_reg(g, SSD2119_REG_OSC_START, 0x0001); // Start the oscillator
gfxSleepMicroseconds(5);
write_reg(g, SSD2119_REG_SLEEP_MODE_2, 0x0999); // Disable deep sleep function
} else if (g->g.Powermode == powerDeepSleep)
} else if (g->g.Powermode == gPowerDeepSleep)
write_reg(g, SSD2119_REG_SLEEP_MODE_2, 0x0999); // Disable deep sleep function
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0000); // Leave sleep mode
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0033); // Display on
@ -356,7 +356,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

@ -134,7 +134,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,17 +226,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_cmd(g, ST7565_DISPLAY_OFF);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_cmd(g, ST7565_DISPLAY_ON);
release_bus(g);
@ -244,7 +244,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

@ -261,7 +261,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;
@ -315,23 +315,23 @@ 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);
// not implemented
release_bus(g);
set_backlight(g, 0);
break;
case powerSleep:
case powerDeepSleep:
case gPowerSleep:
case gPowerDeepSleep:
// not implemented
acquire_bus(g);
release_bus(g);
set_backlight(g, 0);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
// not implemented
release_bus(g);
@ -340,7 +340,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

@ -288,7 +288,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
g->g.Width = ((ltdcLayerConfig *)g->priv)->width;
g->g.Height = ((ltdcLayerConfig *)g->priv)->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

@ -101,7 +101,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_TLS8204_WIDTH;
g->g.Height = GDISP_TLS8204_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;
@ -201,17 +201,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_cmd(g, TLS8204_SET_FUNC | TLS8204_PD_BIT);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_cmd(g, TLS8204_SET_FUNC);
release_bus(g);
@ -219,7 +219,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

@ -34,7 +34,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

@ -108,7 +108,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;
@ -206,17 +206,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_cmd(g, UC1601s_SET_EN);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g);
write_cmd(g, UC1601s_SET_EN | UC1601s_ENABLE);
release_bus(g);
@ -224,7 +224,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

@ -125,7 +125,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;
@ -217,24 +217,24 @@ 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) { return; }
switch((powermode_t)g->p.ptr) {
case powerOff:
if (g->g.Powermode == (gPowermode)g->p.ptr) { return; }
switch((gPowermode)g->p.ptr) {
case gPowerOff:
cmdBuffer[0] = UC1610_SYSTEM_RESET;
acquire_bus(g);
write_cmd(g, cmdBuffer, 1);
release_bus(g);
gfxSleepMilliseconds(2);
break;
case powerSleep:
case gPowerSleep:
cmdBuffer[0] = UC1610_SET_DISPLAY_ENABLE | 0;
acquire_bus(g);
write_cmd(g, cmdBuffer, 1);
release_bus(g);
gfxSleepMilliseconds(2);
break;
case powerOn:
if (g->g.Powermode == powerSleep) {
case gPowerOn:
if (g->g.Powermode == gPowerSleep) {
cmdBuffer[0] = UC1610_SET_DISPLAY_ENABLE | 1;
acquire_bus(g);
write_cmd(g, cmdBuffer, 1);
@ -250,7 +250,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

@ -299,7 +299,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
g->g.Width = UC8173_WIDTH;
g->g.Height = UC8173_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = 0;
g->g.Contrast = 0;

View File

@ -105,7 +105,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;
return gTrue;
}
@ -215,18 +215,18 @@ LLDSPEC void gdisp_lld_flush(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); // Put de display in deep sleep
write_reg(g, DISPLAY_UPDATE_CTRL2, 0x03);
write_reg(g, DEEP_SLEEP_MODE, 0x01);
release_bus(g);
break;
case powerOn:
case gPowerOn:
acquire_bus(g); // Awake the display again
write_reg(g, DISPLAY_UPDATE_CTRL2, 0xC0);
write_reg(g, DEEP_SLEEP_MODE, 0x00);
@ -235,7 +235,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

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

@ -45,7 +45,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);
@ -116,16 +116,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

@ -373,7 +373,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
gdriverRegister((const GDriverVMT *)GMOUSE_DRIVER_VMT, g);
#endif
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 50;

View File

@ -850,7 +850,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialise the GDISP structure
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Width = GDISP_SCREEN_WIDTH;

View File

@ -398,7 +398,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 = 100;
g->g.Contrast = 50;
g->g.Width = GDISP_SCREEN_WIDTH;

View File

@ -453,7 +453,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialise the GDISP structure
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Width = GDISP_SCREEN_WIDTH;
@ -653,7 +653,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
return;
break;
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
break;
case GDISP_CONTROL_BACKLIGHT:
@ -706,7 +706,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Orientation = (orientation_t)g->p.ptr;
break;
case GDISP_CONTROL_POWER:
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
break;
case GDISP_CONTROL_BACKLIGHT:
g->g.Backlight = (uint16_t)(int)g->p.ptr;

View File

@ -336,7 +336,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialise the GDISP structure
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Width = GDISP_SCREEN_WIDTH;
@ -536,7 +536,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
return;
break;
case GDISP_CONTROL_POWER:
if (g->g.Powermode == (powermode_t)g->p.ptr)
if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
break;
case GDISP_CONTROL_BACKLIGHT:
@ -589,7 +589,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Orientation = (orientation_t)g->p.ptr;
break;
case GDISP_CONTROL_POWER:
g->g.Powermode = (powermode_t)g->p.ptr;
g->g.Powermode = (gPowermode)g->p.ptr;
break;
case GDISP_CONTROL_BACKLIGHT:
g->g.Backlight = (uint16_t)(int)g->p.ptr;

View File

@ -711,7 +711,7 @@ unsigned gdispGetDisplayCount(void) {
gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; }
gCoord gdispGGetHeight(GDisplay *g) { return g->g.Height; }
powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
gPowermode gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
orientation_t 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; }

View File

@ -108,15 +108,15 @@ typedef enum orientation {
} orientation_t;
/**
* @enum powermode
* @enum gPowermode
* @brief Type for the available power modes for the screen.
*/
typedef enum powermode {
powerOff, /**< Turn the display off. */
powerSleep, /**< Put the display into sleep mode. */
powerDeepSleep, /**< Put the display into deep-sleep mode. */
powerOn /**< Turn the display on. */
} powermode_t;
typedef enum gPowermode {
gPowerOff, /**< Turn the display off. */
gPowerSleep, /**< Put the display into sleep mode. */
gPowerDeepSleep, /**< Put the display into deep-sleep mode. */
gPowerOn /**< Turn the display on. */
} gPowermode;
/*
* Our black box display structure.
@ -139,7 +139,7 @@ extern GDisplay *GDISP;
* @details Unsupported control codes are ignored.
* @note The value parameter should always be typecast to (void *).
* @note There are some predefined and some specific to the low level driver.
* @note GDISP_CONTROL_POWER - Takes a gdisp_powermode_t
* @note GDISP_CONTROL_POWER - Takes a gPowermode
* GDISP_CONTROL_ORIENTATION - Takes a gdisp_orientation_t
* GDISP_CONTROL_BACKLIGHT - Takes an int from 0 to 100. For a driver
* that only supports off/on anything other
@ -322,7 +322,7 @@ gCoord gdispGGetHeight(GDisplay *g);
*
* @api
*/
powermode_t gdispGGetPowerMode(GDisplay *g);
gPowermode gdispGGetPowerMode(GDisplay *g);
#define gdispGetPowerMode() gdispGGetPowerMode(GDISP)
/**
@ -740,7 +740,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
*/
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, gColor color);
#define gdispDrawThickArc(x,y,rs,re,s,e,c) gdispGDrawThickArc(GDISP,x,y,rs,re,s,e,c)
/**
* @brief Draw a filled arc.
* @pre GDISP_NEED_ARC must be GFXON in your gfxconf.h
@ -1102,7 +1102,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
* @api
*/
const char *gdispGetFontName(font_t font);
/**
* @brief Add a font permanently to the font list.
* @returns gTrue on success. Reasons it may fail: out of memory, if it is already on the list, it is not a font loaded in RAM.
@ -1167,8 +1167,8 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
*
* @api
*/
#define gdispGSetPowerMode(g, powerMode) gdispGControl((g), GDISP_CONTROL_POWER, (void *)(unsigned)(powerMode))
#define gdispSetPowerMode(powerMode) gdispGControl(GDISP, GDISP_CONTROL_POWER, (void *)(unsigned)(powerMode))
#define gdispGSetPowerMode(g, powerMode) gdispGControl((g), GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode))
#define gdispSetPowerMode(powerMode) gdispGControl(GDISP, GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode))
/**
* @brief Set the display orientation.
@ -1230,10 +1230,15 @@ 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 gPowermode powermode_t;
#define gPowerOff powerOff
#define gPowerDeepSleep powerDeepSleep
#define gPowerSleep powerSleep
#define gPowerOn powerOn
typedef gColor color_t;
typedef gPixel pixel_t;
typedef gCoord coord_t;
typedef gPoint point, point_t;
#endif
#endif /* GFX_USE_GDISP */

View File

@ -321,7 +321,7 @@ struct GDisplay {
gCoord Width;
gCoord Height;
orientation_t Orientation;
powermode_t Powermode;
gPowermode Powermode;
uint8_t Backlight;
uint8_t Contrast;
} g;

View File

@ -123,7 +123,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;
return gTrue;