diff options
author | Andrew Hannam <andrewh@inmarket.com.au> | 2012-08-09 18:56:09 +1000 |
---|---|---|
committer | Andrew Hannam <andrewh@inmarket.com.au> | 2012-08-09 18:56:09 +1000 |
commit | 4ffb258d71fe0720418fb350b6f3d5354240dddf (patch) | |
tree | b9d57dbcbc8013065560c3056952c1e38b498124 /halext/include | |
parent | 8f9c956810cc2cc66306d41b8501b366eab9c035 (diff) | |
download | uGFX-4ffb258d71fe0720418fb350b6f3d5354240dddf.tar.gz uGFX-4ffb258d71fe0720418fb350b6f3d5354240dddf.tar.bz2 uGFX-4ffb258d71fe0720418fb350b6f3d5354240dddf.zip |
Removed GDISPDriver structure, add macros
Removed the GDISPDriver strucutre definitions, and as a parameter to
gdispInit.
Added macros for common Control and Query routines
eg. gdispGetWidth ...
Diffstat (limited to 'halext/include')
-rw-r--r-- | halext/include/gdisp.h | 17 | ||||
-rw-r--r-- | halext/include/gdisp_lld.h | 4 | ||||
-rw-r--r-- | halext/include/glcd.h | 3 |
3 files changed, 13 insertions, 11 deletions
diff --git a/halext/include/gdisp.h b/halext/include/gdisp.h index 4963043b..b5a59cf9 100644 --- a/halext/include/gdisp.h +++ b/halext/include/gdisp.h @@ -155,7 +155,7 @@ extern "C" { #if GDISP_NEED_MULTITHREAD || GDISP_NEED_ASYNC
/* Base Functions */
- bool_t gdispInit(GDISPDriver *gdisp);
+ bool_t gdispInit(void);
bool_t gdispIsBusy(void);
/* Drawing Functions */
@@ -243,9 +243,18 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color); void gdispPackPixels(const pixel_t *buf, coord_t cx, coord_t x, coord_t y, color_t color);
#endif
-/* Deprecated Routines (already!) */
-#define gdispSetPowerMode(powerMode) gdispControl(GDISP_CONTROL_POWER, (void *)(powerMode))
-#define gdispSetOrientation(newOrientation) gdispControl(GDISP_CONTROL_ORITENTATION, (void *)(newOrientation))
+/* Macro definitions for common gets and sets */
+#define gdispSetPowerMode(powerMode) gdispControl(GDISP_CONTROL_POWER, (void *)(unsigned)(powerMode))
+#define gdispSetOrientation(newOrientation) gdispControl(GDISP_CONTROL_ORITENTATION, (void *)(unsigned)(newOrientation))
+#define gdispSetBacklight(percent) gdispControl(GDISP_CONTROL_BACKLIGHT, (void *)(unsigned)(percent))
+#define gdispSetContrast(percent) gdispControl(GDISP_CONTROL_CONTRAST, (void *)(unsigned)(percent))
+
+#define gdispGetWidth() ((coord_t)(unsigned)gdispQuery(GDISP_QUERY_WIDTH))
+#define gdispGetHeight() ((coord_t)(unsigned)gdispQuery(GDISP_QUERY_HEIGHT))
+#define gdispGetPowerMode() ((gdisp_powermode_t)(unsigned)gdispQuery(GDISP_QUERY_POWER))
+#define gdispGetOrientation() ((gdisp_orientation_t)(unsigned)gdispQuery(GDISP_QUERY_ORIENTATION))
+#define gdispGetBacklight() ((coord_t)(unsigned)gdispQuery(GDISP_QUERY_BACKLIGHT))
+#define gdispGetContrast() ((coord_t)(unsigned)gdispQuery(GDISP_QUERY_CONTRAST))
#ifdef __cplusplus
}
diff --git a/halext/include/gdisp_lld.h b/halext/include/gdisp_lld.h index bf083a4f..99865a9f 100644 --- a/halext/include/gdisp_lld.h +++ b/halext/include/gdisp_lld.h @@ -511,10 +511,6 @@ typedef color_t pixel_t; */
typedef const struct font *font_t;
/**
- * @brief Type of a structure representing a GDISP driver.
- */
-typedef struct GDISPDriver GDISPDriver;
-/**
* @brief Type for the screen orientation.
*/
typedef enum orientation {portrait, landscape, portraitInv, landscapeInv} gdisp_orientation_t;
diff --git a/halext/include/glcd.h b/halext/include/glcd.h index 670d160e..ab2f6be2 100644 --- a/halext/include/glcd.h +++ b/halext/include/glcd.h @@ -58,9 +58,6 @@ enum transparency {solid, transparent}; #define font_LargeNumbersDouble (&fontLargeNumbersDouble)
#define font_LargeNumbersNarrow (&fontLargeNumbersNarrow)
-#define GLCDDriver GDISPDriver
-#define GLCDD GDISP
-
enum glcd_result { GLCD_DONE,
GLCD_FAILED,
GLCD_PROGRESS,
|