aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-08-13 02:48:05 +0200
committerTectu <joel@unormal.org>2012-08-13 02:48:05 +0200
commit2285ddfc63b852e60fa0a95d32ffb6cc1d59c8a2 (patch)
tree7ae0968d27ec18993f499a8dc834838f5c964cc5 /demos
parent1c105a40cfc676f2166ad93251147ab52ca06874 (diff)
downloaduGFX-2285ddfc63b852e60fa0a95d32ffb6cc1d59c8a2.tar.gz
uGFX-2285ddfc63b852e60fa0a95d32ffb6cc1d59c8a2.tar.bz2
uGFX-2285ddfc63b852e60fa0a95d32ffb6cc1d59c8a2.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..1651a3bf
--- /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();
+
+ while (TRUE) {
+ gdispFillCircle(tpReadX(), tpReadY(), 3, Black);
+
+ chThdSleepMilliseconds(100);
+ }
+}
+