diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-09-22 14:21:07 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-09-22 14:21:07 +0000 |
commit | d331d00a2d18654ff5ea493adb194fc4a8aa5976 (patch) | |
tree | 1a83be2570035f6fc926433a487a2522223998c0 /bootloader | |
parent | 376169ab957b38902f58e4e531c4600f79bd4424 (diff) | |
download | rockbox-d331d00a2d18654ff5ea493adb194fc4a8aa5976.tar.gz rockbox-d331d00a2d18654ff5ea493adb194fc4a8aa5976.zip |
start of the tsc2100 driver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14816 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rwxr-xr-x | bootloader/mrobe500.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c index 1bfadd4769..3c98ae25f3 100755 --- a/bootloader/mrobe500.c +++ b/bootloader/mrobe500.c | |||
@@ -38,8 +38,9 @@ | |||
38 | #include "common.h" | 38 | #include "common.h" |
39 | #include "rbunicode.h" | 39 | #include "rbunicode.h" |
40 | #include "usb.h" | 40 | #include "usb.h" |
41 | #include "spi-target.h" | 41 | #include "spi.h" |
42 | #include "uart-target.h" | 42 | #include "uart-target.h" |
43 | #include "tsc2100.h" | ||
43 | 44 | ||
44 | extern int line; | 45 | extern int line; |
45 | 46 | ||
@@ -59,7 +60,7 @@ void main(void) | |||
59 | uartSetup(); | 60 | uartSetup(); |
60 | lcd_init(); | 61 | lcd_init(); |
61 | font_init(); | 62 | font_init(); |
62 | dm320_spi_init(); | 63 | spi_init(); |
63 | 64 | ||
64 | lcd_setfont(FONT_SYSFIXED); | 65 | lcd_setfont(FONT_SYSFIXED); |
65 | 66 | ||
@@ -102,7 +103,7 @@ void main(void) | |||
102 | 103 | ||
103 | printf("ATA"); | 104 | printf("ATA"); |
104 | 105 | ||
105 | outw(inw(IO_GIO_DIR1)&~(1<<10), IO_GIO_DIR1); // set GIO26 to output | 106 | outw(inw(IO_GIO_DIR1)&~(1<<10), IO_GIO_DIR1); // set GIO26 (reset pin) to output |
106 | while(true) | 107 | while(true) |
107 | { | 108 | { |
108 | if (button_read_device() == BUTTON_POWER) | 109 | if (button_read_device() == BUTTON_POWER) |
@@ -110,20 +111,15 @@ void main(void) | |||
110 | printf("reset"); | 111 | printf("reset"); |
111 | outw(1<<10, IO_GIO_BITSET1); | 112 | outw(1<<10, IO_GIO_BITSET1); |
112 | } | 113 | } |
113 | 114 | // if ((inw(IO_GIO_BITSET0)&(1<<14)) == 0) | |
114 | // Read X, Y, Z1, Z2 touchscreen coordinates. | 115 | { |
115 | int page = 0, address = 0; | 116 | short x,y,z1,z2, reg; |
116 | unsigned short command = 0x8000|(page << 11)|(address << 5); | 117 | tsc2100_read_values(&x, &y, &z1, &z2); |
117 | unsigned char out[] = {command >> 8, command & 0xff}; | 118 | printf("x: %04x y: %04x z1: %04x z2: %04x", x, y, z1, z2); |
118 | unsigned char in[8]; | 119 | printf("tsadc: %4x", tsc2100_readreg(TSADC_PAGE, TSADC_ADDRESS)&0xffff); |
119 | dm320_spi_block_transfer(out, sizeof(out), in, sizeof(in)); | 120 | tsc2100_keyclick(); /* doesnt work :( */ |
120 | 121 | line -= 2; | |
121 | printf("%02x%02x %02x%02x %02x%02x %02x%02x\n", | 122 | } |
122 | in[0], in[1], | ||
123 | in[2], in[3], | ||
124 | in[4], in[5], | ||
125 | in[6], in[7]); | ||
126 | line--; | ||
127 | 123 | ||
128 | } | 124 | } |
129 | #if 0 | 125 | #if 0 |