added support for 3D touchpads
This commit is contained in:
parent
83d3135ab1
commit
c7a393c6d7
@ -36,4 +36,8 @@ __inline uint16_t lld_readY(void) {
|
||||
return y;
|
||||
}
|
||||
|
||||
__inline uint16_t lld_readZ(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
uint16_t lld_readX(void);
|
||||
uint16_t lld_readY(void);
|
||||
uint16_t lld_readZ(void);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
/***** TOUCHPAD CONTROLLER *****/
|
||||
#define TOUCHPAD_USE_ADS7843
|
||||
|
||||
//#define TOUCHPAD_USE_ADS7843
|
||||
#define TOUCHPAD_USE_XPT2046
|
||||
|
||||
#endif
|
||||
|
3
lcd.mk
3
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
|
||||
|
@ -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);
|
||||
|
11
touchpad.h
11
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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user