added touchpad demo
This commit is contained in:
parent
72d1bef6c3
commit
1a6eed0c07
1 changed files with 26 additions and 0 deletions
26
demos/touchpad/main.c
Normal file
26
demos/touchpad/main.c
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue