diff options
author | Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com> | 2005-01-20 22:13:41 +0000 |
---|---|---|
committer | Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com> | 2005-01-20 22:13:41 +0000 |
commit | cacc37d2e0c1daf8dfa94faa366b859827354be0 (patch) | |
tree | 45f7557bf28c0f6d093ac658d0d72f5d860bf3cc /firmware/drivers/lcd-recorder.c | |
parent | 2f9bf25175b9b1701b8af4133ed660263b034a05 (diff) | |
download | rockbox-cacc37d2e0c1daf8dfa94faa366b859827354be0.tar.gz rockbox-cacc37d2e0c1daf8dfa94faa366b859827354be0.zip |
Support for gmini100 series LCD
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5619 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-recorder.c')
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 880717d277..df1acd7017 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c | |||
@@ -113,6 +113,37 @@ static const unsigned char zeros[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; | |||
113 | static const unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff, | 113 | static const unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff, |
114 | 0xff, 0xff, 0xff, 0xff}; | 114 | 0xff, 0xff, 0xff, 0xff}; |
115 | 115 | ||
116 | |||
117 | #if CONFIG_CPU == TCC730 | ||
118 | /* Optimization opportunity: | ||
119 | In the following I do exactly as in the archos firmware. | ||
120 | There is probably is a better way (ie. do only one mask operation) | ||
121 | */ | ||
122 | void lcd_write_command(int cmd) { | ||
123 | P2 &= 0xF7; | ||
124 | P2 &= 0xDF; | ||
125 | P2 &= 0xFB; | ||
126 | P0 = cmd; | ||
127 | P2 |= 0x04; | ||
128 | P2 |= 0x08; | ||
129 | P2 |= 0x20; | ||
130 | } | ||
131 | |||
132 | void lcd_write_data( const unsigned char* data, int count ) { | ||
133 | int i; | ||
134 | for (i=0; i < count; i++) { | ||
135 | P2 |= 0x08; | ||
136 | P2 &= 0xDF; | ||
137 | P2 &= 0xFB; | ||
138 | P0 = data[i]; | ||
139 | P2 |= 0x04; | ||
140 | P2 |= 0x08; | ||
141 | P2 |= 0x20; | ||
142 | } | ||
143 | } | ||
144 | #endif | ||
145 | |||
146 | |||
116 | int lcd_default_contrast(void) | 147 | int lcd_default_contrast(void) |
117 | { | 148 | { |
118 | #ifdef SIMULATOR | 149 | #ifdef SIMULATOR |
@@ -137,9 +168,19 @@ void lcd_init(void) | |||
137 | */ | 168 | */ |
138 | void lcd_init (void) | 169 | void lcd_init (void) |
139 | { | 170 | { |
171 | #if CONFIG_CPU == TCC730 | ||
172 | /* Initialise P0 & some P2 output pins: | ||
173 | P0 -> all pins normal cmos output | ||
174 | P2 -> pins 1 to 5 normal cmos output. */ | ||
175 | P0CON = 0xff; | ||
176 | P2CONL |= 0x5a; | ||
177 | P2CONL &= 0x5b; | ||
178 | P2CONH |= 1; | ||
179 | #else | ||
140 | /* Initialize PB0-3 as output pins */ | 180 | /* Initialize PB0-3 as output pins */ |
141 | PBCR2 &= 0xff00; /* MD = 00 */ | 181 | PBCR2 &= 0xff00; /* MD = 00 */ |
142 | PBIOR |= 0x000f; /* IOR = 1 */ | 182 | PBIOR |= 0x000f; /* IOR = 1 */ |
183 | #endif | ||
143 | 184 | ||
144 | /* inits like the original firmware */ | 185 | /* inits like the original firmware */ |
145 | lcd_write_command(LCD_SOFTWARE_RESET); | 186 | lcd_write_command(LCD_SOFTWARE_RESET); |
@@ -253,6 +294,18 @@ void lcd_set_flip(bool yesno) | |||
253 | #else | 294 | #else |
254 | if (yesno) | 295 | if (yesno) |
255 | #endif | 296 | #endif |
297 | #if CONFIG_LCD == LCD_GMINI100 | ||
298 | { | ||
299 | lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01); | ||
300 | lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08); | ||
301 | xoffset = 132 - LCD_WIDTH; | ||
302 | } else { | ||
303 | lcd_write_command(LCD_SET_SEGMENT_REMAP); | ||
304 | lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08); | ||
305 | xoffset = 0; | ||
306 | } | ||
307 | #else | ||
308 | |||
256 | { | 309 | { |
257 | lcd_write_command(LCD_SET_SEGMENT_REMAP); | 310 | lcd_write_command(LCD_SET_SEGMENT_REMAP); |
258 | lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION); | 311 | lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION); |
@@ -264,6 +317,7 @@ void lcd_set_flip(bool yesno) | |||
264 | lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08); | 317 | lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08); |
265 | xoffset = 0; | 318 | xoffset = 0; |
266 | } | 319 | } |
320 | #endif | ||
267 | } | 321 | } |
268 | 322 | ||
269 | /** | 323 | /** |