aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/touchpad
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-06-29 13:08:53 +0200
committerTectu <joel@unormal.org>2012-06-29 13:08:53 +0200
commit9b46b61f57a935cf759866d1fc2cb170e7b26d09 (patch)
treed1be0019991033deeb7a6c6ceaf97c0df09c64a6 /drivers/touchpad
parent21cb0c74548334694d6900fca25dae6874b99b0e (diff)
downloaduGFX-9b46b61f57a935cf759866d1fc2cb170e7b26d09.tar.gz
uGFX-9b46b61f57a935cf759866d1fc2cb170e7b26d09.tar.bz2
uGFX-9b46b61f57a935cf759866d1fc2cb170e7b26d09.zip
changed TP_CS macros. Added TP_CS_PORT
Diffstat (limited to 'drivers/touchpad')
-rw-r--r--drivers/touchpad/ads7843_lld.c10
-rw-r--r--drivers/touchpad/xpt2046_lld.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/touchpad/ads7843_lld.c b/drivers/touchpad/ads7843_lld.c
index 76e11123..507a2104 100644
--- a/drivers/touchpad/ads7843_lld.c
+++ b/drivers/touchpad/ads7843_lld.c
@@ -8,10 +8,10 @@ __inline uint16_t lld_readX(void) {
uint16_t x;
txbuf[0] = 0xd0;
- SET_CS(0);
- spiSend(&SPID1, 1, txbuf);
+ TP_CS_LOW;
+ spiSend(&SPID1, 1, txbuf);
spiReceive(&SPID1, 2, rxbuf);
- SET_CS(1);
+ TP_CS_HIGH;
x = rxbuf[0] << 4;
x |= rxbuf[1] >> 4;
@@ -25,10 +25,10 @@ __inline uint16_t lld_readY(void) {
uint16_t y;
txbuf[0] = 0x90;
- SET_CS(0);
+ TP_CS_LOW;
spiSend(&SPID1, 1, txbuf);
spiReceive(&SPID1, 2, rxbuf);
- SET_CS(1);
+ TP_CS_HIGH;
y = rxbuf[0] << 4;
y |= rxbuf[1] >> 4;
diff --git a/drivers/touchpad/xpt2046_lld.c b/drivers/touchpad/xpt2046_lld.c
index 731ff8c5..02ded390 100644
--- a/drivers/touchpad/xpt2046_lld.c
+++ b/drivers/touchpad/xpt2046_lld.c
@@ -8,10 +8,10 @@ __inline uint16_t lld_readX(void) {
uint16_t x;
txbuf[0] = 0xd0;
- SET_CS(0);
- spiSend(&SPID1, 1, txbuf);
+ TP_CS_LOW;
+ spiSend(&SPID1, 1, txbuf);
spiReceive(&SPID1, 2, rxbuf);
- SET_CS(1);
+ TP_CS_HIGH;
x = rxbuf[0] << 4;
x |= rxbuf[1] >> 4;
@@ -25,10 +25,10 @@ __inline uint16_t lld_readY(void) {
uint16_t y;
txbuf[0] = 0x90;
- SET_CS(0);
+ TP_CS_LOW;
spiSend(&SPID1, 1, txbuf);
spiReceive(&SPID1, 2, rxbuf);
- SET_CS(1);
+ TP_CS_HIGH;
y = rxbuf[0] << 4;
y |= rxbuf[1] >> 4;