aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boards/base/Altera-MAX10-Neek/board_alteraframereader.h2
-rw-r--r--boards/base/Linux-Framebuffer/board_framebuffer.h2
-rw-r--r--boards/base/RaspberryPi/board_framebuffer.h2
-rw-r--r--boards/base/eCos-Synthetic-Framebuffer/board_framebuffer.h2
-rw-r--r--changelog.txt1
-rw-r--r--drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h2
-rw-r--r--drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c12
-rw-r--r--drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c16
-rw-r--r--drivers/gdisp/ED060SC4/readme.txt2
-rw-r--r--drivers/gdisp/Fb24bpp/board_fb24bpp_template.h2
-rw-r--r--drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c12
-rw-r--r--drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c2
-rw-r--r--drivers/gdisp/ILI9225/gdisp_lld_ili9225.c16
-rw-r--r--drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c16
-rw-r--r--drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c16
-rw-r--r--drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c16
-rw-r--r--drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c16
-rw-r--r--drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c16
-rw-r--r--drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c16
-rw-r--r--drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c16
-rw-r--r--drivers/gdisp/KS0108/gdisp_lld_KS0108.c16
-rw-r--r--drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c16
-rw-r--r--drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c14
-rw-r--r--drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c16
-rw-r--r--drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c16
-rw-r--r--drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c16
-rw-r--r--drivers/gdisp/QImage/gdisp_lld_driver.c2
-rw-r--r--drivers/gdisp/R61505U/gdisp_lld_R61505U.c16
-rwxr-xr-xdrivers/gdisp/RA6963/gdisp_lld_RA6963.c16
-rw-r--r--drivers/gdisp/RA8875/gdisp_lld_RA8875.c14
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c14
-rw-r--r--drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c14
-rw-r--r--drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c14
-rw-r--r--drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c16
-rw-r--r--drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c16
-rw-r--r--drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c16
-rw-r--r--drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c16
-rw-r--r--drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c16
-rw-r--r--drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c16
-rw-r--r--drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c22
-rw-r--r--drivers/gdisp/ST7565/gdisp_lld_ST7565.c16
-rw-r--r--drivers/gdisp/ST7735/gdisp_lld_ST7735.c16
-rw-r--r--drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c2
-rw-r--r--drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c16
-rw-r--r--drivers/gdisp/TestStub/gdisp_lld_TestStub.c2
-rw-r--r--drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c16
-rw-r--r--drivers/gdisp/UC1610/gdisp_lld_UC1610.c16
-rw-r--r--drivers/gdisp/UC8173/gdisp_lld_UC8173.c2
-rw-r--r--drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c16
-rw-r--r--drivers/gdisp/framebuffer/board_framebuffer_template.h2
-rw-r--r--drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c12
-rw-r--r--drivers/multiple/SDL/gdisp_lld_SDL.c2
-rw-r--r--drivers/multiple/Win32/gdisp_lld_Win32.c2
-rw-r--r--drivers/multiple/X/gdisp_lld_X.c2
-rw-r--r--drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c6
-rw-r--r--drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp6
-rw-r--r--src/gdisp/gdisp.c2
-rw-r--r--src/gdisp/gdisp.h39
-rw-r--r--src/gdisp/gdisp_driver.h2
-rw-r--r--src/gdisp/gdisp_pixmap.c2
60 files changed, 336 insertions, 330 deletions
diff --git a/boards/base/Altera-MAX10-Neek/board_alteraframereader.h b/boards/base/Altera-MAX10-Neek/board_alteraframereader.h
index af6dca82..9bb45ec0 100644
--- a/boards/base/Altera-MAX10-Neek/board_alteraframereader.h
+++ b/boards/base/Altera-MAX10-Neek/board_alteraframereader.h
@@ -22,7 +22,7 @@
(void) percent;
}
- static void board_power(GDisplay* g, powermode_t pwr)
+ static void board_power(GDisplay* g, gPowermode pwr)
{
(void) g;
(void) pwr;
diff --git a/boards/base/Linux-Framebuffer/board_framebuffer.h b/boards/base/Linux-Framebuffer/board_framebuffer.h
index 2417feda..f13e0ff0 100644
--- a/boards/base/Linux-Framebuffer/board_framebuffer.h
+++ b/boards/base/Linux-Framebuffer/board_framebuffer.h
@@ -213,7 +213,7 @@
(void) percent;
}
- static void board_power(GDisplay *g, powermode_t pwr) {
+ static void board_power(GDisplay *g, gPowermode pwr) {
(void) g;
(void) pwr;
}
diff --git a/boards/base/RaspberryPi/board_framebuffer.h b/boards/base/RaspberryPi/board_framebuffer.h
index eeefeb06..61b661c7 100644
--- a/boards/base/RaspberryPi/board_framebuffer.h
+++ b/boards/base/RaspberryPi/board_framebuffer.h
@@ -80,7 +80,7 @@
(void) percent;
}
- static void board_power(GDisplay *g, powermode_t pwr) {
+ static void board_power(GDisplay *g, gPowermode pwr) {
(void) g;
(void) pwr;
}
diff --git a/boards/base/eCos-Synthetic-Framebuffer/board_framebuffer.h b/boards/base/eCos-Synthetic-Framebuffer/board_framebuffer.h
index 8712cfe1..db3c8529 100644
--- a/boards/base/eCos-Synthetic-Framebuffer/board_framebuffer.h
+++ b/boards/base/eCos-Synthetic-Framebuffer/board_framebuffer.h
@@ -84,7 +84,7 @@
(void) percent;
}
- static void board_power(GDisplay *g, powermode_t pwr) {
+ static void board_power(GDisplay *g, gPowermode pwr) {
// Not implemented yet.
(void) g;
(void) pwr;
diff --git a/changelog.txt b/changelog.txt
index 713d4925..f7c05f65 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -23,6 +23,7 @@ CHANGE: Added type gPoint to replace V2.x point and point_t
CHANGE: Added type gCoord to replace V2.x coord_t
CHANGE: Added type gPixel to replace V2.x pixel_t
CHANGE: Added type gColor to replace V2.x color_t
+CHANGE: Added type gPowermode to replace V2.x powermode_t, and values gPowerXXX replace powerXXX
FIX: Added gfxRealloc() to Qt port
FIX: Fixed UC1610 driver private area initialisation
FIX: Fixed ST7735 driver and added kapacuk changes
diff --git a/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h b/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h
index 4fc7d071..82ec3888 100644
--- a/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h
+++ b/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h
@@ -22,7 +22,7 @@
(void)percent;
}
- static void board_power(GDisplay* g, powermode_t pwr)
+ static void board_power(GDisplay* g, gPowermode pwr)
{
(void)g;
(void)pwr;
diff --git a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c
index 003c0954..57856ee8 100644
--- a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c
+++ b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c
@@ -61,7 +61,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->board = 0;
PRIV(g)->linelen = g->g.Width * sizeof(LLDCOLOR_TYPE); // bytes per line
PRIV(g)->pixels = PRIV(g)->frame0;
@@ -158,16 +158,16 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g)
{
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff: case powerOn: case powerSleep: case powerDeepSleep:
- board_power(g, (powermode_t)g->p.ptr);
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff: case gPowerOn: case gPowerSleep: case gPowerDeepSleep:
+ board_power(g, (gPowermode)g->p.ptr);
break;
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c
index 1f86affb..0e2e7599 100644
--- a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c
+++ b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c
@@ -449,7 +449,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 100;
return gTrue;
@@ -532,22 +532,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
gdisp_lld_flush(g);
power_off(g);
break;
- case powerOn:
+ case gPowerOn:
power_on(g);
break;
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ED060SC4/readme.txt b/drivers/gdisp/ED060SC4/readme.txt
index 2cdfbdda..23aec1b9 100644
--- a/drivers/gdisp/ED060SC4/readme.txt
+++ b/drivers/gdisp/ED060SC4/readme.txt
@@ -42,7 +42,7 @@ command:
The buffers are also flushed whenever you turn the display off using:
- gdispSetPowerMode(powerOff);
+ gdispSetPowerMode(gPowerOff);
diff --git a/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h b/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h
index ec129abe..a61b53d0 100644
--- a/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h
+++ b/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h
@@ -47,7 +47,7 @@
(void) percent;
}
- static void board_power(GDisplay *g, powermode_t pwr) {
+ static void board_power(GDisplay *g, gPowermode pwr) {
// TODO: Can be an empty function if your hardware doesn't support this
(void) g;
(void) pwr;
diff --git a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c
index f894a071..6aed9809 100644
--- a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c
+++ b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c
@@ -49,7 +49,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialize the GDISP structure
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->board = 0; // preinitialize
board_init(g, &((fbPriv *)g->priv)->fbi);
@@ -136,16 +136,16 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff: case powerOn: case powerSleep: case powerDeepSleep:
- board_power(g, (powermode_t)g->p.ptr);
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff: case gPowerOn: case gPowerSleep: case gPowerDeepSleep:
+ board_power(g, (gPowermode)g->p.ptr);
break;
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c
index 792db343..14aa981b 100644
--- a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c
+++ b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c
@@ -149,7 +149,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
diff --git a/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c b/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c
index cb5a1356..57b2a680 100644
--- a/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c
+++ b/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c
@@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -254,10 +254,10 @@ LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_reg(g, ILI9225_DISP_CTRL1, 0x0000); // Display off
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
@@ -268,8 +268,8 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
release_bus();
set_backlight(g, 0);
break;
- case powerSleep:
- case powerDeepSleep:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, ILI9225_DISP_CTRL1, 0x0000); // Display off
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
@@ -281,7 +281,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
release_bus(g);
set_backlight(g, 0);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_reg(g, ILI9225_POWER_CTRL1, 0x0000); // Set SAP,DSTB,STB
write_reg(g, ILI9225_POWER_CTRL2, 0x0000); // Set APON,PON,AON,VCI1EN,VC
@@ -323,7 +323,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c
index acc0a137..96b12cfd 100644
--- a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c
+++ b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c
@@ -187,7 +187,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -238,10 +238,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@@ -253,7 +253,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
- case powerOn:
+ case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@@ -275,7 +275,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -289,7 +289,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
- case powerDeepSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -306,7 +306,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c
index e787c1c6..37b25d4d 100644
--- a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c
+++ b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c
@@ -185,7 +185,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -232,10 +232,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@@ -246,7 +246,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
- case powerOn:
+ case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@@ -267,7 +267,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -280,7 +280,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
gdisp_lld_backlight(g, 0);
break;
- case powerDeepSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -296,7 +296,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c
index 6e768fbd..1ba14608 100644
--- a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c
+++ b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c
@@ -228,7 +228,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -272,17 +272,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
release_bus(g);
@@ -290,7 +290,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c
index e5fdf7e8..c493e17d 100644
--- a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c
+++ b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c
@@ -232,7 +232,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -276,17 +276,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
release_bus(g);
@@ -294,7 +294,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c
index 79fcd6a4..bda49d60 100644
--- a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c
+++ b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c
@@ -257,7 +257,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -305,10 +305,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@@ -319,7 +319,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
- case powerOn:
+ case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@@ -340,7 +340,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -353,7 +353,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
- case powerDeepSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -369,7 +369,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c
index 1a0a042a..57465aac 100644
--- a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c
+++ b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c
@@ -194,7 +194,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -236,22 +236,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_reg(g, 0x0010, 0x0000); /* leave sleep mode */
release_bus(g);
- if (g->g.Powermode != powerSleep)
+ if (g->g.Powermode != gPowerSleep)
gdisp_lld_init(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x0010, 0x0001); /* enter sleep mode */
release_bus(g);
@@ -259,7 +259,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c
index 9291898e..e32ab556 100644
--- a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c
+++ b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c
@@ -190,7 +190,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -237,11 +237,11 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@@ -249,17 +249,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_index(g, 0x11);
gfxSleepMilliseconds(120);
write_index(g, 0x29);
release_bus(g);
- if (g->g.Powermode != powerSleep)
+ if (g->g.Powermode != gPowerSleep)
gdisp_lld_init(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@@ -271,7 +271,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c
index e11d0881..35726d85 100644
--- a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c
+++ b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c
@@ -135,7 +135,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -225,11 +225,11 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@@ -237,17 +237,17 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_index(g, 0x11);
gfxSleepMilliseconds(120);
write_index(g, 0x29);
release_bus(g);
- if (g->g.Powermode != powerSleep)
+ if (g->g.Powermode != gPowerSleep)
gdisp_lld_init(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@@ -259,7 +259,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c
index ab29fb45..d94708e6 100644
--- a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c
+++ b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c
@@ -179,7 +179,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -226,10 +226,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@@ -240,7 +240,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
- case powerOn:
+ case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -274,7 +274,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
- case powerDeepSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -290,7 +290,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c
index a718a707..38cec2be 100644
--- a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c
+++ b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c
@@ -126,7 +126,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -172,22 +172,22 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
*/
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_index(g, SLEEPIN);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_index(g, SLEEPOUT);
delayms(20);
write_index(g, NORON); // Set Normal mode (my)
release_bus(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_index(g, SLEEPOUT);
delayms(20);
@@ -198,7 +198,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c
index e594eb8d..977ad10a 100644
--- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c
+++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c
@@ -240,7 +240,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
/* Initialise the GDISP structure to match */
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
g->g.Width = GDISP_SCREEN_WIDTH;
@@ -493,18 +493,18 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
*/
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
acquire_bus(g);
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
set_backlight(g, 0); // Turn off the backlight
write_index(g, DISOFF); // Turn off the display
write_cmd1(g, PWRCTR, 0x00); // Power control - all off
write_index(g, SLPIN); // Sleep in
write_index(g, OSCOFF); // Internal oscillator off
break;
- case powerOn:
+ case gPowerOn:
write_index(g, OSCON); // Internal oscillator on
write_index(g, SLPOUT); // Sleep out
write_cmd1(g, PWRCTR, 0x0F); // Power control - reference voltage regulator on, circuit voltage follower on, BOOST ON
@@ -514,7 +514,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
write_index(g, PTLOUT); // Remove sleep window
set_backlight(g, g->g.Backlight); // Turn on the backlight
break;
- case powerSleep:
+ case gPowerSleep:
write_index(g, OSCON); // Internal oscillator on
write_index(g, SLPOUT); // Sleep out
write_cmd1(g, PWRCTR, 0x0F); // Power control - reference voltage regulator on, circuit voltage follower on, BOOST ON
@@ -524,7 +524,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
write_cmd2(g, PTLIN, GDISP_SLEEP_POS/4, (GDISP_SLEEP_POS+GDISP_SLEEP_SIZE)/4); // Sleep Window
set_backlight(g, g->g.Backlight); // Turn on the backlight
break;
- case powerDeepSleep:
+ case gPowerDeepSleep:
write_index(g, OSCON); // Internal oscillator on
write_index(g, SLPOUT); // Sleep out
write_cmd1(g, PWRCTR, 0x0F); // Power control - reference voltage regulator on, circuit voltage follower on, BOOST ON
@@ -539,7 +539,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
return;
}
release_bus(g);
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
#if GDISP_NOKIA_ORIENTATION
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c
index cdf7bbe0..f05d7186 100644
--- a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c
+++ b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c
@@ -87,7 +87,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -185,21 +185,21 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
write_cmd(g, PCD8544_SET_FUNC | PCD8544_PD);
break;
- case powerOn:
+ case gPowerOn:
write_cmd(g, PCD8544_SET_FUNC);
break;
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c
index ee388dcc..ca2a16eb 100644
--- a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c
+++ b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c
@@ -97,7 +97,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -195,21 +195,21 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
write_cmd(g, PCF8812_SET_FUNC | PCF8812_PD);
break;
- case powerOn:
+ case gPowerOn:
write_cmd(g, PCF8812_SET_FUNC);
break;
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/QImage/gdisp_lld_driver.c b/drivers/gdisp/QImage/gdisp_lld_driver.c
index 02128bd4..c42bfbcd 100644
--- a/drivers/gdisp/QImage/gdisp_lld_driver.c
+++ b/drivers/gdisp/QImage/gdisp_lld_driver.c
@@ -40,7 +40,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g)
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
diff --git a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c
index 36cae0a8..1e18e1cd 100644
--- a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c
+++ b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c
@@ -195,7 +195,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -246,10 +246,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_reg(g, 0x07, 0x0000);
write_reg(g, 0x10, 0x0000);
@@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
- case powerOn:
+ case gPowerOn:
//*************Power On sequence ******************//
acquire_bus(g);
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
@@ -283,7 +283,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, g->g.Backlight);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -297,7 +297,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, 0);
break;
- case powerDeepSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, 0x07, 0x0000); /* display OFF */
write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
@@ -314,7 +314,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c
index c3ddf13b..369eac8a 100755
--- a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c
+++ b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c
@@ -203,7 +203,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -311,11 +311,11 @@ LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@@ -323,17 +323,17 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_index(g, 0x11);
gfxSleepMilliseconds(120);
write_index(g, 0x29);
release_bus(g);
- if (g->g.Powermode != powerSleep)
+ if (g->g.Powermode != gPowerSleep)
gdisp_lld_init(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_index(g, 0x28);
gfxSleepMilliseconds(10);
@@ -345,7 +345,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c
index 75702d09..95d4a11d 100644
--- a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c
+++ b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c
@@ -167,7 +167,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -194,20 +194,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
switch(g->p.x) {
#if 0
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
// TODO
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
// TODO
release_bus(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
// TODO
release_bus(g);
@@ -215,7 +215,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
#endif
diff --git a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c
index 347862e6..79b28c51 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c
+++ b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c
@@ -204,7 +204,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -251,20 +251,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
switch(g->p.x) {
#if 0
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
// TODO
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
// TODO
release_bus(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
// TODO
release_bus(g);
@@ -272,7 +272,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
#endif
diff --git a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c
index 35ad43cb..037a1265 100644
--- a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c
+++ b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c
@@ -137,7 +137,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g)
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -175,17 +175,17 @@ LLDSPEC void gdisp_lld_control(GDisplay *g)
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_index(g, SPFD54124B_CMD_SLPIN);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_index(g, SPFD54124B_CMD_SLPOUT);
delayms(20);
@@ -193,7 +193,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g)
release_bus(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_index(g, SPFD54124B_CMD_SLPOUT);
delayms(20);
@@ -204,7 +204,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g)
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c
index 807803a4..a573a70b 100644
--- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c
+++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c
@@ -188,7 +188,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -280,10 +280,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_reg(g, 0x10, 0x0000); // leave sleep mode
write_reg(g, 0x07, 0x0000); // halt operation
@@ -291,14 +291,14 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
write_reg(g, 0x10, 0x0001); // enter sleep mode
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_reg(g, 0x10, 0x0000); // leave sleep mode
write_reg(g, 0x00, 0x0001); // turn on oscillator
gfxSleepMicroseconds(5);
release_bus(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_reg(g, 0x10, 0x0001); // enter sleep mode
release_bus(g);
@@ -306,7 +306,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c
index c26566ff..ff907e6d 100644
--- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c
+++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c
@@ -131,7 +131,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -296,17 +296,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_cmd(g, SSD1306_DISPLAYOFF);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_cmd(g, SSD1306_DISPLAYON);
release_bus(g);
@@ -314,7 +314,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c
index caaf01d8..2a956687 100644
--- a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c
+++ b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c
@@ -149,7 +149,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_180;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -251,17 +251,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_cmd(g, CMD_SET_DISPLAY_MODE_OFF);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_cmd(g, CMD_SET_DISPLAY_MODE_ON);
release_bus(g);
@@ -269,7 +269,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c
index 6dcca875..5080aeef 100644
--- a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c
+++ b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c
@@ -121,7 +121,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -246,17 +246,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_cmd(g, SSD1331_DISPLAY_OFF);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_cmd(g, SSD1331_DISPLAY_ON);
release_bus(g);
@@ -264,7 +264,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
/*
diff --git a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c
index 6513ba55..762eac19 100644
--- a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c
+++ b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c
@@ -132,7 +132,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -187,17 +187,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
//TODO
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
//TODO
release_bus(g);
@@ -205,7 +205,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
index 0fa8c775..e2b86968 100644
--- a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
+++ b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
@@ -214,7 +214,7 @@ LLDSPEC gBool gdisp_lld_init (GDisplay *g)
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -471,11 +471,11 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
switch (g->p.x)
{
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t) g->p.ptr)
+ if (g->g.Powermode == (gPowermode) g->p.ptr)
return;
- switch ((powermode_t) g->p.ptr)
+ switch ((gPowermode) g->p.ptr)
{
- case powerOff:
+ case gPowerOff:
acquire_bus (g);
spi_write_cmd (g, SSD1848_SETCONTRAST);
spi_write_data2 (g, 0x00, 0x00); /* Drop the contrast & gain */
@@ -484,14 +484,14 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
release_bus (g);
break;
- case powerSleep:
- case powerDeepSleep:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus (g);
spi_write_cmd (g, SSD1848_ENTERSLEEP);
release_bus (g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus (g);
spi_write_cmd (g, SSD1848_EXITSLEEP); /* need this in case we were in 'normal' sleep mode */
gfxSleepMilliseconds (5);
@@ -502,7 +502,7 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
default:
return;
}
- g->g.Powermode = (powermode_t) g->p.ptr;
+ g->g.Powermode = (gPowermode) g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c
index 1bf3a45d..64c67b70 100644
--- a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c
+++ b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c
@@ -268,7 +268,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = lcdp->width;
g->g.Height = lcdp->height;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -291,10 +291,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
write_index(g, SSD1963_EXIT_SLEEP_MODE);
gfxSleepMilliseconds(5);
@@ -302,7 +302,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
write_index(g, SSD1963_SET_DEEP_SLEEP);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
setreadmode(g);
dummy_read(g);
@@ -315,14 +315,14 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
set_backlight(g, gdispGGetBacklight(g)); // Restore the back-light
release_bus(g);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
set_backlight(g, 0xFF); // Turn off the back-light pwm from SSD1963
write_index(g, SSD1963_ENTER_SLEEP_MODE);
gfxSleepMilliseconds(5);
release_bus(g);
break;
- case powerDeepSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
set_backlight(g, 0xFF); // Turn off the back-light pwm from SSD1963
write_index(g, SSD1963_ENTER_SLEEP_MODE);
@@ -332,7 +332,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
index 7384ef32..3d1a3693 100644
--- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
+++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
@@ -229,7 +229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -318,34 +318,34 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerDeepSleep:
acquire_bus(g);
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0001); // Enter sleep mode
write_reg(g, SSD2119_REG_SLEEP_MODE_2, 0x2999); // Enable deep sleep function
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0000); // Display off
- if ((powermode_t)g->p.ptr == powerOff)
+ if ((gPowermode)g->p.ptr == gPowerOff)
write_reg(g, SSD2119_REG_OSC_START, 0x0000); // Turn off oscillator
release_bus(g);
set_backlight(g, 0);
break;
- case powerSleep:
+ case gPowerSleep:
acquire_bus(g);
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0001); // Enter sleep mode
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0000); // Display off
release_bus(g);
set_backlight(g, 0);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
- if (g->g.Powermode == powerOff) {
+ if (g->g.Powermode == gPowerOff) {
write_reg(g, SSD2119_REG_OSC_START, 0x0001); // Start the oscillator
gfxSleepMicroseconds(5);
write_reg(g, SSD2119_REG_SLEEP_MODE_2, 0x0999); // Disable deep sleep function
- } else if (g->g.Powermode == powerDeepSleep)
+ } else if (g->g.Powermode == gPowerDeepSleep)
write_reg(g, SSD2119_REG_SLEEP_MODE_2, 0x0999); // Disable deep sleep function
write_reg(g, SSD2119_REG_SLEEP_MODE_1, 0x0000); // Leave sleep mode
write_reg(g, SSD2119_REG_DISPLAY_CTRL, 0x0033); // Display on
@@ -356,7 +356,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c
index e13cdc35..2b153230 100644
--- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c
+++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c
@@ -134,7 +134,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -226,17 +226,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_cmd(g, ST7565_DISPLAY_OFF);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_cmd(g, ST7565_DISPLAY_ON);
release_bus(g);
@@ -244,7 +244,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/ST7735/gdisp_lld_ST7735.c b/drivers/gdisp/ST7735/gdisp_lld_ST7735.c
index 983cfa1d..df4b75ef 100644
--- a/drivers/gdisp/ST7735/gdisp_lld_ST7735.c
+++ b/drivers/gdisp/ST7735/gdisp_lld_ST7735.c
@@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -315,23 +315,23 @@ LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
acquire_bus(g);
// not implemented
release_bus(g);
set_backlight(g, 0);
break;
- case powerSleep:
- case powerDeepSleep:
+ case gPowerSleep:
+ case gPowerDeepSleep:
// not implemented
acquire_bus(g);
release_bus(g);
set_backlight(g, 0);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
// not implemented
release_bus(g);
@@ -340,7 +340,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c
index 960da428..5d3a1380 100644
--- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c
+++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c
@@ -288,7 +288,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
g->g.Width = ((ltdcLayerConfig *)g->priv)->width;
g->g.Height = ((ltdcLayerConfig *)g->priv)->height;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
diff --git a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c
index 60649321..80613719 100644
--- a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c
+++ b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c
@@ -101,7 +101,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_TLS8204_WIDTH;
g->g.Height = GDISP_TLS8204_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -201,17 +201,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_cmd(g, TLS8204_SET_FUNC | TLS8204_PD_BIT);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_cmd(g, TLS8204_SET_FUNC);
release_bus(g);
@@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c
index 54927ba0..fa2fdc71 100644
--- a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c
+++ b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c
@@ -34,7 +34,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
diff --git a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c
index b3ce6dcc..fb82f676 100644
--- a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c
+++ b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c
@@ -108,7 +108,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -206,17 +206,17 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g);
write_cmd(g, UC1601s_SET_EN);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g);
write_cmd(g, UC1601s_SET_EN | UC1601s_ENABLE);
release_bus(g);
@@ -224,7 +224,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c
index bd11dce0..123f3a32 100644
--- a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c
+++ b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c
@@ -125,7 +125,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
return gTrue;
@@ -217,24 +217,24 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr) { return; }
- switch((powermode_t)g->p.ptr) {
- case powerOff:
+ if (g->g.Powermode == (gPowermode)g->p.ptr) { return; }
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
cmdBuffer[0] = UC1610_SYSTEM_RESET;
acquire_bus(g);
write_cmd(g, cmdBuffer, 1);
release_bus(g);
gfxSleepMilliseconds(2);
break;
- case powerSleep:
+ case gPowerSleep:
cmdBuffer[0] = UC1610_SET_DISPLAY_ENABLE | 0;
acquire_bus(g);
write_cmd(g, cmdBuffer, 1);
release_bus(g);
gfxSleepMilliseconds(2);
break;
- case powerOn:
- if (g->g.Powermode == powerSleep) {
+ case gPowerOn:
+ if (g->g.Powermode == gPowerSleep) {
cmdBuffer[0] = UC1610_SET_DISPLAY_ENABLE | 1;
acquire_bus(g);
write_cmd(g, cmdBuffer, 1);
@@ -250,7 +250,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c
index 724c6f36..4a3c4ba4 100644
--- a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c
+++ b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c
@@ -299,7 +299,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
g->g.Width = UC8173_WIDTH;
g->g.Height = UC8173_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = 0;
g->g.Contrast = 0;
diff --git a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c
index 009e52f2..b3f6a6cc 100644
--- a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c
+++ b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c
@@ -105,7 +105,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
return gTrue;
}
@@ -215,18 +215,18 @@ LLDSPEC void gdisp_lld_flush(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff:
+ case gPowerSleep:
+ case gPowerDeepSleep:
acquire_bus(g); // Put de display in deep sleep
write_reg(g, DISPLAY_UPDATE_CTRL2, 0x03);
write_reg(g, DEEP_SLEEP_MODE, 0x01);
release_bus(g);
break;
- case powerOn:
+ case gPowerOn:
acquire_bus(g); // Awake the display again
write_reg(g, DISPLAY_UPDATE_CTRL2, 0xC0);
write_reg(g, DEEP_SLEEP_MODE, 0x00);
@@ -235,7 +235,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/gdisp/framebuffer/board_framebuffer_template.h b/drivers/gdisp/framebuffer/board_framebuffer_template.h
index 3e74e92b..ed8f5a0c 100644
--- a/drivers/gdisp/framebuffer/board_framebuffer_template.h
+++ b/drivers/gdisp/framebuffer/board_framebuffer_template.h
@@ -47,7 +47,7 @@
(void) percent;
}
- static void board_power(GDisplay *g, powermode_t pwr) {
+ static void board_power(GDisplay *g, gPowermode pwr) {
// TODO: Can be an empty function if your hardware doesn't support this
(void) g;
(void) pwr;
diff --git a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c
index ca0153e7..fb09d1c9 100644
--- a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c
+++ b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c
@@ -45,7 +45,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialize the GDISP structure
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->board = 0; // preinitialize
board_init(g, &((fbPriv *)g->priv)->fbi);
@@ -116,16 +116,16 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
- switch((powermode_t)g->p.ptr) {
- case powerOff: case powerOn: case powerSleep: case powerDeepSleep:
- board_power(g, (powermode_t)g->p.ptr);
+ switch((gPowermode)g->p.ptr) {
+ case gPowerOff: case gPowerOn: case gPowerSleep: case gPowerDeepSleep:
+ board_power(g, (gPowermode)g->p.ptr);
break;
default:
return;
}
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
return;
case GDISP_CONTROL_ORIENTATION:
diff --git a/drivers/multiple/SDL/gdisp_lld_SDL.c b/drivers/multiple/SDL/gdisp_lld_SDL.c
index 28dc4f68..6603ef7b 100644
--- a/drivers/multiple/SDL/gdisp_lld_SDL.c
+++ b/drivers/multiple/SDL/gdisp_lld_SDL.c
@@ -373,7 +373,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
gdriverRegister((const GDriverVMT *)GMOUSE_DRIVER_VMT, g);
#endif
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 50;
diff --git a/drivers/multiple/Win32/gdisp_lld_Win32.c b/drivers/multiple/Win32/gdisp_lld_Win32.c
index 4b9a1883..6c0d7df2 100644
--- a/drivers/multiple/Win32/gdisp_lld_Win32.c
+++ b/drivers/multiple/Win32/gdisp_lld_Win32.c
@@ -850,7 +850,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialise the GDISP structure
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Width = GDISP_SCREEN_WIDTH;
diff --git a/drivers/multiple/X/gdisp_lld_X.c b/drivers/multiple/X/gdisp_lld_X.c
index 35271a16..3f1c548c 100644
--- a/drivers/multiple/X/gdisp_lld_X.c
+++ b/drivers/multiple/X/gdisp_lld_X.c
@@ -398,7 +398,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
/* Initialise the GDISP structure to match */
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Width = GDISP_SCREEN_WIDTH;
diff --git a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c
index 28a9a778..573e4bb0 100644
--- a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c
+++ b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c
@@ -453,7 +453,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialise the GDISP structure
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Width = GDISP_SCREEN_WIDTH;
@@ -653,7 +653,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
return;
break;
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
break;
case GDISP_CONTROL_BACKLIGHT:
@@ -706,7 +706,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Orientation = (orientation_t)g->p.ptr;
break;
case GDISP_CONTROL_POWER:
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
break;
case GDISP_CONTROL_BACKLIGHT:
g->g.Backlight = (uint16_t)(int)g->p.ptr;
diff --git a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp
index 4fd26a2f..d94b0c34 100644
--- a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp
+++ b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp
@@ -336,7 +336,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialise the GDISP structure
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Width = GDISP_SCREEN_WIDTH;
@@ -536,7 +536,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
return;
break;
case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
+ if (g->g.Powermode == (gPowermode)g->p.ptr)
return;
break;
case GDISP_CONTROL_BACKLIGHT:
@@ -589,7 +589,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Orientation = (orientation_t)g->p.ptr;
break;
case GDISP_CONTROL_POWER:
- g->g.Powermode = (powermode_t)g->p.ptr;
+ g->g.Powermode = (gPowermode)g->p.ptr;
break;
case GDISP_CONTROL_BACKLIGHT:
g->g.Backlight = (uint16_t)(int)g->p.ptr;
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index 5b58bb90..f3bac3bd 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -711,7 +711,7 @@ unsigned gdispGetDisplayCount(void) {
gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; }
gCoord gdispGGetHeight(GDisplay *g) { return g->g.Height; }
-powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
+gPowermode gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
orientation_t gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; }
uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; }
uint8_t gdispGGetContrast(GDisplay *g) { return g->g.Contrast; }
diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h
index a808c7df..4fe0d823 100644
--- a/src/gdisp/gdisp.h
+++ b/src/gdisp/gdisp.h
@@ -108,15 +108,15 @@ typedef enum orientation {
} orientation_t;
/**
- * @enum powermode
+ * @enum gPowermode
* @brief Type for the available power modes for the screen.
*/
-typedef enum powermode {
- powerOff, /**< Turn the display off. */
- powerSleep, /**< Put the display into sleep mode. */
- powerDeepSleep, /**< Put the display into deep-sleep mode. */
- powerOn /**< Turn the display on. */
-} powermode_t;
+typedef enum gPowermode {
+ gPowerOff, /**< Turn the display off. */
+ gPowerSleep, /**< Put the display into sleep mode. */
+ gPowerDeepSleep, /**< Put the display into deep-sleep mode. */
+ gPowerOn /**< Turn the display on. */
+} gPowermode;
/*
* Our black box display structure.
@@ -139,7 +139,7 @@ extern GDisplay *GDISP;
* @details Unsupported control codes are ignored.
* @note The value parameter should always be typecast to (void *).
* @note There are some predefined and some specific to the low level driver.
- * @note GDISP_CONTROL_POWER - Takes a gdisp_powermode_t
+ * @note GDISP_CONTROL_POWER - Takes a gPowermode
* GDISP_CONTROL_ORIENTATION - Takes a gdisp_orientation_t
* GDISP_CONTROL_BACKLIGHT - Takes an int from 0 to 100. For a driver
* that only supports off/on anything other
@@ -322,7 +322,7 @@ gCoord gdispGGetHeight(GDisplay *g);
*
* @api
*/
-powermode_t gdispGGetPowerMode(GDisplay *g);
+gPowermode gdispGGetPowerMode(GDisplay *g);
#define gdispGetPowerMode() gdispGGetPowerMode(GDISP)
/**
@@ -740,7 +740,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
*/
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, gColor color);
#define gdispDrawThickArc(x,y,rs,re,s,e,c) gdispGDrawThickArc(GDISP,x,y,rs,re,s,e,c)
-
+
/**
* @brief Draw a filled arc.
* @pre GDISP_NEED_ARC must be GFXON in your gfxconf.h
@@ -1102,7 +1102,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
* @api
*/
const char *gdispGetFontName(font_t font);
-
+
/**
* @brief Add a font permanently to the font list.
* @returns gTrue on success. Reasons it may fail: out of memory, if it is already on the list, it is not a font loaded in RAM.
@@ -1167,8 +1167,8 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
*
* @api
*/
-#define gdispGSetPowerMode(g, powerMode) gdispGControl((g), GDISP_CONTROL_POWER, (void *)(unsigned)(powerMode))
-#define gdispSetPowerMode(powerMode) gdispGControl(GDISP, GDISP_CONTROL_POWER, (void *)(unsigned)(powerMode))
+#define gdispGSetPowerMode(g, powerMode) gdispGControl((g), GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode))
+#define gdispSetPowerMode(powerMode) gdispGControl(GDISP, GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode))
/**
* @brief Set the display orientation.
@@ -1230,10 +1230,15 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
/* V2 compatibility */
#if GFX_COMPAT_V2
- typedef gColor color_t;
- typedef gPixel pixel_t;
- typedef gCoord coord_t;
- typedef gPoint point, point_t;
+ typedef gPowermode powermode_t;
+ #define gPowerOff powerOff
+ #define gPowerDeepSleep powerDeepSleep
+ #define gPowerSleep powerSleep
+ #define gPowerOn powerOn
+ typedef gColor color_t;
+ typedef gPixel pixel_t;
+ typedef gCoord coord_t;
+ typedef gPoint point, point_t;
#endif
#endif /* GFX_USE_GDISP */
diff --git a/src/gdisp/gdisp_driver.h b/src/gdisp/gdisp_driver.h
index 11af847d..8b5bc7b9 100644
--- a/src/gdisp/gdisp_driver.h
+++ b/src/gdisp/gdisp_driver.h
@@ -321,7 +321,7 @@ struct GDisplay {
gCoord Width;
gCoord Height;
orientation_t Orientation;
- powermode_t Powermode;
+ gPowermode Powermode;
uint8_t Backlight;
uint8_t Contrast;
} g;
diff --git a/src/gdisp/gdisp_pixmap.c b/src/gdisp/gdisp_pixmap.c
index 8fbccad4..e65e6e71 100644
--- a/src/gdisp/gdisp_pixmap.c
+++ b/src/gdisp/gdisp_pixmap.c
@@ -123,7 +123,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->board = 0;
return gTrue;