SCREEN_WIDTH and SCREEN_HEIGHT renamed to GDISP_SCREEN_WIDTH and GDISP_SCREEN_HEIGHT

This commit is contained in:
Joel Bodenmann 2012-10-11 01:41:18 +02:00
parent b9de7e6ce3
commit cf1a759ad6
15 changed files with 104 additions and 102 deletions

View File

@ -8,6 +8,8 @@ current stable: 1.1
FIX: orientation macros changed
FIX: huge internal bugfix in orientation stuff (big thanks to Abhishek)
FEATURE: added TOUCHPAD_XY_INVERTED macro
FIX: struct cal renamed to struct cal_t
FIX: SCREEN_WIDTH and SCREEN_HEIGHT renamed to GDISP_SCREEN_WIDTH and GDISP_SCREEN_HEIGHT
*** changes after 1.0 ***
FIX: removed gdisp and touchpad prefix of driver directories

View File

@ -18,8 +18,8 @@ To include any of these functions/drivers in your project...
#define HAL_USE_TOUCHPAD TRUE
#define GDISP_USE_GPIO TRUE
#define GDISP_SCREEN_WIDTH 240
#define GDISP_SCREEN_HEIGHT 320
#define GDISP_GDISP_SCREEN_WIDTH 240
#define GDISP_GDISP_SCREEN_HEIGHT 320
#define GDISP_NEED_CONTROL TRUE
#define TOUCHPAD_NEED_MULTITHREAD TRUE

View File

