aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ginput/touch/MCU/gmouse_lld_MCU.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-10-07 21:54:19 +1000
committerinmarket <andrewh@inmarket.com.au>2014-10-07 21:54:19 +1000
commit08e26fcb909de96b5f6476ae606149e618f75036 (patch)
tree5994bc4a7f882abcfb627b5477988f36a3a566a8 /drivers/ginput/touch/MCU/gmouse_lld_MCU.c
parent5497bf82b3cb886fbcc85e529de3f2bbf8af3433 (diff)
downloaduGFX-08e26fcb909de96b5f6476ae606149e618f75036.tar.gz
uGFX-08e26fcb909de96b5f6476ae606149e618f75036.tar.bz2
uGFX-08e26fcb909de96b5f6476ae606149e618f75036.zip
New newmouse driver for MCU touch
Diffstat (limited to 'drivers/ginput/touch/MCU/gmouse_lld_MCU.c')
-rw-r--r--drivers/ginput/touch/MCU/gmouse_lld_MCU.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/ginput/touch/MCU/gmouse_lld_MCU.c b/drivers/ginput/touch/MCU/gmouse_lld_MCU.c
new file mode 100644
index 00000000..87b39ae4
--- /dev/null
+++ b/drivers/ginput/touch/MCU/gmouse_lld_MCU.c
@@ -0,0 +1,50 @@
+/*
+ * This file is subject to the terms of the GFX License. If a copy of
+ * the license was not distributed with this file, you can obtain one at:
+ *
+ * http://ugfx.org/license.html
+ */
+
+#include "gfx.h"
+
+#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
+
+#define GMOUSE_DRIVER_VMT GMOUSEVMT_MCU
+#include "src/ginput/driver_mouse.h"
+
+// Get the hardware interface
+#include "gmouse_lld_MCU_board.h"
+
+const GMouseVMT const GMOUSE_DRIVER_VMT[1] = {{
+ {
+ GDRIVER_TYPE_TOUCH,
+ GMOUSE_VFLG_TOUCH|GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_TEST
+ |GMOUSE_VFLG_ONLY_DOWN|GMOUSE_VFLG_POORUPDOWN,
+ // Extra flags for testing only
+ //GMOUSE_VFLG_DEFAULTFINGER|GMOUSE_VFLG_CAL_EXTREMES - Possible
+ //GMOUSE_VFLG_NOPOLL|GMOUSE_VFLG_DYNAMICONLY|GMOUSE_VFLG_SELFROTATION|GMOUSE_VFLG_CAL_LOADFREE - unlikely
+ sizeof(GMouse),
+ _gmouseInitDriver, _gmousePostInitDriver, _gmouseDeInitDriver
+ },
+ Z_MAX, // z_max
+ Z_MIN, // z_min
+ Z_TOUCHON, // z_touchon
+ Z_TOUCHOFF, // z_touchoff
+ { // pen_jitter
+ GMOUSE_MCU_PEN_CALIBRATE_ERROR, // calibrate
+ GMOUSE_MCU_PEN_CLICK_ERROR, // click
+ GMOUSE_MCU_PEN_MOVE_ERROR // move
+ },
+ { // finger_jitter
+ GMOUSE_MCU_FINGER_CALIBRATE_ERROR, // calibrate
+ GMOUSE_MCU_FINGER_CLICK_ERROR, // click
+ GMOUSE_MCU_FINGER_MOVE_ERROR // move
+ },
+ init_board, // init
+ 0, // deinit
+ read_xyz, // get
+ 0, // calsave
+ 0 // calload
+}};
+
+#endif /* GFX_USE_GINPUT && GINPUT_NEED_MOUSE */