Added type gPowermode to replace V2.x powermode_t, and values gPowerXXX replace powerXXX
This commit is contained in:
parent
f9c848e985
commit
bda8c738b1
@ -22,7 +22,7 @@
|
|||||||
(void) percent;
|
(void) percent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void board_power(GDisplay* g, powermode_t pwr)
|
static void board_power(GDisplay* g, gPowermode pwr)
|
||||||
{
|
{
|
||||||
(void) g;
|
(void) g;
|
||||||
(void) pwr;
|
(void) pwr;
|
||||||
|
@ -213,7 +213,7 @@
|
|||||||
(void) percent;
|
(void) percent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void board_power(GDisplay *g, powermode_t pwr) {
|
static void board_power(GDisplay *g, gPowermode pwr) {
|
||||||
(void) g;
|
(void) g;
|
||||||
(void) pwr;
|
(void) pwr;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
(void) percent;
|
(void) percent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void board_power(GDisplay *g, powermode_t pwr) {
|
static void board_power(GDisplay *g, gPowermode pwr) {
|
||||||
(void) g;
|
(void) g;
|
||||||
(void) pwr;
|
(void) pwr;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
(void) percent;
|
(void) percent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void board_power(GDisplay *g, powermode_t pwr) {
|
static void board_power(GDisplay *g, gPowermode pwr) {
|
||||||
// Not implemented yet.
|
// Not implemented yet.
|
||||||
(void) g;
|
(void) g;
|
||||||
(void) pwr;
|
(void) pwr;
|
||||||
|
@ -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 gCoord to replace V2.x coord_t
|
||||||
CHANGE: Added type gPixel to replace V2.x pixel_t
|
CHANGE: Added type gPixel to replace V2.x pixel_t
|
||||||
CHANGE: Added type gColor to replace V2.x color_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: Added gfxRealloc() to Qt port
|
||||||
FIX: Fixed UC1610 driver private area initialisation
|
FIX: Fixed UC1610 driver private area initialisation
|
||||||
FIX: Fixed ST7735 driver and added kapacuk changes
|
FIX: Fixed ST7735 driver and added kapacuk changes
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
(void)percent;
|
(void)percent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void board_power(GDisplay* g, powermode_t pwr)
|
static void board_power(GDisplay* g, gPowermode pwr)
|
||||||
{
|
{
|
||||||
(void)g;
|
(void)g;
|
||||||
(void)pwr;
|
(void)pwr;
|
||||||
|
@ -61,7 +61,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
|
|||||||
g->g.Backlight = 100;
|
g->g.Backlight = 100;
|
||||||
g->g.Contrast = 50;
|
g->g.Contrast = 50;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->board = 0;
|
g->board = 0;
|
||||||
PRIV(g)->linelen = g->g.Width * sizeof(LLDCOLOR_TYPE); // bytes per line
|
PRIV(g)->linelen = g->g.Width * sizeof(LLDCOLOR_TYPE); // bytes per line
|
||||||
PRIV(g)->pixels = PRIV(g)->frame0;
|
PRIV(g)->pixels = PRIV(g)->frame0;
|
||||||
@ -158,16 +158,16 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g)
|
|||||||
{
|
{
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff: case powerOn: case powerSleep: case powerDeepSleep:
|
case gPowerOff: case gPowerOn: case gPowerSleep: case gPowerDeepSleep:
|
||||||
board_power(g, (powermode_t)g->p.ptr);
|
board_power(g, (gPowermode)g->p.ptr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -449,7 +449,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = 100;
|
g->g.Backlight = 100;
|
||||||
g->g.Contrast = 100;
|
g->g.Contrast = 100;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -532,22 +532,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
gdisp_lld_flush(g);
|
gdisp_lld_flush(g);
|
||||||
power_off(g);
|
power_off(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
power_on(g);
|
power_on(g);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -42,7 +42,7 @@ command:
|
|||||||
|
|
||||||
The buffers are also flushed whenever you turn the display off using:
|
The buffers are also flushed whenever you turn the display off using:
|
||||||
|
|
||||||
gdispSetPowerMode(powerOff);
|
gdispSetPowerMode(gPowerOff);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
(void) percent;
|
(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
|
// TODO: Can be an empty function if your hardware doesn't support this
|
||||||
(void) g;
|
(void) g;
|
||||||
(void) pwr;
|
(void) pwr;
|
||||||
|
@ -49,7 +49,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
|
|
||||||
// Initialize the GDISP structure
|
// Initialize the GDISP structure
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->board = 0; // preinitialize
|
g->board = 0; // preinitialize
|
||||||
board_init(g, &((fbPriv *)g->priv)->fbi);
|
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) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff: case powerOn: case powerSleep: case powerDeepSleep:
|
case gPowerOff: case gPowerOn: case gPowerSleep: case gPowerDeepSleep:
|
||||||
board_power(g, (powermode_t)g->p.ptr);
|
board_power(g, (gPowermode)g->p.ptr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -149,7 +149,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
|
@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -254,10 +254,10 @@ LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, ILI9225_DISP_CTRL1, 0x0000); // Display off
|
write_reg(g, ILI9225_DISP_CTRL1, 0x0000); // Display off
|
||||||
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
|
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
|
||||||
@ -268,8 +268,8 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
|||||||
release_bus();
|
release_bus();
|
||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, ILI9225_DISP_CTRL1, 0x0000); // Display off
|
write_reg(g, ILI9225_DISP_CTRL1, 0x0000); // Display off
|
||||||
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
|
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);
|
release_bus(g);
|
||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
|
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
|
||||||
write_reg(g, ILI9225_POWER_CTRL2, 0x0000); // Set APON,PON,AON,VCI1EN,VC
|
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:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -187,7 +187,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -238,10 +238,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000);
|
write_reg(g, 0x07, 0x0000);
|
||||||
write_reg(g, 0x10, 0x0000);
|
write_reg(g, 0x10, 0x0000);
|
||||||
@ -253,7 +253,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
//*************Power On sequence ******************//
|
//*************Power On sequence ******************//
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
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);
|
set_backlight(g, g->g.Backlight);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -185,7 +185,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
@ -232,10 +232,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000);
|
write_reg(g, 0x07, 0x0000);
|
||||||
write_reg(g, 0x10, 0x0000);
|
write_reg(g, 0x10, 0x0000);
|
||||||
@ -246,7 +246,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
//*************Power On sequence ******************//
|
//*************Power On sequence ******************//
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
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);
|
set_backlight(g, g->g.Backlight);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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);
|
gdisp_lld_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -228,7 +228,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -272,17 +272,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
|
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
|
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -290,7 +290,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -232,7 +232,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -276,17 +276,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
|
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
|
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -294,7 +294,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -257,7 +257,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
@ -305,10 +305,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000);
|
write_reg(g, 0x07, 0x0000);
|
||||||
write_reg(g, 0x10, 0x0000);
|
write_reg(g, 0x10, 0x0000);
|
||||||
@ -319,7 +319,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
//*************Power On sequence ******************//
|
//*************Power On sequence ******************//
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
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);
|
set_backlight(g, g->g.Backlight);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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);
|
set_backlight(g, g->g.Backlight);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -194,7 +194,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -236,22 +236,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
|
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
|
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
if (g->g.Powermode != powerSleep)
|
if (g->g.Powermode != gPowerSleep)
|
||||||
gdisp_lld_init(g);
|
gdisp_lld_init(g);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
|
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -259,7 +259,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -190,7 +190,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
@ -237,11 +237,11 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, 0x28);
|
write_index(g, 0x28);
|
||||||
gfxSleepMilliseconds(10);
|
gfxSleepMilliseconds(10);
|
||||||
@ -249,17 +249,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, 0x11);
|
write_index(g, 0x11);
|
||||||
gfxSleepMilliseconds(120);
|
gfxSleepMilliseconds(120);
|
||||||
write_index(g, 0x29);
|
write_index(g, 0x29);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
if (g->g.Powermode != powerSleep)
|
if (g->g.Powermode != gPowerSleep)
|
||||||
gdisp_lld_init(g);
|
gdisp_lld_init(g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, 0x28);
|
write_index(g, 0x28);
|
||||||
gfxSleepMilliseconds(10);
|
gfxSleepMilliseconds(10);
|
||||||
@ -271,7 +271,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -135,7 +135,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
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) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, 0x28);
|
write_index(g, 0x28);
|
||||||
gfxSleepMilliseconds(10);
|
gfxSleepMilliseconds(10);
|
||||||
@ -237,17 +237,17 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
|||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, 0x11);
|
write_index(g, 0x11);
|
||||||
gfxSleepMilliseconds(120);
|
gfxSleepMilliseconds(120);
|
||||||
write_index(g, 0x29);
|
write_index(g, 0x29);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
if (g->g.Powermode != powerSleep)
|
if (g->g.Powermode != gPowerSleep)
|
||||||
gdisp_lld_init(g);
|
gdisp_lld_init(g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, 0x28);
|
write_index(g, 0x28);
|
||||||
gfxSleepMilliseconds(10);
|
gfxSleepMilliseconds(10);
|
||||||
@ -259,7 +259,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -179,7 +179,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
@ -226,10 +226,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000);
|
write_reg(g, 0x07, 0x0000);
|
||||||
write_reg(g, 0x10, 0x0000);
|
write_reg(g, 0x10, 0x0000);
|
||||||
@ -240,7 +240,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
//*************Power On sequence ******************//
|
//*************Power On sequence ******************//
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
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);
|
set_backlight(g, g->g.Backlight);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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);
|
set_backlight(g, g->g.Backlight);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -126,7 +126,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -172,22 +172,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
*/
|
*/
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, SLEEPIN);
|
write_index(g, SLEEPIN);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, SLEEPOUT);
|
write_index(g, SLEEPOUT);
|
||||||
delayms(20);
|
delayms(20);
|
||||||
write_index(g, NORON); // Set Normal mode (my)
|
write_index(g, NORON); // Set Normal mode (my)
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, SLEEPOUT);
|
write_index(g, SLEEPOUT);
|
||||||
delayms(20);
|
delayms(20);
|
||||||
@ -198,7 +198,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -240,7 +240,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
|
|
||||||
/* Initialise the GDISP structure to match */
|
/* Initialise the GDISP structure to match */
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
@ -493,18 +493,18 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
*/
|
*/
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
set_backlight(g, 0); // Turn off the backlight
|
set_backlight(g, 0); // Turn off the backlight
|
||||||
write_index(g, DISOFF); // Turn off the display
|
write_index(g, DISOFF); // Turn off the display
|
||||||
write_cmd1(g, PWRCTR, 0x00); // Power control - all off
|
write_cmd1(g, PWRCTR, 0x00); // Power control - all off
|
||||||
write_index(g, SLPIN); // Sleep in
|
write_index(g, SLPIN); // Sleep in
|
||||||
write_index(g, OSCOFF); // Internal oscillator off
|
write_index(g, OSCOFF); // Internal oscillator off
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
write_index(g, OSCON); // Internal oscillator on
|
write_index(g, OSCON); // Internal oscillator on
|
||||||
write_index(g, SLPOUT); // Sleep out
|
write_index(g, SLPOUT); // Sleep out
|
||||||
write_cmd1(g, PWRCTR, 0x0F); // Power control - reference voltage regulator on, circuit voltage follower on, BOOST ON
|
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
|
write_index(g, PTLOUT); // Remove sleep window
|
||||||
set_backlight(g, g->g.Backlight); // Turn on the backlight
|
set_backlight(g, g->g.Backlight); // Turn on the backlight
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
write_index(g, OSCON); // Internal oscillator on
|
write_index(g, OSCON); // Internal oscillator on
|
||||||
write_index(g, SLPOUT); // Sleep out
|
write_index(g, SLPOUT); // Sleep out
|
||||||
write_cmd1(g, PWRCTR, 0x0F); // Power control - reference voltage regulator on, circuit voltage follower on, BOOST ON
|
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
|
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
|
set_backlight(g, g->g.Backlight); // Turn on the backlight
|
||||||
break;
|
break;
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
write_index(g, OSCON); // Internal oscillator on
|
write_index(g, OSCON); // Internal oscillator on
|
||||||
write_index(g, SLPOUT); // Sleep out
|
write_index(g, SLPOUT); // Sleep out
|
||||||
write_cmd1(g, PWRCTR, 0x0F); // Power control - reference voltage regulator on, circuit voltage follower on, BOOST ON
|
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;
|
return;
|
||||||
}
|
}
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
#if GDISP_NOKIA_ORIENTATION
|
#if GDISP_NOKIA_ORIENTATION
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -87,7 +87,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
@ -185,21 +185,21 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
write_cmd(g, PCD8544_SET_FUNC | PCD8544_PD);
|
write_cmd(g, PCD8544_SET_FUNC | PCD8544_PD);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
write_cmd(g, PCD8544_SET_FUNC);
|
write_cmd(g, PCD8544_SET_FUNC);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -97,7 +97,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
@ -195,21 +195,21 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
write_cmd(g, PCF8812_SET_FUNC | PCF8812_PD);
|
write_cmd(g, PCF8812_SET_FUNC | PCF8812_PD);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
write_cmd(g, PCF8812_SET_FUNC);
|
write_cmd(g, PCF8812_SET_FUNC);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -40,7 +40,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g)
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -246,10 +246,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000);
|
write_reg(g, 0x07, 0x0000);
|
||||||
write_reg(g, 0x10, 0x0000);
|
write_reg(g, 0x10, 0x0000);
|
||||||
@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
//*************Power On sequence ******************//
|
//*************Power On sequence ******************//
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
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);
|
set_backlight(g, g->g.Backlight);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x07, 0x0000); /* display OFF */
|
write_reg(g, 0x07, 0x0000); /* display OFF */
|
||||||
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
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:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -203,7 +203,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
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) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, 0x28);
|
write_index(g, 0x28);
|
||||||
gfxSleepMilliseconds(10);
|
gfxSleepMilliseconds(10);
|
||||||
@ -323,17 +323,17 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
|||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, 0x11);
|
write_index(g, 0x11);
|
||||||
gfxSleepMilliseconds(120);
|
gfxSleepMilliseconds(120);
|
||||||
write_index(g, 0x29);
|
write_index(g, 0x29);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
if (g->g.Powermode != powerSleep)
|
if (g->g.Powermode != gPowerSleep)
|
||||||
gdisp_lld_init(g);
|
gdisp_lld_init(g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, 0x28);
|
write_index(g, 0x28);
|
||||||
gfxSleepMilliseconds(10);
|
gfxSleepMilliseconds(10);
|
||||||
@ -345,7 +345,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -167,7 +167,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -194,20 +194,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
#if 0
|
#if 0
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
// TODO
|
// TODO
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
// TODO
|
// TODO
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
// TODO
|
// TODO
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -215,7 +215,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -251,20 +251,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
#if 0
|
#if 0
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
// TODO
|
// TODO
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
// TODO
|
// TODO
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
// TODO
|
// TODO
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -272,7 +272,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g)
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
@ -175,17 +175,17 @@ LLDSPEC void gdisp_lld_control(GDisplay *g)
|
|||||||
|
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, SPFD54124B_CMD_SLPIN);
|
write_index(g, SPFD54124B_CMD_SLPIN);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, SPFD54124B_CMD_SLPOUT);
|
write_index(g, SPFD54124B_CMD_SLPOUT);
|
||||||
delayms(20);
|
delayms(20);
|
||||||
@ -193,7 +193,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g)
|
|||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, SPFD54124B_CMD_SLPOUT);
|
write_index(g, SPFD54124B_CMD_SLPOUT);
|
||||||
delayms(20);
|
delayms(20);
|
||||||
@ -204,7 +204,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -188,7 +188,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -280,10 +280,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x10, 0x0000); // leave sleep mode
|
write_reg(g, 0x10, 0x0000); // leave sleep mode
|
||||||
write_reg(g, 0x07, 0x0000); // halt operation
|
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
|
write_reg(g, 0x10, 0x0001); // enter sleep mode
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x10, 0x0000); // leave sleep mode
|
write_reg(g, 0x10, 0x0000); // leave sleep mode
|
||||||
write_reg(g, 0x00, 0x0001); // turn on oscillator
|
write_reg(g, 0x00, 0x0001); // turn on oscillator
|
||||||
gfxSleepMicroseconds(5);
|
gfxSleepMicroseconds(5);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, 0x10, 0x0001); // enter sleep mode
|
write_reg(g, 0x10, 0x0001); // enter sleep mode
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -306,7 +306,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -131,7 +131,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -296,17 +296,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, SSD1306_DISPLAYOFF);
|
write_cmd(g, SSD1306_DISPLAYOFF);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, SSD1306_DISPLAYON);
|
write_cmd(g, SSD1306_DISPLAYON);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -314,7 +314,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -149,7 +149,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_180;
|
g->g.Orientation = GDISP_ROTATE_180;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -251,17 +251,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, CMD_SET_DISPLAY_MODE_OFF);
|
write_cmd(g, CMD_SET_DISPLAY_MODE_OFF);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, CMD_SET_DISPLAY_MODE_ON);
|
write_cmd(g, CMD_SET_DISPLAY_MODE_ON);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -269,7 +269,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -121,7 +121,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -246,17 +246,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, SSD1331_DISPLAY_OFF);
|
write_cmd(g, SSD1331_DISPLAY_OFF);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, SSD1331_DISPLAY_ON);
|
write_cmd(g, SSD1331_DISPLAY_ON);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -264,7 +264,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -132,7 +132,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -187,17 +187,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
//TODO
|
//TODO
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
//TODO
|
//TODO
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -205,7 +205,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -214,7 +214,7 @@ LLDSPEC gBool gdisp_lld_init (GDisplay *g)
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -471,11 +471,11 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
|
|||||||
switch (g->p.x)
|
switch (g->p.x)
|
||||||
{
|
{
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t) g->p.ptr)
|
if (g->g.Powermode == (gPowermode) g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch ((powermode_t) g->p.ptr)
|
switch ((gPowermode) g->p.ptr)
|
||||||
{
|
{
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus (g);
|
acquire_bus (g);
|
||||||
spi_write_cmd (g, SSD1848_SETCONTRAST);
|
spi_write_cmd (g, SSD1848_SETCONTRAST);
|
||||||
spi_write_data2 (g, 0x00, 0x00); /* Drop the contrast & gain */
|
spi_write_data2 (g, 0x00, 0x00); /* Drop the contrast & gain */
|
||||||
@ -484,14 +484,14 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
|
|||||||
release_bus (g);
|
release_bus (g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus (g);
|
acquire_bus (g);
|
||||||
spi_write_cmd (g, SSD1848_ENTERSLEEP);
|
spi_write_cmd (g, SSD1848_ENTERSLEEP);
|
||||||
release_bus (g);
|
release_bus (g);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus (g);
|
acquire_bus (g);
|
||||||
spi_write_cmd (g, SSD1848_EXITSLEEP); /* need this in case we were in 'normal' sleep mode */
|
spi_write_cmd (g, SSD1848_EXITSLEEP); /* need this in case we were in 'normal' sleep mode */
|
||||||
gfxSleepMilliseconds (5);
|
gfxSleepMilliseconds (5);
|
||||||
@ -502,7 +502,7 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t) g->p.ptr;
|
g->g.Powermode = (gPowermode) g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -268,7 +268,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = lcdp->width;
|
g->g.Width = lcdp->width;
|
||||||
g->g.Height = lcdp->height;
|
g->g.Height = lcdp->height;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -291,10 +291,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_index(g, SSD1963_EXIT_SLEEP_MODE);
|
write_index(g, SSD1963_EXIT_SLEEP_MODE);
|
||||||
gfxSleepMilliseconds(5);
|
gfxSleepMilliseconds(5);
|
||||||
@ -302,7 +302,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
write_index(g, SSD1963_SET_DEEP_SLEEP);
|
write_index(g, SSD1963_SET_DEEP_SLEEP);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
setreadmode(g);
|
setreadmode(g);
|
||||||
dummy_read(g);
|
dummy_read(g);
|
||||||
@ -315,14 +315,14 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
set_backlight(g, gdispGGetBacklight(g)); // Restore the back-light
|
set_backlight(g, gdispGGetBacklight(g)); // Restore the back-light
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
set_backlight(g, 0xFF); // Turn off the back-light pwm from SSD1963
|
set_backlight(g, 0xFF); // Turn off the back-light pwm from SSD1963
|
||||||
write_index(g, SSD1963_ENTER_SLEEP_MODE);
|
write_index(g, SSD1963_ENTER_SLEEP_MODE);
|
||||||
gfxSleepMilliseconds(5);
|
gfxSleepMilliseconds(5);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
set_backlight(g, 0xFF); // Turn off the back-light pwm from SSD1963
|
set_backlight(g, 0xFF); // Turn off the back-light pwm from SSD1963
|
||||||
write_index(g, SSD1963_ENTER_SLEEP_MODE);
|
write_index(g, SSD1963_ENTER_SLEEP_MODE);
|
||||||
@ -332,7 +332,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -229,7 +229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -318,34 +318,34 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0001); // Enter sleep mode
|
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_SLEEP_MODE_2, 0x2999); // Enable deep sleep function
|
||||||
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0000); // Display off
|
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
|
write_reg(g, SSD2119_REG_OSC_START, 0x0000); // Turn off oscillator
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0001); // Enter sleep mode
|
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0001); // Enter sleep mode
|
||||||
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0000); // Display off
|
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0000); // Display off
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
if (g->g.Powermode == powerOff) {
|
if (g->g.Powermode == gPowerOff) {
|
||||||
write_reg(g, SSD2119_REG_OSC_START, 0x0001); // Start the oscillator
|
write_reg(g, SSD2119_REG_OSC_START, 0x0001); // Start the oscillator
|
||||||
gfxSleepMicroseconds(5);
|
gfxSleepMicroseconds(5);
|
||||||
write_reg(g, SSD2119_REG_SLEEP_MODE_2, 0x0999); // Disable deep sleep function
|
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_2, 0x0999); // Disable deep sleep function
|
||||||
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0000); // Leave sleep mode
|
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0000); // Leave sleep mode
|
||||||
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0033); // Display on
|
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0033); // Display on
|
||||||
@ -356,7 +356,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -134,7 +134,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
@ -226,17 +226,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, ST7565_DISPLAY_OFF);
|
write_cmd(g, ST7565_DISPLAY_OFF);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, ST7565_DISPLAY_ON);
|
write_cmd(g, ST7565_DISPLAY_ON);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -244,7 +244,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -315,23 +315,23 @@ LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
// not implemented
|
// not implemented
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
// not implemented
|
// not implemented
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
set_backlight(g, 0);
|
set_backlight(g, 0);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
// not implemented
|
// not implemented
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -340,7 +340,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -288,7 +288,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
|
|||||||
g->g.Width = ((ltdcLayerConfig *)g->priv)->width;
|
g->g.Width = ((ltdcLayerConfig *)g->priv)->width;
|
||||||
g->g.Height = ((ltdcLayerConfig *)g->priv)->height;
|
g->g.Height = ((ltdcLayerConfig *)g->priv)->height;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_TLS8204_WIDTH;
|
g->g.Width = GDISP_TLS8204_WIDTH;
|
||||||
g->g.Height = GDISP_TLS8204_HEIGHT;
|
g->g.Height = GDISP_TLS8204_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
|
|
||||||
@ -201,17 +201,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, TLS8204_SET_FUNC | TLS8204_PD_BIT);
|
write_cmd(g, TLS8204_SET_FUNC | TLS8204_PD_BIT);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, TLS8204_SET_FUNC);
|
write_cmd(g, TLS8204_SET_FUNC);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -34,7 +34,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
|
@ -108,7 +108,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -206,17 +206,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, UC1601s_SET_EN);
|
write_cmd(g, UC1601s_SET_EN);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, UC1601s_SET_EN | UC1601s_ENABLE);
|
write_cmd(g, UC1601s_SET_EN | UC1601s_ENABLE);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
@ -224,7 +224,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -125,7 +125,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
@ -217,24 +217,24 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr) { return; }
|
if (g->g.Powermode == (gPowermode)g->p.ptr) { return; }
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
cmdBuffer[0] = UC1610_SYSTEM_RESET;
|
cmdBuffer[0] = UC1610_SYSTEM_RESET;
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, cmdBuffer, 1);
|
write_cmd(g, cmdBuffer, 1);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
gfxSleepMilliseconds(2);
|
gfxSleepMilliseconds(2);
|
||||||
break;
|
break;
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
cmdBuffer[0] = UC1610_SET_DISPLAY_ENABLE | 0;
|
cmdBuffer[0] = UC1610_SET_DISPLAY_ENABLE | 0;
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, cmdBuffer, 1);
|
write_cmd(g, cmdBuffer, 1);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
gfxSleepMilliseconds(2);
|
gfxSleepMilliseconds(2);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
if (g->g.Powermode == powerSleep) {
|
if (g->g.Powermode == gPowerSleep) {
|
||||||
cmdBuffer[0] = UC1610_SET_DISPLAY_ENABLE | 1;
|
cmdBuffer[0] = UC1610_SET_DISPLAY_ENABLE | 1;
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
write_cmd(g, cmdBuffer, 1);
|
write_cmd(g, cmdBuffer, 1);
|
||||||
@ -250,7 +250,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -299,7 +299,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
|
|||||||
g->g.Width = UC8173_WIDTH;
|
g->g.Width = UC8173_WIDTH;
|
||||||
g->g.Height = UC8173_HEIGHT;
|
g->g.Height = UC8173_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = 0;
|
g->g.Backlight = 0;
|
||||||
g->g.Contrast = 0;
|
g->g.Contrast = 0;
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,18 +215,18 @@ LLDSPEC void gdisp_lld_flush(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff:
|
case gPowerOff:
|
||||||
case powerSleep:
|
case gPowerSleep:
|
||||||
case powerDeepSleep:
|
case gPowerDeepSleep:
|
||||||
acquire_bus(g); // Put de display in deep sleep
|
acquire_bus(g); // Put de display in deep sleep
|
||||||
write_reg(g, DISPLAY_UPDATE_CTRL2, 0x03);
|
write_reg(g, DISPLAY_UPDATE_CTRL2, 0x03);
|
||||||
write_reg(g, DEEP_SLEEP_MODE, 0x01);
|
write_reg(g, DEEP_SLEEP_MODE, 0x01);
|
||||||
release_bus(g);
|
release_bus(g);
|
||||||
break;
|
break;
|
||||||
case powerOn:
|
case gPowerOn:
|
||||||
acquire_bus(g); // Awake the display again
|
acquire_bus(g); // Awake the display again
|
||||||
write_reg(g, DISPLAY_UPDATE_CTRL2, 0xC0);
|
write_reg(g, DISPLAY_UPDATE_CTRL2, 0xC0);
|
||||||
write_reg(g, DEEP_SLEEP_MODE, 0x00);
|
write_reg(g, DEEP_SLEEP_MODE, 0x00);
|
||||||
@ -235,7 +235,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
(void) percent;
|
(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
|
// TODO: Can be an empty function if your hardware doesn't support this
|
||||||
(void) g;
|
(void) g;
|
||||||
(void) pwr;
|
(void) pwr;
|
||||||
|
@ -45,7 +45,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
|
|
||||||
// Initialize the GDISP structure
|
// Initialize the GDISP structure
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->board = 0; // preinitialize
|
g->board = 0; // preinitialize
|
||||||
board_init(g, &((fbPriv *)g->priv)->fbi);
|
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) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch(g->p.x) {
|
switch(g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
switch((powermode_t)g->p.ptr) {
|
switch((gPowermode)g->p.ptr) {
|
||||||
case powerOff: case powerOn: case powerSleep: case powerDeepSleep:
|
case gPowerOff: case gPowerOn: case gPowerSleep: case gPowerDeepSleep:
|
||||||
board_power(g, (powermode_t)g->p.ptr);
|
board_power(g, (gPowermode)g->p.ptr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
|
@ -373,7 +373,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
gdriverRegister((const GDriverVMT *)GMOUSE_DRIVER_VMT, g);
|
gdriverRegister((const GDriverVMT *)GMOUSE_DRIVER_VMT, g);
|
||||||
#endif
|
#endif
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = 100;
|
g->g.Backlight = 100;
|
||||||
|
|
||||||
g->g.Contrast = 50;
|
g->g.Contrast = 50;
|
||||||
|
@ -850,7 +850,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
|
|
||||||
// Initialise the GDISP structure
|
// Initialise the GDISP structure
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = 100;
|
g->g.Backlight = 100;
|
||||||
g->g.Contrast = 50;
|
g->g.Contrast = 50;
|
||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
|
@ -398,7 +398,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
|
|
||||||
/* Initialise the GDISP structure to match */
|
/* Initialise the GDISP structure to match */
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = 100;
|
g->g.Backlight = 100;
|
||||||
g->g.Contrast = 50;
|
g->g.Contrast = 50;
|
||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
|
@ -453,7 +453,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
|
|
||||||
// Initialise the GDISP structure
|
// Initialise the GDISP structure
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = 100;
|
g->g.Backlight = 100;
|
||||||
g->g.Contrast = 50;
|
g->g.Contrast = 50;
|
||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
@ -653,7 +653,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case GDISP_CONTROL_BACKLIGHT:
|
case GDISP_CONTROL_BACKLIGHT:
|
||||||
@ -706,7 +706,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Orientation = (orientation_t)g->p.ptr;
|
g->g.Orientation = (orientation_t)g->p.ptr;
|
||||||
break;
|
break;
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
break;
|
break;
|
||||||
case GDISP_CONTROL_BACKLIGHT:
|
case GDISP_CONTROL_BACKLIGHT:
|
||||||
g->g.Backlight = (uint16_t)(int)g->p.ptr;
|
g->g.Backlight = (uint16_t)(int)g->p.ptr;
|
||||||
|
@ -336,7 +336,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
|
|
||||||
// Initialise the GDISP structure
|
// Initialise the GDISP structure
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->g.Backlight = 100;
|
g->g.Backlight = 100;
|
||||||
g->g.Contrast = 50;
|
g->g.Contrast = 50;
|
||||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
@ -536,7 +536,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (gPowermode)g->p.ptr)
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case GDISP_CONTROL_BACKLIGHT:
|
case GDISP_CONTROL_BACKLIGHT:
|
||||||
@ -589,7 +589,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Orientation = (orientation_t)g->p.ptr;
|
g->g.Orientation = (orientation_t)g->p.ptr;
|
||||||
break;
|
break;
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
g->g.Powermode = (powermode_t)g->p.ptr;
|
g->g.Powermode = (gPowermode)g->p.ptr;
|
||||||
break;
|
break;
|
||||||
case GDISP_CONTROL_BACKLIGHT:
|
case GDISP_CONTROL_BACKLIGHT:
|
||||||
g->g.Backlight = (uint16_t)(int)g->p.ptr;
|
g->g.Backlight = (uint16_t)(int)g->p.ptr;
|
||||||
|
@ -711,7 +711,7 @@ unsigned gdispGetDisplayCount(void) {
|
|||||||
|
|
||||||
gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; }
|
gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; }
|
||||||
gCoord gdispGGetHeight(GDisplay *g) { return g->g.Height; }
|
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; }
|
orientation_t gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; }
|
||||||
uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; }
|
uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; }
|
||||||
uint8_t gdispGGetContrast(GDisplay *g) { return g->g.Contrast; }
|
uint8_t gdispGGetContrast(GDisplay *g) { return g->g.Contrast; }
|
||||||
|
@ -108,15 +108,15 @@ typedef enum orientation {
|
|||||||
} orientation_t;
|
} orientation_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum powermode
|
* @enum gPowermode
|
||||||
* @brief Type for the available power modes for the screen.
|
* @brief Type for the available power modes for the screen.
|
||||||
*/
|
*/
|
||||||
typedef enum powermode {
|
typedef enum gPowermode {
|
||||||
powerOff, /**< Turn the display off. */
|
gPowerOff, /**< Turn the display off. */
|
||||||
powerSleep, /**< Put the display into sleep mode. */
|
gPowerSleep, /**< Put the display into sleep mode. */
|
||||||
powerDeepSleep, /**< Put the display into deep-sleep mode. */
|
gPowerDeepSleep, /**< Put the display into deep-sleep mode. */
|
||||||
powerOn /**< Turn the display on. */
|
gPowerOn /**< Turn the display on. */
|
||||||
} powermode_t;
|
} gPowermode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Our black box display structure.
|
* Our black box display structure.
|
||||||
@ -139,7 +139,7 @@ extern GDisplay *GDISP;
|
|||||||
* @details Unsupported control codes are ignored.
|
* @details Unsupported control codes are ignored.
|
||||||
* @note The value parameter should always be typecast to (void *).
|
* @note The value parameter should always be typecast to (void *).
|
||||||
* @note There are some predefined and some specific to the low level driver.
|
* @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_ORIENTATION - Takes a gdisp_orientation_t
|
||||||
* GDISP_CONTROL_BACKLIGHT - Takes an int from 0 to 100. For a driver
|
* GDISP_CONTROL_BACKLIGHT - Takes an int from 0 to 100. For a driver
|
||||||
* that only supports off/on anything other
|
* that only supports off/on anything other
|
||||||
@ -322,7 +322,7 @@ gCoord gdispGGetHeight(GDisplay *g);
|
|||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
powermode_t gdispGGetPowerMode(GDisplay *g);
|
gPowermode gdispGGetPowerMode(GDisplay *g);
|
||||||
#define gdispGetPowerMode() gdispGGetPowerMode(GDISP)
|
#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);
|
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)
|
#define gdispDrawThickArc(x,y,rs,re,s,e,c) gdispGDrawThickArc(GDISP,x,y,rs,re,s,e,c)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Draw a filled arc.
|
* @brief Draw a filled arc.
|
||||||
* @pre GDISP_NEED_ARC must be GFXON in your gfxconf.h
|
* @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
|
* @api
|
||||||
*/
|
*/
|
||||||
const char *gdispGetFontName(font_t font);
|
const char *gdispGetFontName(font_t font);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a font permanently to the font list.
|
* @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.
|
* @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
|
* @api
|
||||||
*/
|
*/
|
||||||
#define gdispGSetPowerMode(g, powerMode) gdispGControl((g), 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 *)(unsigned)(powerMode))
|
#define gdispSetPowerMode(powerMode) gdispGControl(GDISP, GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the display orientation.
|
* @brief Set the display orientation.
|
||||||
@ -1230,10 +1230,15 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
|
|||||||
|
|
||||||
/* V2 compatibility */
|
/* V2 compatibility */
|
||||||
#if GFX_COMPAT_V2
|
#if GFX_COMPAT_V2
|
||||||
typedef gColor color_t;
|
typedef gPowermode powermode_t;
|
||||||
typedef gPixel pixel_t;
|
#define gPowerOff powerOff
|
||||||
typedef gCoord coord_t;
|
#define gPowerDeepSleep powerDeepSleep
|
||||||
typedef gPoint point, point_t;
|
#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
|
||||||
|
|
||||||
#endif /* GFX_USE_GDISP */
|
#endif /* GFX_USE_GDISP */
|
||||||
|
@ -321,7 +321,7 @@ struct GDisplay {
|
|||||||
gCoord Width;
|
gCoord Width;
|
||||||
gCoord Height;
|
gCoord Height;
|
||||||
orientation_t Orientation;
|
orientation_t Orientation;
|
||||||
powermode_t Powermode;
|
gPowermode Powermode;
|
||||||
uint8_t Backlight;
|
uint8_t Backlight;
|
||||||
uint8_t Contrast;
|
uint8_t Contrast;
|
||||||
} g;
|
} g;
|
||||||
|
@ -123,7 +123,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
|||||||
g->g.Backlight = 100;
|
g->g.Backlight = 100;
|
||||||
g->g.Contrast = 50;
|
g->g.Contrast = 50;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
g->g.Powermode = powerOn;
|
g->g.Powermode = gPowerOn;
|
||||||
g->board = 0;
|
g->board = 0;
|
||||||
|
|
||||||
return gTrue;
|
return gTrue;
|
||||||
|
Loading…
Reference in New Issue
Block a user