summaryrefslogtreecommitdiff
path: root/firmware/drivers/tsc2100.c
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-06-24 04:17:15 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-06-24 04:17:15 +0000
commit19cb4446919dff3b0c6e5a48c9b0192c01740ecc (patch)
treef9ebc1fc443e962a428ec0f3e3ff82c427864675 /firmware/drivers/tsc2100.c
parent1910d026b1593efd37da276397d0fa157d96d877 (diff)
downloadrockbox-19cb4446919dff3b0c6e5a48c9b0192c01740ecc.tar.gz
rockbox-19cb4446919dff3b0c6e5a48c9b0192c01740ecc.zip
M:Robe 500: RTC is now working, Added some SPI flexibility per end device and modified the interrupt handler for the tsc2100 which should make it more reliable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21483 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/tsc2100.c')
-rw-r--r--firmware/drivers/tsc2100.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/firmware/drivers/tsc2100.c b/firmware/drivers/tsc2100.c
index 271a557822..32a3516e9d 100644
--- a/firmware/drivers/tsc2100.c
+++ b/firmware/drivers/tsc2100.c
@@ -44,7 +44,7 @@ void tsc2100_read_data(void)
44 44
45 adc_last_read=current_tick; 45 adc_last_read=current_tick;
46 46
47 spi_block_transfer(SPI_target_TSC2100, false, 47 spi_block_transfer(SPI_target_TSC2100,
48 out, sizeof(out), (char *)adc_data, sizeof(adc_data)); 48 out, sizeof(out), (char *)adc_data, sizeof(adc_data));
49 49
50 for(i=0; i<sizeof(adc_data); i+=2) 50 for(i=0; i<sizeof(adc_data); i+=2)
@@ -128,8 +128,7 @@ short tsc2100_readreg(int page, int address)
128 unsigned short command = 0x8000|(page << 11)|(address << 5); 128 unsigned short command = 0x8000|(page << 11)|(address << 5);
129 unsigned char out[] = {command >> 8, command & 0xff}; 129 unsigned char out[] = {command >> 8, command & 0xff};
130 unsigned char in[2]; 130 unsigned char in[2];
131 spi_block_transfer(SPI_target_TSC2100, false, 131 spi_block_transfer(SPI_target_TSC2100, out, sizeof(out), in, sizeof(in));
132 out, sizeof(out), in, sizeof(in));
133 return (in[0]<<8)|in[1]; 132 return (in[0]<<8)|in[1];
134} 133}
135 134
@@ -139,8 +138,7 @@ void tsc2100_writereg(int page, int address, short value)
139 unsigned short command = (page << 11)|(address << 5); 138 unsigned short command = (page << 11)|(address << 5);
140 unsigned char out[4] = {command >> 8, command & 0xff, 139 unsigned char out[4] = {command >> 8, command & 0xff,
141 value >> 8, value & 0xff}; 140 value >> 8, value & 0xff};
142 spi_block_transfer(SPI_target_TSC2100, false, 141 spi_block_transfer(SPI_target_TSC2100, out, sizeof(out), NULL, 0);
143 out, sizeof(out), NULL, 0);
144} 142}
145 143
146void tsc2100_keyclick(void) 144void tsc2100_keyclick(void)