aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--halext/include/gdisp.h17
-rw-r--r--halext/include/gdisp_lld.h4
-rw-r--r--halext/include/glcd.h3
-rw-r--r--halext/src/gdisp.c4
4 files changed, 15 insertions, 13 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,
diff --git a/halext/src/gdisp.c b/halext/src/gdisp.c
index 90b4582d..ee2b98e4 100644
--- a/halext/src/gdisp.c
+++ b/halext/src/gdisp.c
@@ -154,7 +154,7 @@
*
* @init
*/
- bool_t gdispInit(GDISPDriver * UNUSED(gdisp)) {
+ bool_t gdispInit(void) {
bool_t res;
/* Initialise Mutex */
@@ -168,7 +168,7 @@
return res;
}
#elif GDISP_NEED_ASYNC
- bool_t gdispInit(GDISPDriver * UNUSED(gdisp)) {
+ bool_t gdispInit(void) {
bool_t res;
unsigned i;