view touch.h @ 49:ace431a0d0f5

Add SDIO code poached from STM. Use FatFS to read from SD card. LFN doesn't work reliably so it's disabled for now.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 03 Apr 2013 23:34:20 +1030
parents 58d76cf522ff
children
line wrap: on
line source

/* 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);