summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8700
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2009-08-08 09:24:42 +0000
committerBertrik Sikken <bertrik@sikken.nl>2009-08-08 09:24:42 +0000
commitc8e39403f414814d07129f9c7dc0f0c04edbf45f (patch)
tree5f6cb9f94afbcd558cf7cf367a8949b31f745a2d /firmware/target/arm/s5l8700
parent236a0582c314951c9db38d644ff0c4057e34cfcc (diff)
downloadrockbox-c8e39403f414814d07129f9c7dc0f0c04edbf45f.tar.gz
rockbox-c8e39403f414814d07129f9c7dc0f0c04edbf45f.zip
Samsung yp-s3: clean up the lcd and button driver (making things static, rename variables etc.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22203 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/s5l8700')
-rw-r--r--firmware/target/arm/s5l8700/yps3/button-yps3.c22
-rw-r--r--firmware/target/arm/s5l8700/yps3/lcd-yps3.c8
2 files changed, 16 insertions, 14 deletions
diff --git a/firmware/target/arm/s5l8700/yps3/button-yps3.c b/firmware/target/arm/s5l8700/yps3/button-yps3.c
index afcf89666b..bde322633c 100644
--- a/firmware/target/arm/s5l8700/yps3/button-yps3.c
+++ b/firmware/target/arm/s5l8700/yps3/button-yps3.c
@@ -24,6 +24,7 @@
24 24
25#include "inttypes.h" 25#include "inttypes.h"
26#include "s5l8700.h" 26#include "s5l8700.h"
27#include "button.h"
27#include "button-target.h" 28#include "button-target.h"
28 29
29/* Button driver for the touch keys on the Samsung YP-S3 30/* Button driver for the touch keys on the Samsung YP-S3
@@ -63,7 +64,8 @@ void button_init_device(void)
63 PCON4 &= ~0x0000F000; 64 PCON4 &= ~0x0000F000;
64} 65}
65 66
66static unsigned int tkey_read(void) 67/* returns the raw 20-bit word from the touch key controller */
68static int tkey_read(void)
67{ 69{
68 static int value = 0; 70 static int value = 0;
69 int i; 71 int i;
@@ -103,7 +105,7 @@ static unsigned int tkey_read(void)
103int button_read_device(void) 105int button_read_device(void)
104{ 106{
105 int buttons = 0; 107 int buttons = 0;
106 static unsigned int data; 108 int tkey_data;
107 109
108 /* hold switch */ 110 /* hold switch */
109 if (button_hold()) { 111 if (button_hold()) {
@@ -116,26 +118,26 @@ int button_read_device(void)
116 } 118 }
117 119
118 /* touch keys */ 120 /* touch keys */
119 data = tkey_read(); 121 tkey_data = tkey_read();
120 if (data & (1 << 9)) { 122 if (tkey_data & (1 << 9)) {
121 buttons |= BUTTON_BACK; 123 buttons |= BUTTON_BACK;
122 } 124 }
123 if (data & (1 << 8)) { 125 if (tkey_data & (1 << 8)) {
124 buttons |= BUTTON_UP; 126 buttons |= BUTTON_UP;
125 } 127 }
126 if (data & (1 << 7)) { 128 if (tkey_data & (1 << 7)) {
127 buttons |= BUTTON_MENU; 129 buttons |= BUTTON_MENU;
128 } 130 }
129 if (data & (1 << 6)) { 131 if (tkey_data & (1 << 6)) {
130 buttons |= BUTTON_LEFT; 132 buttons |= BUTTON_LEFT;
131 } 133 }
132 if (data & (1 << 5)) { 134 if (tkey_data & (1 << 5)) {
133 buttons |= BUTTON_SELECT; 135 buttons |= BUTTON_SELECT;
134 } 136 }
135 if (data & (1 << 4)) { 137 if (tkey_data & (1 << 4)) {
136 buttons |= BUTTON_RIGHT; 138 buttons |= BUTTON_RIGHT;
137 } 139 }
138 if (data & (1 << 3)) { 140 if (tkey_data & (1 << 3)) {
139 buttons |= BUTTON_DOWN; 141 buttons |= BUTTON_DOWN;
140 } 142 }
141 143
diff --git a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c
index 6093eb3054..3b57a50ec0 100644
--- a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c
+++ b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c
@@ -85,7 +85,7 @@ static void lcd_wcmd_data(unsigned int cmd, unsigned int data)
85 lcd_wdata(data); 85 lcd_wdata(data);
86} 86}
87 87
88void lcd_init1(void) 88static void lcd_init1(void)
89{ 89{
90 lcd_wcmd(0x11); 90 lcd_wcmd(0x11);
91 lcd_delay(10000); 91 lcd_delay(10000);
@@ -157,7 +157,7 @@ void lcd_init1(void)
157 lcd_wcmd(0x2C); 157 lcd_wcmd(0x2C);
158} 158}
159 159
160void lcd_init2(void) 160static void lcd_init2(void)
161{ 161{
162 lcd_wcmd_data(0x00, 0x0001); 162 lcd_wcmd_data(0x00, 0x0001);
163 lcd_delay(50000); 163 lcd_delay(50000);
@@ -234,7 +234,7 @@ void lcd_init2(void)
234} 234}
235 235
236 236
237void lcd_set_window1(int x, int y, int width, int height) 237static void lcd_set_window1(int x, int y, int width, int height)
238{ 238{
239 (void)x; 239 (void)x;
240 (void)width; 240 (void)width;
@@ -250,7 +250,7 @@ void lcd_set_window1(int x, int y, int width, int height)
250 lcd_wdata(0); 250 lcd_wdata(0);
251} 251}
252 252
253void lcd_set_window2(int x, int y, int width, int height) 253static void lcd_set_window2(int x, int y, int width, int height)
254{ 254{
255 lcd_wcmd_data(0x50, x); 255 lcd_wcmd_data(0x50, x);
256 lcd_wcmd_data(0x51, x + width - 1); 256 lcd_wcmd_data(0x51, x + width - 1);