aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-06-08 00:07:43 +0200
committerTectu <joel@unormal.org>2012-06-08 00:07:43 +0200
commit9220a1ea3cb149b05af5d099b4e36674a1292e1d (patch)
tree946b78c13cbf1913b28c12e7e6f00a706e3b88ba
parentcb3292bf36bd1f06d08a1a345cfbd9bae67e941e (diff)
downloaduGFX-9220a1ea3cb149b05af5d099b4e36674a1292e1d.tar.gz
uGFX-9220a1ea3cb149b05af5d099b4e36674a1292e1d.tar.bz2
uGFX-9220a1ea3cb149b05af5d099b4e36674a1292e1d.zip
cleanup & doc
-rw-r--r--touchpad.c2
-rw-r--r--touchpad.h41
2 files changed, 40 insertions, 3 deletions
diff --git a/touchpad.c b/touchpad.c
index 51b6e227..a7ef221c 100644
--- a/touchpad.c
+++ b/touchpad.c
@@ -116,7 +116,7 @@ uint16_t tpReadY(void) {
}
}
-void tpDrawCross(uint16_t x, uint16_t y) {
+static void tpDrawCross(uint16_t x, uint16_t y) {
lcdDrawLine(x-15, y, x-2, y, 0xffff);
lcdDrawLine(x+2, y, x+15, y, 0xffff);
lcdDrawLine(x, y-15, x, y-2, 0xffff);
diff --git a/touchpad.h b/touchpad.h
index c9a686c6..24ded2e5 100644
--- a/touchpad.h
+++ b/touchpad.h
@@ -15,12 +15,49 @@ volatile struct cal {
float yn;
};
+/*
+ * Description: initializes touchpad (SPI)
+ *
+ * param: none
+ *
+ * return: none
+ */
void tpInit(void);
+
+/*
+ * Description: reads out PEN_IRQ from touchpad controller
+ *
+ * param: none
+ *
+ * return: 1 = touchpad pressed / 0 = touchpad not pressed
+ */
uint8_t tpIRQ(void);
+
+/*
+ * Description: reads-out X coordinate, calibrated
+ *
+ * param: none
+ *
+ * return: X coordinate, relative to screen zero-point
+ */
uint16_t tpReadX(void);
+
+/*
+ * Description: reads-out Y coordinate, calibrated
+ *
+ * param: none
+ *
+ * return: Y coordinate, relative to screen zero-point
+ */
uint16_t tpReadY(void);
+
+/*
+ * Description: calibration routine
+ *
+ * param: none
+ *
+ * return: none
+ */
void tpCalibrate(void);
-void tpCalibrate2(void);
-void tpDrawCross(uint16_t x, uint16_t y);
#endif