diff touch.h @ 8:58d76cf522ff

Split out code into separate files.
author Daniel O'Connor <darius@dons.net.au>
date Sat, 04 Feb 2012 13:29:31 +1030
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/touch.h	Sat Feb 04 13:29:31 2012 +1030
@@ -0,0 +1,31 @@
+/* Touch controller (TSC2046N) defines */
+/* Mode/channel select defines */
+#define TP_READ_SEL(chan, mode, ref, pd) (0x80 | (((chan) & 0x07) << 4) | (((mode) & 0x01) << 3) | (((ref) & 0x01) << 2) | ((pd) & 0x03))
+
+/* Channel select */
+#define TP_CHAN_TEMP0	0
+#define TP_CHAN_Y	1	
+#define TP_CHAN_VBAT	2
+#define TP_CHAN_Z1	3
+#define TP_CHAN_Z2	4
+#define TP_CHAN_X	5
+#define TP_CHAN_AUX	6
+#define TP_CHAN_TEMP1	7
+
+/* Mode select */
+#define TP_MODE_12	0
+#define TP_MODE_8	1
+
+/* Reference type */
+#define TP_REF_DIFF	0
+#define TP_REF_SER	1
+
+/* Power down mode */
+#define TP_PD_AUTO	0
+#define TP_PD_REF_OFF	1
+#define TP_PD_REF_ON	2
+#define TP_PD_ON	3
+
+uint16_t	tp_read(uint8_t type);
+void		tp_getcoords(uint16_t *x, uint16_t *y, uint16_t *z1, uint16_t *z2, float *t, float *t2);
+