From ada8d42f332c00da04ff78963ab48bb8cef25704 Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 5 Feb 2015 00:19:43 +1000 Subject: Updates to TLS8204 driver --- drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'drivers/gdisp') diff --git a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c index 7a9e7415..4450b8a3 100644 --- a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c +++ b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c @@ -82,8 +82,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { write_cmd(g, TLS8204_SET_FUNC); write_cmd(g, TLS8204_SET_VLCD7 + ((GDISP_INITIAL_CONTRAST * 2 + 22) >> 7)); write_cmd(g, TLS8204_SET_DISPLAY_NORMAL); - write_cmd(g, TLS8204_SET_X + 0); - write_cmd(g, TLS8204_SET_Y + 0/8); + // Finish Init post_init_board(g); @@ -107,6 +106,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush(GDisplay *g) { + unsigned y; // Don't flush if we don't need it. if (!(g->flags & GDISP_FLG_NEEDFLUSH)) @@ -114,10 +114,12 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { acquire_bus(g); - write_cmd(g, TLS8204_SET_X + 0); // X = 0 - write_cmd(g, TLS8204_SET_Y + 0/8); // Y = 0 + for(y = 0; y < GDISP_TLS8204_HEIGHT/8; y++) { + write_cmd(g, TLS8204_SET_X | 0); // X = 0 + write_cmd(g, TLS8204_SET_Y | y); // Y = 0 - write_data(g, RAM(g), GDISP_SCREEN_BYTES); + write_data(g, RAM(g)+y*GDISP_TLS8204_WIDTH, GDISP_SCREEN_BYTES); + } release_bus(g); } @@ -152,7 +154,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { y = g->p.y; #endif - if (gdispColor2Native(g->p.color) != gdispColor2Native(Black)) { + if (g->p.color != Black) { RAM(g)[xyaddr(x, y)] |= xybit(y); } else { RAM(g)[xyaddr(x, y)] &= ~xybit(y); -- cgit v1.2.3