aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-08-13 20:59:29 +0200
committerTectu <joel@unormal.org>2012-08-13 20:59:29 +0200
commit1a6eed0c07806b5d5129024eb3645907e25a4139 (patch)
treebe483881cffda9ffaad974894dd7060f2bd96274 /demos
parent72d1bef6c3e020106cffad04799f7fd7737a2ebf (diff)
downloaduGFX-1a6eed0c07806b5d5129024eb3645907e25a4139.tar.gz
uGFX-1a6eed0c07806b5d5129024eb3645907e25a4139.tar.bz2
uGFX-1a6eed0c07806b5d5129024eb3645907e25a4139.zip
added touchpad demo
Diffstat (limited to 'demos')
-rw-r--r--demos/touchpad/main.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/demos/touchpad/main.c b/demos/touchpad/main.c
new file mode 100644
index 00000000..8a1d3275
--- /dev/null
+++ b/demos/touchpad/main.c
@@ -0,0 +1,26 @@
+#include "ch.h"
+#include "hal.h"
+#include "gdisp.h"
+#include "touchpad.h"
+
+TOUCHPADDriver TOUCHPADD1 = {
+ &SPID1,
+};
+
+int main(void) {
+ halInit();
+ chSysInit();
+
+ gdispInit();
+ gdispClear(Lime);
+
+ tpInit(&TOUCHPADD1);
+ tpCalibrate();
+
+ gdispClear(Lime);
+
+ while (TRUE) {
+ gdispDrawFillCircle(tpReadX(), tpReadY(), 3, Black);
+ }
+}
+