summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-recorder.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-01-12 00:35:50 +0000
committerDave Chapman <dave@dchapman.com>2006-01-12 00:35:50 +0000
commitd83e929f3fc369a5981e1e40e1c5307169a46cfc (patch)
treeac323ca5811374a030a1b65bb77fc7ccc163db04 /firmware/drivers/lcd-recorder.c
parent8d130684214d23a9163810d1dacc33d108f2338a (diff)
downloadrockbox-d83e929f3fc369a5981e1e40e1c5307169a46cfc.tar.gz
rockbox-d83e929f3fc369a5981e1e40e1c5307169a46cfc.zip
Work-in-progress iriver iFP-7xx port by Tomasz Malesinski
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8342 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-recorder.c')
-rw-r--r--firmware/drivers/lcd-recorder.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index 081a7a5267..523e8a1c09 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -135,6 +135,24 @@ void lcd_write_data( const unsigned char* data, int count ) {
135 P2 |= 0x20; 135 P2 |= 0x20;
136 } 136 }
137} 137}
138
139#elif CONFIG_CPU == PNX0101
140
141void lcd_write_command(int cmd)
142{
143 while ((LCDSTAT & 3) != 3);
144 LCDCMD = cmd;
145}
146
147void lcd_write_data( const unsigned char* data, int count )
148{
149 int i;
150 for (i=0; i < count; i++) {
151 while ((LCDSTAT & 3) != 3);
152 LCDDATA = data[i];
153 }
154}
155
138#endif 156#endif
139 157
140/*** hardware configuration ***/ 158/*** hardware configuration ***/
@@ -145,6 +163,8 @@ int lcd_default_contrast(void)
145 return 30; 163 return 30;
146#elif CONFIG_LCD == LCD_GMINI100 164#elif CONFIG_LCD == LCD_GMINI100
147 return 31; 165 return 31;
166#elif CONFIG_LCD == LCD_IFP7XX
167 return 45;
148#else 168#else
149 return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49; 169 return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49;
150#endif 170#endif
@@ -197,7 +217,11 @@ void lcd_set_flip(bool yesno)
197 { 217 {
198 lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01); 218 lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01);
199 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08); 219 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08);
220#if CONFIG_LCD == LCD_IFP7XX
221 xoffset = 4;
222#else
200 xoffset = 0; 223 xoffset = 0;
224#endif
201 } 225 }
202#endif 226#endif
203} 227}
@@ -236,6 +260,9 @@ void lcd_init(void)
236 P2CONL |= 0x5a; 260 P2CONL |= 0x5a;
237 P2CONL &= 0x5b; 261 P2CONL &= 0x5b;
238 P2CONH |= 1; 262 P2CONH |= 1;
263#elif CONFIG_CPU == PNX0101
264 LCDREG10 = 0xf;
265 LCDREG04 = 0x4084;
239#else 266#else
240 /* Initialize PB0-3 as output pins */ 267 /* Initialize PB0-3 as output pins */
241 PBCR2 &= 0xff00; /* MD = 00 */ 268 PBCR2 &= 0xff00; /* MD = 00 */
@@ -245,7 +272,11 @@ void lcd_init(void)
245 /* inits like the original firmware */ 272 /* inits like the original firmware */
246 lcd_write_command(LCD_SOFTWARE_RESET); 273 lcd_write_command(LCD_SOFTWARE_RESET);
247 lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4); 274 lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4);
275#if CONFIG_LCD == LCD_IFP7XX
276 lcd_write_command(LCD_SET_LCD_BIAS);
277#else
248 lcd_write_command(LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */ 278 lcd_write_command(LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */
279#endif
249 lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER + 7); 280 lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER + 7);
250 /* power control register: op-amp=1, regulator=1, booster=1 */ 281 /* power control register: op-amp=1, regulator=1, booster=1 */
251 lcd_write_command(LCD_SET_DISPLAY_ON); 282 lcd_write_command(LCD_SET_DISPLAY_ON);