added return value for current lcd height/width for current mode (landscape/portrait)

remotes/origin_old/ugfx_release_2.6
Tectu 2012-05-29 02:37:13 +02:00
parent c755d8d6b5
commit 5e0cec987d
2 changed files with 14 additions and 3 deletions

11
glcd.c
View File

@ -3,7 +3,8 @@
#include <math.h>
static uint8_t orientation;
static uint16_t DeviceCode, lcd_height, lcd_width;
static uint16_t DeviceCode;
uint16_t lcd_width, lcd_height;
static __inline void lcdWriteIndex(uint16_t index) {
Clr_RS;
@ -66,6 +67,14 @@ static __inline uint16_t lcdReadReg(uint16_t lcdReg) {
return lcdRAM;
}
uint16_t lcdGetHeight(void) {
return lcd_height;
}
uint16_t lcdGetWidth(void) {
return lcd_width;
}
static void lcdSetCursor(uint16_t x, uint16_t y) {
if(DeviceCode==0x8989) {
if(orientation == portrait || orientation == portraitInv) {

6
glcd.h
View File

@ -47,8 +47,6 @@ enum orientation {portrait, landscape, portraitInv, landscapeInv};
void lcdInit(void);
void lcdClear(uint16_t color);
void lcdTest(void);
uint16_t lcdBGR2RGB(uint16_t color);
uint16_t lcdGetPoint(uint16_t x,uint16_t y);
void lcdSetOrientation(uint8_t newOrientation);
void lcdDrawPixel(uint16_t x,uint16_t y,uint16_t point);
void lcdDrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color);
@ -59,5 +57,9 @@ void lcdFillArea2(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t c
void lcdSetWindows(uint16_t xStart,uint16_t yStart,uint16_t xLong,uint16_t yLong);
void lcdString(uint16_t x, uint16_t y, uint8_t *str,uint16_t color, uint16_t bkcolor);
void lcdChar(uint16_t x, uint16_t y, unsigned char c, uint16_t charcolor, uint16_t bkcolor);
uint16_t lcdGetHeight(void);
uint16_t lcdGetWidth(void);
uint16_t lcdBGR2RGB(uint16_t color);
uint16_t lcdGetPoint(uint16_t x, uint16_t y);
#endif