comparison 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
comparison
equal deleted inserted replaced
7:9404b9869c27 8:58d76cf522ff
1 /* Touch controller (TSC2046N) defines */
2 /* Mode/channel select defines */
3 #define TP_READ_SEL(chan, mode, ref, pd) (0x80 | (((chan) & 0x07) << 4) | (((mode) & 0x01) << 3) | (((ref) & 0x01) << 2) | ((pd) & 0x03))
4
5 /* Channel select */
6 #define TP_CHAN_TEMP0 0
7 #define TP_CHAN_Y 1
8 #define TP_CHAN_VBAT 2
9 #define TP_CHAN_Z1 3
10 #define TP_CHAN_Z2 4
11 #define TP_CHAN_X 5
12 #define TP_CHAN_AUX 6
13 #define TP_CHAN_TEMP1 7
14
15 /* Mode select */
16 #define TP_MODE_12 0
17 #define TP_MODE_8 1
18
19 /* Reference type */
20 #define TP_REF_DIFF 0
21 #define TP_REF_SER 1
22
23 /* Power down mode */
24 #define TP_PD_AUTO 0
25 #define TP_PD_REF_OFF 1
26 #define TP_PD_REF_ON 2
27 #define TP_PD_ON 3
28
29 uint16_t tp_read(uint8_t type);
30 void tp_getcoords(uint16_t *x, uint16_t *y, uint16_t *z1, uint16_t *z2, float *t, float *t2);
31