aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-08-17 09:10:10 +0200
committerTectu <joel@unormal.org>2012-08-17 09:10:10 +0200
commit7b10e441c81809d724aa58bf63da51bf26766b7a (patch)
treee5428f1d8d9c92638953b7da14e533202be2becf
parentf0a7643598a221a91f8ec1c79eb3646617d099bd (diff)
downloaduGFX-7b10e441c81809d724aa58bf63da51bf26766b7a.tar.gz
uGFX-7b10e441c81809d724aa58bf63da51bf26766b7a.tar.bz2
uGFX-7b10e441c81809d724aa58bf63da51bf26766b7a.zip
touchpad demo update
-rw-r--r--demos/touchpad/main.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/demos/touchpad/main.c b/demos/touchpad/main.c
index 52f52e83..e55c195b 100644
--- a/demos/touchpad/main.c
+++ b/demos/touchpad/main.c
@@ -23,8 +23,19 @@
#include "gdisp.h"
#include "touchpad.h"
-TOUCHPADDriver TOUCHPADD1 = {
- &SPID1,
+static const SPIConfig spicfg = {
+ NULL, // no callback
+ GPIOC, // CS PORT
+ 6, // CS PIN
+ SPI_CR1_BR_1 | SPI_CR1_BR_0,
+};
+
+TOUCHPADDriver TOUCHPADD1 = {
+ &SPID1, // SPI driver
+ &spicfg, // SPI config
+ GPIO, // IRQ PORT
+ 4, // IRQ PIN
+ TRUE // start SPI
};
int main(void) {
@@ -32,15 +43,14 @@ int main(void) {
chSysInit();
gdispInit();
- gdispClear(Lime);
tpInit(&TOUCHPADD1);
tpCalibrate();
- gdispClear(Lime);
+ gdispClear(Black);
while (TRUE) {
- gdispDrawFillCircle(tpReadX(), tpReadY(), 3, Black);
+ gdispDrawPixel(tpReadX(), tpReadY(), Green);
}
}