@ -48,8 +48,8 @@
#error "gdispNokia6610: Either GDISP_USE_GE8 or GDISP_USE_GE12 must be defined depending on your controller"
#endif
#define SCREEN_HEIGHT 132
#define SCREEN_WIDTH 132
#define GDISP_SCREEN_HEIGHT 132
#define GDISP_SCREEN_WIDTH 132
#define INITIAL_CONTRAST 38
/*===========================================================================*/
@ -253,8 +253,8 @@ bool_t GDISP_LLD(init)(void) {
GDISP_LLD(setpin_backlight)(TRUE);
/* Initialise the GDISP structure to match */
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Orientation = GDISP_ROTATE_0;
GDISP.Powermode = powerOn;
GDISP.Backlight = 100;
@ -541,23 +541,23 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
switch((gdisp_orientation_t)value) {
case GDISP_ROTATE_0:
/* Code here */
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_90:
/* Code here */
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
case GDISP_ROTATE_180:
/* Code here */
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_270:
/* Code here */
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
default:
return;

View File

@ -178,8 +178,8 @@ bool_t GDISP_LLD(init)(void) {
lld_lcdResetViewPort();
/* Now initialise the GDISP structure */
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Orientation = GDISP_ROTATE_0;
GDISP.Powermode = powerOn;
GDISP.Backlight = 100;
@ -227,7 +227,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdSetCursor(0, 0);
lld_lcdWriteStreamStart();
for(i = 0; i < SCREEN_WIDTH * SCREEN_HEIGHT; i++)
for(i = 0; i < GDISP_SCREEN_WIDTH * GDISP_SCREEN_HEIGHT; i++)
lld_lcdWriteData(color);
lld_lcdWriteStreamStop();
@ -358,7 +358,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
/* This is marked as "TODO: Test this" in the original GLCD driver.
* For now we just leave the GDISP_HARDWARE_SCROLL off.
*/
static color_t buf[((SCREEN_HEIGHT > SCREEN_WIDTH ) ? SCREEN_HEIGHT : SCREEN_WIDTH)];
static color_t buf[((GDISP_SCREEN_HEIGHT > GDISP_SCREEN_WIDTH ) ? GDISP_SCREEN_HEIGHT : GDISP_SCREEN_WIDTH)];
coord_t row0, row1;
unsigned i, gap, abslines;
@ -459,26 +459,26 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
case GDISP_ROTATE_0:
lld_lcdWriteReg(0x0001,0x0127);
lld_lcdWriteReg(0x03, 0b0011);
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_90:
lld_lcdWriteReg(0x0001,0x0027);
lld_lcdWriteReg(0x0003, 0b1011);
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
case GDISP_ROTATE_180:
lld_lcdWriteReg(0x0001,0x0127);
lld_lcdWriteReg(0x0003, 0b0000);
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_270:
lld_lcdWriteReg(0x0001,0x0027);
lld_lcdWriteReg(0x0003, 0b1000);
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
default:
return;

View File

@ -8,8 +8,8 @@ To use this driver:
#define GDISP_USE_SPI
#define GDISP_USE_FSMC
d) All of the following (with appropriate values):
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#define GDISP_SCREEN_WIDTH 320
#define GDISP_SCREEN_HEIGHT 240
2. To your makefile add the following lines:
include $(GFXLIB)/drivers/gdisp/S6D1121/gdisp_lld.mk

View File

@ -192,12 +192,12 @@ static void lld_lcdSetCursor(coord_t x, coord_t y) {
lld_lcdWriteReg(0x0021, x & 0x01FF);
break;
case GDISP_ROTATE_180:
lld_lcdWriteReg(0x0020, (SCREEN_WIDTH - 1 - x) & 0x00FF);
lld_lcdWriteReg(0x0021, (SCREEN_HEIGHT - 1 - y) & 0x01FF);
lld_lcdWriteReg(0x0020, (GDISP_SCREEN_WIDTH - 1 - x) & 0x00FF);
lld_lcdWriteReg(0x0021, (GDISP_SCREEN_HEIGHT - 1 - y) & 0x01FF);
break;
case GDISP_ROTATE_270:
lld_lcdWriteReg(0x0020, (SCREEN_WIDTH - 1 - y) & 0x00FF);
lld_lcdWriteReg(0x0021, (SCREEN_HEIGHT - 1 - x) & 0x01FF);
lld_lcdWriteReg(0x0020, (GDISP_SCREEN_WIDTH - 1 - y) & 0x00FF);
lld_lcdWriteReg(0x0021, (GDISP_SCREEN_HEIGHT - 1 - x) & 0x01FF);
break;
}
}
@ -224,16 +224,16 @@ static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy)
lld_lcdWriteReg(0x47, (x + cx - 1) & 0x01FF);
break;
case GDISP_ROTATE_180:
lld_lcdWriteReg(0x46, (((SCREEN_WIDTH - x - 1) & 0x00FF) << 8) |
((SCREEN_WIDTH - (x + cx)) & 0x00FF));
lld_lcdWriteReg(0x48, (SCREEN_HEIGHT - (y + cy)) & 0x01FF);
lld_lcdWriteReg(0x47, (SCREEN_HEIGHT- y - 1) & 0x01FF);
lld_lcdWriteReg(0x46, (((GDISP_SCREEN_WIDTH - x - 1) & 0x00FF) << 8) |
((GDISP_SCREEN_WIDTH - (x + cx)) & 0x00FF));
lld_lcdWriteReg(0x48, (GDISP_SCREEN_HEIGHT - (y + cy)) & 0x01FF);
lld_lcdWriteReg(0x47, (GDISP_SCREEN_HEIGHT- y - 1) & 0x01FF);
break;
case GDISP_ROTATE_270:
lld_lcdWriteReg(0x46, (((SCREEN_WIDTH - y - 1) & 0x00FF) << 8) |
((SCREEN_WIDTH - (y + cy)) & 0x00FF));
lld_lcdWriteReg(0x48, (SCREEN_HEIGHT - (x + cx)) & 0x01FF);
lld_lcdWriteReg(0x47, (SCREEN_HEIGHT - x - 1) & 0x01FF);
lld_lcdWriteReg(0x46, (((GDISP_SCREEN_WIDTH - y - 1) & 0x00FF) << 8) |
((GDISP_SCREEN_WIDTH - (y + cy)) & 0x00FF));
lld_lcdWriteReg(0x48, (GDISP_SCREEN_HEIGHT - (x + cx)) & 0x01FF);
lld_lcdWriteReg(0x47, (GDISP_SCREEN_HEIGHT - x - 1) & 0x01FF);
break;
}
@ -244,11 +244,11 @@ static void lld_lcdResetViewPort(void) {
switch(GDISP.Orientation) {
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
lld_lcdSetViewPort(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
lld_lcdSetViewPort(0, 0, GDISP_SCREEN_WIDTH, GDISP_SCREEN_HEIGHT);
break;
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
lld_lcdSetViewPort(0, 0, SCREEN_HEIGHT, SCREEN_WIDTH);
lld_lcdSetViewPort(0, 0, GDISP_SCREEN_HEIGHT, GDISP_SCREEN_WIDTH);
break;
}
}

View File

@ -119,8 +119,8 @@ bool_t GDISP_LLD(init)(void) {
lld_lcdWriteReg(0x004e,0x0000); lld_lcdDelay(5);
/* Initialise the GDISP structure */
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Orientation = GDISP_ROTATE_0;
GDISP.Powermode = powerOn;
GDISP.Backlight = 100;
@ -183,7 +183,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdSetCursor(0, 0);
lld_lcdWriteStreamStart();
for(i = 0; i < SCREEN_WIDTH * SCREEN_HEIGHT; i++)
for(i = 0; i < GDISP_SCREEN_WIDTH * GDISP_SCREEN_HEIGHT; i++)
lld_lcdWriteData(color);
lld_lcdWriteStreamStop();
@ -307,7 +307,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* @notapi
*/
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
static color_t buf[((SCREEN_HEIGHT > SCREEN_WIDTH ) ? SCREEN_HEIGHT : SCREEN_WIDTH)];
static color_t buf[((GDISP_SCREEN_HEIGHT > GDISP_SCREEN_WIDTH ) ? GDISP_SCREEN_HEIGHT : GDISP_SCREEN_WIDTH)];
coord_t row0, row1;
unsigned i, gap, abslines;
@ -411,29 +411,29 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0001, 0x2B3F);
/* ID = 11 AM = 0 */
lld_lcdWriteReg(0x0011, 0x6070);
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_90:
lld_lcdWriteReg(0x0001, 0x293F);
/* ID = 11 AM = 1 */
lld_lcdWriteReg(0x0011, 0x6078);
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
case GDISP_ROTATE_180:
lld_lcdWriteReg(0x0001, 0x2B3F);
/* ID = 01 AM = 0 */
lld_lcdWriteReg(0x0011, 0x6040);
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_270:
lld_lcdWriteReg(0x0001, 0x293F);
/* ID = 01 AM = 1 */
lld_lcdWriteReg(0x0011, 0x6048);
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
default:
return;

View File

@ -11,8 +11,8 @@ To use this driver:
#define GDISP_USE_FSMC
d) All of the following (with appropriate values):
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#define GDISP_SCREEN_WIDTH 320
#define GDISP_SCREEN_HEIGHT 240
2. To your makefile add the following lines:
include $(GFXLIB)/drivers/gdisp/SSD1289/gdisp_lld.mk

