From 269262ef9bcd392eb037ed9873557478951669e7 Mon Sep 17 00:00:00 2001 From: Andrew Hannam Date: Sun, 10 Mar 2013 16:11:41 +1000 Subject: GDISP changes including polygon support Add polygon drawing Add convex polygon filling Start support for a monochrome display Move gdisp doxygen to header file Restructure the balance between gdisp.h and gdisp_lld.h Remove old extern font definitions (now always use gdispOpenFont) Make public the GDISP structure and change macros to suit (faster for the application). gdispQuery is now optional. --- include/gdisp/lld/emulation.c | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) (limited to 'include/gdisp/lld/emulation.c') diff --git a/include/gdisp/lld/emulation.c b/include/gdisp/lld/emulation.c index de9acf23..572b2dcb 100644 --- a/include/gdisp/lld/emulation.c +++ b/include/gdisp/lld/emulation.c @@ -34,22 +34,13 @@ #ifndef GDISP_EMULATION_C #define GDISP_EMULATION_C -#if GFX_USE_GDISP /*|| defined(__DOXYGEN__) */ - -#ifndef GDISP_LLD_NO_STRUCT - static struct GDISPDriver { - coord_t Width; - coord_t Height; - gdisp_orientation_t Orientation; - gdisp_powermode_t Powermode; - uint8_t Backlight; - uint8_t Contrast; - #if GDISP_NEED_CLIP || GDISP_NEED_VALIDATION - coord_t clipx0, clipy0; - coord_t clipx1, clipy1; /* not inclusive */ - #endif - } GDISP; -#endif +#if GFX_USE_GDISP + +/* Include the low level driver information */ +#include "gdisp/lld/gdisp_lld.h" + +/* Declare the GDISP structure */ +GDISPDriver GDISP; #if !GDISP_HARDWARE_CLEARS void gdisp_lld_clear(color_t color) { @@ -670,17 +661,10 @@ } #endif -#if !GDISP_HARDWARE_QUERY +#if GDISP_NEED_QUERY && !GDISP_HARDWARE_QUERY void *gdisp_lld_query(unsigned what) { - switch(what) { - case GDISP_QUERY_WIDTH: return (void *)(unsigned)GDISP.Width; - case GDISP_QUERY_HEIGHT: return (void *)(unsigned)GDISP.Height; - case GDISP_QUERY_POWER: return (void *)(unsigned)GDISP.Powermode; - case GDISP_QUERY_ORIENTATION: return (void *)(unsigned)GDISP.Orientation; - case GDISP_QUERY_BACKLIGHT: return (void *)(unsigned)GDISP.Backlight; - case GDISP_QUERY_CONTRAST: return (void *)(unsigned)GDISP.Contrast; - default: return (void *)-1; - } + (void) what; + return (void *)-1; } #endif @@ -759,9 +743,11 @@ void *gdisp_lld_query(unsigned what) { gdisp_lld_control(msg->control.what, msg->control.value); break; #endif + #if GDISP_NEED_QUERY case GDISP_LLD_MSG_QUERY: msg->query.result = gdisp_lld_query(msg->query.what); break; + #endif } } #endif -- cgit v1.2.3