aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2013-04-06 15:01:36 -0700
committerTectu <joel@unormal.org>2013-04-06 15:01:36 -0700
commit22e7150f2d3120fd26f68452bc756b4d0ee52476 (patch)
treec26d58947cb4030ea69c2c424861849b8cc54476 /drivers
parente4803e86b718cd620090d8e704f87a2e496bf2cc (diff)
parent6a7e33db9b0017b5764af049c2ead60aaa16be43 (diff)
downloaduGFX-22e7150f2d3120fd26f68452bc756b4d0ee52476.tar.gz
uGFX-22e7150f2d3120fd26f68452bc756b4d0ee52476.tar.bz2
uGFX-22e7150f2d3120fd26f68452bc756b4d0ee52476.zip
Merge pull request #61 from mobyfab/master
ADS7843 - Macro for Inverted touchpad
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ginput/touch/ADS7843/ginput_lld_mouse.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c
index 11193442..9371760a 100644
--- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c
+++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c
@@ -45,6 +45,15 @@
#include "ginput_lld_mouse_board_example.h"
#endif
+#if defined(GINPUT_MOUSE_YX_INVERTED) && GINPUT_MOUSE_YX_INVERTED
+ #define CMD_X 0x91
+ #define CMD_Y 0xD1
+#else
+ #define CMD_X 0xD1
+ #define CMD_Y 0x91
+#endif
+
+
static uint16_t sampleBuf[7];
static coord_t lastx, lasty;
@@ -115,18 +124,18 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) {
* Finally switch on PENIRQ once again - perform a dummy read.
* Once we have the readings, find the medium using our filter function
*/
- read_value(0xD1);
+ read_value(CMD_X);
for(i = 0; i < 7; i++)
- sampleBuf[i] = read_value(0xD1);
- read_value(0xD0);
+ sampleBuf[i] = read_value(CMD_X);
+ read_value(CMD_X-1);
filter();
lastx = (coord_t)sampleBuf[3];
/* Get the Y value using the same process as above */
- read_value(0x91);
+ read_value(CMD_Y);
for(i = 0; i < 7; i++)
- sampleBuf[i] = read_value(0x91);
- read_value(0x90);
+ sampleBuf[i] = read_value(CMD_Y);
+ read_value(CMD_Y-1);
filter();
lasty = (coord_t)sampleBuf[3];