diff --git a/drivers/ads7843_lld.c b/drivers/ads7843_lld.c index ee0513ea..76e11123 100644 --- a/drivers/ads7843_lld.c +++ b/drivers/ads7843_lld.c @@ -36,4 +36,8 @@ __inline uint16_t lld_readY(void) { return y; } +__inline uint16_t lld_readZ(void) { + return 0; +} + #endif diff --git a/drivers/ads7843_lld.h b/drivers/ads7843_lld.h index 6ccae533..388aacc8 100644 --- a/drivers/ads7843_lld.h +++ b/drivers/ads7843_lld.h @@ -8,6 +8,7 @@ uint16_t lld_readX(void); uint16_t lld_readY(void); +uint16_t lld_readZ(void); #endif #endif diff --git a/glcdconf.h b/glcdconf.h index b623f54b..d8a15e06 100644 --- a/glcdconf.h +++ b/glcdconf.h @@ -8,7 +8,7 @@ /***** TOUCHPAD CONTROLLER *****/ -#define TOUCHPAD_USE_ADS7843 - +//#define TOUCHPAD_USE_ADS7843 +#define TOUCHPAD_USE_XPT2046 #endif diff --git a/lcd.mk b/lcd.mk index 2679e415..030c4398 100644 --- a/lcd.mk +++ b/lcd.mk @@ -6,7 +6,8 @@ LCDSRC = ${CHIBIOS}/ext/lcd/glcd.c \ ${CHIBIOS}/ext/lcd/gui.c \ ${CHIBIOS}/ext/lcd/drivers/ssd1289_lld.c \ ${CHIBIOS}/ext/lcd/drivers/s6d1121_lld.c \ - ${CHIBIOS}/ext/lcd/drivers/ads7843_lld.c + ${CHIBIOS}/ext/lcd/drivers/ads7843_lld.c \ + ${CHIBIOS}/ext/lcd/drivers/xpt2046_lld.c \ LCDINC = ${CHIBIOS}/ext/lcd \ ${CHIBIOS}/etc/lcd/drivers diff --git a/touchpad.c b/touchpad.c index a419a3c9..3f355ead 100644 --- a/touchpad.c +++ b/touchpad.c @@ -96,6 +96,10 @@ uint16_t tpReadY(void) { return y; } +uint16_t tpReadZ(void) { + return lld_readZ(); +} + static void tpDrawCross(uint16_t x, uint16_t y) { lcdDrawLine(x-15, y, x-2, y, 0xffff); lcdDrawLine(x+2, y, x+15, y, 0xffff); diff --git a/touchpad.h b/touchpad.h index 9cf678a2..5a60e14e 100644 --- a/touchpad.h +++ b/touchpad.h @@ -53,6 +53,17 @@ uint16_t tpReadX(void); */ uint16_t tpReadY(void); +/* + * Description: reads-out Z value / pressure + * only available when controller supports, returns + * zero otherwise. + * + * param: none + * + * return: pressure on the touchpad + */ +uint16_t tpReadZ(void); + /* * Description: calibration routine *