Merge pull request #37 from inmarket/master

Removed GDISPDriver strucutre, added macros for Query & Control
ugfx_release_2.6
Tectu 2012-08-09 01:59:45 -07:00
commit 60582cbf35
4 changed files with 15 additions and 13 deletions

View File

@ -155,7 +155,7 @@ extern "C" {
#if GDISP_NEED_MULTITHREAD || GDISP_NEED_ASYNC #if GDISP_NEED_MULTITHREAD || GDISP_NEED_ASYNC
/* Base Functions */ /* Base Functions */
bool_t gdispInit(GDISPDriver *gdisp); bool_t gdispInit(void);
bool_t gdispIsBusy(void); bool_t gdispIsBusy(void);
/* Drawing Functions */ /* 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); void gdispPackPixels(const pixel_t *buf, coord_t cx, coord_t x, coord_t y, color_t color);
#endif #endif
/* Deprecated Routines (already!) */ /* Macro definitions for common gets and sets */
#define gdispSetPowerMode(powerMode) gdispControl(GDISP_CONTROL_POWER, (void *)(powerMode)) #define gdispSetPowerMode(powerMode) gdispControl(GDISP_CONTROL_POWER, (void *)(unsigned)(powerMode))
#define gdispSetOrientation(newOrientation) gdispControl(GDISP_CONTROL_ORITENTATION, (void *)(newOrientation)) #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 #ifdef __cplusplus
} }

View File

@ -510,10 +510,6 @@ typedef color_t pixel_t;
* @brief The type of a font. * @brief The type of a font.
*/ */
typedef const struct font *font_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. * @brief Type for the screen orientation.
*/ */

View File

@ -58,9 +58,6 @@ enum transparency {solid, transparent};
#define font_LargeNumbersDouble (&fontLargeNumbersDouble) #define font_LargeNumbersDouble (&fontLargeNumbersDouble)
#define font_LargeNumbersNarrow (&fontLargeNumbersNarrow) #define font_LargeNumbersNarrow (&fontLargeNumbersNarrow)
#define GLCDDriver GDISPDriver
#define GLCDD GDISP
enum glcd_result { GLCD_DONE, enum glcd_result { GLCD_DONE,
GLCD_FAILED, GLCD_FAILED,
GLCD_PROGRESS, GLCD_PROGRESS,

View File

@ -154,7 +154,7 @@
* *
* @init * @init
*/ */
bool_t gdispInit(GDISPDriver * UNUSED(gdisp)) { bool_t gdispInit(void) {
bool_t res; bool_t res;
/* Initialise Mutex */ /* Initialise Mutex */
@ -168,7 +168,7 @@
return res; return res;
} }
#elif GDISP_NEED_ASYNC #elif GDISP_NEED_ASYNC
bool_t gdispInit(GDISPDriver * UNUSED(gdisp)) { bool_t gdispInit(void) {
bool_t res; bool_t res;
unsigned i; unsigned i;