View File

@ -266,8 +266,8 @@ static void lld_lcdSetCursor(uint16_t x, uint16_t y) {
*/
switch(GDISP.Orientation) {
case GDISP_ROTATE_180:
lld_lcdWriteReg(0x004e, (SCREEN_WIDTH-1-x) & 0x00FF);
lld_lcdWriteReg(0x004f, (SCREEN_HEIGHT-1-y) & 0x01FF);
lld_lcdWriteReg(0x004e, (GDISP_SCREEN_WIDTH-1-x) & 0x00FF);
lld_lcdWriteReg(0x004f, (GDISP_SCREEN_HEIGHT-1-y) & 0x01FF);
break;
case GDISP_ROTATE_0:
lld_lcdWriteReg(0x004e, x & 0x00FF);
@ -278,8 +278,8 @@ static void lld_lcdSetCursor(uint16_t x, uint16_t y) {
lld_lcdWriteReg(0x004f, x & 0x01FF);
break;
case GDISP_ROTATE_90:
lld_lcdWriteReg(0x004e, (SCREEN_WIDTH - y - 1) & 0x00FF);
lld_lcdWriteReg(0x004f, (SCREEN_HEIGHT - x - 1) & 0x01FF);
lld_lcdWriteReg(0x004e, (GDISP_SCREEN_WIDTH - y - 1) & 0x00FF);
lld_lcdWriteReg(0x004f, (GDISP_SCREEN_HEIGHT - x - 1) & 0x01FF);
break;
}
}
@ -308,14 +308,14 @@ static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy)
lld_lcdWriteReg(0x46, (x+cx-1) & 0x01FF);
break;
case GDISP_ROTATE_180:
lld_lcdWriteReg(0x44, (((SCREEN_WIDTH-x-1) & 0x00FF) << 8) | ((SCREEN_WIDTH - (x+cx)) & 0x00FF));
lld_lcdWriteReg(0x45, (SCREEN_HEIGHT-(y+cy)) & 0x01FF);
lld_lcdWriteReg(0x46, (SCREEN_HEIGHT-y-1) & 0x01FF);
lld_lcdWriteReg(0x44, (((GDISP_SCREEN_WIDTH-x-1) & 0x00FF) << 8) | ((GDISP_SCREEN_WIDTH - (x+cx)) & 0x00FF));
lld_lcdWriteReg(0x45, (GDISP_SCREEN_HEIGHT-(y+cy)) & 0x01FF);
lld_lcdWriteReg(0x46, (GDISP_SCREEN_HEIGHT-y-1) & 0x01FF);
break;
case GDISP_ROTATE_270:
lld_lcdWriteReg(0x44, (((SCREEN_WIDTH - y - 1) & 0x00FF) << 8) | ((SCREEN_WIDTH - (y+cy)) & 0x00FF));
lld_lcdWriteReg(0x45, (SCREEN_HEIGHT - (x+cx)) & 0x01FF);
lld_lcdWriteReg(0x46, (SCREEN_HEIGHT - x - 1) & 0x01FF);
lld_lcdWriteReg(0x44, (((GDISP_SCREEN_WIDTH - y - 1) & 0x00FF) << 8) | ((GDISP_SCREEN_WIDTH - (y+cy)) & 0x00FF));
lld_lcdWriteReg(0x45, (GDISP_SCREEN_HEIGHT - (x+cx)) & 0x01FF);
lld_lcdWriteReg(0x46, (GDISP_SCREEN_HEIGHT - x - 1) & 0x01FF);
break;
}

