From f8c06e70a78914ac2e42b565050f5443bcecbb6f Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 7 Feb 2015 00:07:49 +1000 Subject: Fixes to all monochrome drivers TLS8204 driver is now operational --- drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c | 29 +++++++++++++++++++++++++++++ drivers/gdisp/PCF8812/gdisp_lld_config.h | 1 + 2 files changed, 30 insertions(+) (limited to 'drivers/gdisp/PCF8812') diff --git a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c index cfb4ad83..f37bed0d 100644 --- a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c +++ b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c @@ -120,6 +120,8 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { write_data(g, RAM(g), GDISP_MATRIX_BYTES); release_bus(g); + + g->flags &= ~GDISP_FLG_NEEDFLUSH; } #endif @@ -162,6 +164,33 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { } #endif +#if GDISP_HARDWARE_PIXELREAD + LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_90: + x = g->p.y; + y = GDISP_SCREEN_HEIGHT-1 - g->p.x; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = GDISP_SCREEN_HEIGHT-1 - g->p.y; + break; + case GDISP_ROTATE_270: + x = GDISP_SCREEN_WIDTH-1 - g->p.y; + y = g->p.x; + break; + } + return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; + } +#endif + #if GDISP_NEED_CONTROL LLDSPEC void gdisp_lld_control(GDisplay *g) { switch(g->p.x) { diff --git a/drivers/gdisp/PCF8812/gdisp_lld_config.h b/drivers/gdisp/PCF8812/gdisp_lld_config.h index 6ad8a571..253b2aaf 100644 --- a/drivers/gdisp/PCF8812/gdisp_lld_config.h +++ b/drivers/gdisp/PCF8812/gdisp_lld_config.h @@ -16,6 +16,7 @@ #define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing #define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE #define GDISP_HARDWARE_CONTROL TRUE // Set this to your frame buffer pixel format. -- cgit v1.2.3