aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c')
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c
index 79b28c51..ec0a4320 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c
+++ b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c
@@ -58,19 +58,19 @@ static GFXINLINE void set_cursor(GDisplay *g) {
*/
switch(g->g.Orientation) {
default:
- case GDISP_ROTATE_0:
+ case gOrientation0:
write_reg(g, 0x20, g->p.x & 0x00FF);
write_reg(g, 0x21, g->p.y & 0x01FF);
break;
- case GDISP_ROTATE_90:
+ case gOrientation90:
write_reg(g, 0x20, g->p.y & 0x00FF);
write_reg(g, 0x21, (GDISP_SCREEN_HEIGHT - 1 - g->p.x) & 0x01FF);
break;
- case GDISP_ROTATE_180:
+ case gOrientation180:
write_reg(g, 0x20, (GDISP_SCREEN_WIDTH - 1 - g->p.x) & 0x00FF);
write_reg(g, 0x21, (GDISP_SCREEN_HEIGHT - 1 - g->p.y) & 0x01FF);
break;
- case GDISP_ROTATE_270:
+ case gOrientation270:
write_reg(g, 0x20, (GDISP_SCREEN_WIDTH - 1 - g->p.y) & 0x00FF);
write_reg(g, 0x21, g->p.x & 0x01FF);
break;
@@ -86,23 +86,23 @@ static GFXINLINE void set_viewport(GDisplay *g) {
switch(g->g.Orientation) {
default:
- case GDISP_ROTATE_0:
+ case gOrientation0:
write_reg(g, 0x46, (((g->p.x + g->p.cx - 1) << 8) & 0xFF00 ) | (g->p.x & 0x00FF));
write_reg(g, 0x48, g->p.y & 0x01FF);
write_reg(g, 0x47, (g->p.y + g->p.cy - 1) & 0x01FF);
break;
- case GDISP_ROTATE_90:
+ case gOrientation90:
write_reg(g, 0x46, (((g->p.y + g->p.cy - 1) << 8) & 0xFF00) | (g->p.y & 0x00FF));
write_reg(g, 0x48, (GDISP_SCREEN_HEIGHT - (g->p.x + g->p.cx)) & 0x01FF);
write_reg(g, 0x47, (GDISP_SCREEN_HEIGHT-1 - g->p.x) & 0x01FF);
break;
- case GDISP_ROTATE_180:
+ case gOrientation180:
write_reg(g, 0x46, (((GDISP_SCREEN_WIDTH-1 - g->p.x) & 0x00FF) << 8) |
((GDISP_SCREEN_WIDTH - (g->p.x + g->p.cx)) & 0x00FF));
write_reg(g, 0x48, (GDISP_SCREEN_HEIGHT - (g->p.y + g->p.cy)) & 0x01FF);
write_reg(g, 0x47, (GDISP_SCREEN_HEIGHT-1 - g->p.y) & 0x01FF);
break;
- case GDISP_ROTATE_270:
+ case gOrientation270:
write_reg(g, 0x46, (((GDISP_SCREEN_WIDTH-1 - g->p.y) & 0x00FF) << 8) |
((GDISP_SCREEN_WIDTH - (g->p.y + g->p.cy)) & 0x00FF));
write_reg(g, 0x48, g->p.x & 0x01FF);
@@ -203,7 +203,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
/* Initialise the GDISP structure */
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
- g->g.Orientation = GDISP_ROTATE_0;
+ g->g.Orientation = gOrientation0;
g->g.Powermode = gPowerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
@@ -277,31 +277,31 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#endif
case GDISP_CONTROL_ORIENTATION:
- if (g->g.Orientation == (orientation_t)g->p.ptr)
+ if (g->g.Orientation == (gOrientation)g->p.ptr)
return;
- switch((orientation_t)g->p.ptr) {
- case GDISP_ROTATE_0:
+ switch((gOrientation)g->p.ptr) {
+ case gOrientation0:
acquire_bus(g);
write_reg(g, 0x03, 0b0011);
release_bus(g);
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Width = GDISP_SCREEN_WIDTH;
break;
- case GDISP_ROTATE_90:
+ case gOrientation90:
acquire_bus(g);
write_reg(g, 0x03, 0b1001);
release_bus(g);
g->g.Height = GDISP_SCREEN_WIDTH;
g->g.Width = GDISP_SCREEN_HEIGHT;
break;
- case GDISP_ROTATE_180:
+ case gOrientation180:
acquire_bus(g);
write_reg(g, 0x03, 0b0000);
release_bus(g);
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Width = GDISP_SCREEN_WIDTH;
break;
- case GDISP_ROTATE_270:
+ case gOrientation270:
acquire_bus(g);
write_reg(g, 0x03, 0b1010);
release_bus(g);
@@ -311,7 +311,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
default:
return;
}
- g->g.Orientation = (orientation_t)g->p.ptr;
+ g->g.Orientation = (gOrientation)g->p.ptr;
return;
case GDISP_CONTROL_BACKLIGHT: