aboutsummaryrefslogtreecommitdiffstats
path: root/include/gdisp/lld/emulation.c
diff options
context:
space:
mode:
authorAndrew Hannam <andrewh@inmarket.com.au>2013-03-10 16:11:41 +1000
committerAndrew Hannam <andrewh@inmarket.com.au>2013-03-10 16:11:41 +1000
commit269262ef9bcd392eb037ed9873557478951669e7 (patch)
tree4b4b2f004f817b4e76bc3f7d401f93ead3aa77e8 /include/gdisp/lld/emulation.c
parent5fd7e423a2ff39d94689d2800aaface016e5c866 (diff)
downloaduGFX-269262ef9bcd392eb037ed9873557478951669e7.tar.gz
uGFX-269262ef9bcd392eb037ed9873557478951669e7.tar.bz2
uGFX-269262ef9bcd392eb037ed9873557478951669e7.zip
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.
Diffstat (limited to 'include/gdisp/lld/emulation.c')
-rw-r--r--include/gdisp/lld/emulation.c38
1 files changed, 12 insertions, 26 deletions
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