added support for 3D touchpads

This commit is contained in:
Tectu 2012-06-15 10:18:52 +02:00
parent 83d3135ab1
commit c7a393c6d7
6 changed files with 24 additions and 3 deletions

View File

@ -36,4 +36,8 @@ __inline uint16_t lld_readY(void) {
return y;
}
__inline uint16_t lld_readZ(void) {
return 0;
}
#endif

View File

@ -8,6 +8,7 @@
uint16_t lld_readX(void);
uint16_t lld_readY(void);
uint16_t lld_readZ(void);
#endif
#endif

View File

@ -8,7 +8,7 @@
/***** TOUCHPAD CONTROLLER *****/
#define TOUCHPAD_USE_ADS7843
//#define TOUCHPAD_USE_ADS7843
#define TOUCHPAD_USE_XPT2046
#endif

3
lcd.mk
View File

@ -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

View File

@ -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);

View File

@ -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
*