View File

@ -259,10 +259,10 @@ bool_t GDISP_LLD(init)(void) {
// GDISP_LLD(writedata)(0x0000);
GDISP_LLD(writedata)(0b00011000); //Enabled dithering
GDISP_LLD(writedata)(0x0000);
GDISP_LLD(writedata)(mHIGH((SCREEN_WIDTH+1)));
GDISP_LLD(writedata)((SCREEN_WIDTH+1));
GDISP_LLD(writedata)(mHIGH((SCREEN_HEIGHT+1)));
GDISP_LLD(writedata)((SCREEN_HEIGHT+1));
GDISP_LLD(writedata)(mHIGH((GDISP_SCREEN_WIDTH+1)));
GDISP_LLD(writedata)((GDISP_SCREEN_WIDTH+1));
GDISP_LLD(writedata)(mHIGH((GDISP_SCREEN_HEIGHT+1)));
GDISP_LLD(writedata)((GDISP_SCREEN_HEIGHT+1));
GDISP_LLD(writedata)(0x0000);
GDISP_LLD(writeindex)(SSD1963_SET_PIXEL_DATA_INTERFACE);
@ -306,8 +306,8 @@ bool_t GDISP_LLD(init)(void) {
#endif
/* Initialise the GDISP structure to match */
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Orientation = GDISP_ROTATE_0;
GDISP.Powermode = powerOn;
GDISP.Backlight = 100;
@ -565,23 +565,23 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
switch((gdisp_orientation_t)value) {
case GDISP_ROTATE_0:
/* Code here */
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_90:
/* Code here */
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
case GDISP_ROTATE_180:
/* Code here */
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_270:
/* Code here */
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
default:
return;

View File

@ -30,8 +30,8 @@
#define _GDISP_LLD_PANEL_H
/* LCD panel specs */
#define SCREEN_WIDTH 480
#define SCREEN_HEIGHT 272
#define GDISP_SCREEN_WIDTH 480
#define GDISP_SCREEN_HEIGHT 272
#define SCREEN_FPS 60ULL
@ -43,8 +43,8 @@
#define SCREEN_VSYNC_FRONT_PORCH 2ULL
#define SCREEN_VSYNC_PULSE 10ULL
#define SCREEN_HSYNC_PERIOD (SCREEN_HSYNC_PULSE + SCREEN_HSYNC_BACK_PORCH + SCREEN_WIDTH + SCREEN_HSYNC_FRONT_PORCH)
#define SCREEN_VSYNC_PERIOD (SCREEN_VSYNC_PULSE + SCREEN_VSYNC_BACK_PORCH + SCREEN_HEIGHT + SCREEN_VSYNC_FRONT_PORCH)
#define SCREEN_HSYNC_PERIOD (SCREEN_HSYNC_PULSE + SCREEN_HSYNC_BACK_PORCH + GDISP_SCREEN_WIDTH + SCREEN_HSYNC_FRONT_PORCH)
#define SCREEN_VSYNC_PERIOD (SCREEN_VSYNC_PULSE + SCREEN_VSYNC_BACK_PORCH + GDISP_SCREEN_HEIGHT + SCREEN_VSYNC_FRONT_PORCH)
#define SCREEN_PCLK (SCREEN_HSYNC_PERIOD * SCREEN_VSYNC_PERIOD * SCREEN_FPS)
#define GDISP_FPR ((SCREEN_PCLK * 1048576)/100000000)

View File

@ -18,8 +18,8 @@ To use this driver:
Example FSMC config with DMA:
#define SCREEN_WIDTH 480
#define SCREEN_HEIGHT 272
#define GDISP_SCREEN_WIDTH 480
#define GDISP_SCREEN_HEIGHT 272
#define GDISP_USE_FSMC

View File

@ -163,9 +163,9 @@ uint16_t tpReadX(void) {
case GDISP_ROTATE_90:
return y;
case GDISP_ROTATE_180:
return SCREEN_WIDTH - x - 1;
return GDISP_SCREEN_WIDTH - x - 1;
case GDISP_ROTATE_270:
return SCREEN_HEIGHT - y - 1;
return GDISP_SCREEN_HEIGHT - y - 1;
}
return 0;
@ -192,9 +192,9 @@ uint16_t tpReadY(void) {
case GDISP_ROTATE_0:
return y;
case GDISP_ROTATE_90:
return SCREEN_WIDTH - x - 1;
return GDISP_SCREEN_WIDTH - x - 1;
case GDISP_ROTATE_180:
return SCREEN_HEIGHT - y - 1;
return GDISP_SCREEN_HEIGHT - y - 1;
case GDISP_ROTATE_270:
return x;
}

View File

@ -73,8 +73,8 @@ bool_t GDISP_LLD(init)(void) {
/* Initialise your display */
/* Initialise the GDISP structure to match */
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Orientation = GDISP_ROTATE_0;
GDISP.Powermode = powerOn;
GDISP.Backlight = 100;
@ -467,23 +467,23 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
switch((gdisp_orientation_t)value) {
case GDISP_ROTATE_0:
/* Code here */
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_90:
/* Code here */
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
case GDISP_ROTATE_180:
/* Code here */
GDISP.Height = SCREEN_HEIGHT;
GDISP.Width = SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_270:
/* Code here */
GDISP.Height = SCREEN_WIDTH;
GDISP.Width = SCREEN_HEIGHT;
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
default:
return;

View File

@ -21,8 +21,8 @@ To use this driver:
#define GDISP_USE_SPI
#define GDISP_USE_FSMC
d) All of the following (with appropriate values):
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 128
#define GDISP_SCREEN_WIDTH 128
#define GDISP_SCREEN_HEIGHT 128
e) If you are not using a known board then create a gdisp_lld_board.h file
and ensure it is on your include path.
Use the gdisp_lld_board_example.h file as a basis.