aboutsummaryrefslogtreecommitdiffstats
path: root/demos/touchpad/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/touchpad/main.c')
-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);
+ }
+}
+