added lcdGetOrientation
This commit is contained in:
parent
f96700a1fe
commit
7e9868616c
3 changed files with 15 additions and 1 deletions
4
glcd.c
4
glcd.c
|
@ -146,6 +146,10 @@ void lcdSetOrientation(uint8_t newOrientation) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t lcdGetOrientation(void) {
|
||||||
|
return orientation;
|
||||||
|
}
|
||||||
|
|
||||||
void lcdSetWindow(uint16_t x, uint16_t y, uint16_t width, uint16_t height) {
|
void lcdSetWindow(uint16_t x, uint16_t y, uint16_t width, uint16_t height) {
|
||||||
if(orientation == portrait) {
|
if(orientation == portrait) {
|
||||||
lcdWriteReg(0x0050, x); /* Horizontal GRAM Start Address */
|
lcdWriteReg(0x0050, x); /* Horizontal GRAM Start Address */
|
||||||
|
|
1
glcd.h
1
glcd.h
|
@ -62,6 +62,7 @@ void lcdDrawString(uint16_t x, uint16_t y, uint8_t *str,uint16_t color, uint16_t
|
||||||
void lcdDrawChar(uint16_t x, uint16_t y, unsigned char c, uint16_t charcolor, uint16_t bkColor);
|
void lcdDrawChar(uint16_t x, uint16_t y, unsigned char c, uint16_t charcolor, uint16_t bkColor);
|
||||||
uint16_t lcdGetHeight(void);
|
uint16_t lcdGetHeight(void);
|
||||||
uint16_t lcdGetWidth(void);
|
uint16_t lcdGetWidth(void);
|
||||||
|
uint16_t lcdGetOrientation(void);
|
||||||
uint16_t lcdBGR2RGB(uint16_t color);
|
uint16_t lcdBGR2RGB(uint16_t color);
|
||||||
uint16_t lcdGetPixelColor(uint16_t x, uint16_t y);
|
uint16_t lcdGetPixelColor(uint16_t x, uint16_t y);
|
||||||
|
|
||||||
|
|
11
touchpad.c
11
touchpad.c
|
@ -29,7 +29,16 @@ uint16_t tpReadX(void) {
|
||||||
|
|
||||||
x = (((lcdGetWidth()-1) * x)/2048);
|
x = (((lcdGetWidth()-1) * x)/2048);
|
||||||
|
|
||||||
return x;
|
switch(lcdGetOrientation()) {
|
||||||
|
case portrait:
|
||||||
|
break;
|
||||||
|
case portraitInv:
|
||||||
|
break;
|
||||||
|
case landscape:
|
||||||
|
break;
|
||||||
|
case landscapeInv:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t tpReadY(void) {
|
uint16_t tpReadY(void) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue