summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-recorder.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-recorder.c')
-rw-r--r--firmware/drivers/lcd-recorder.c59
1 files changed, 3 insertions, 56 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index ceeb413709..5c4a0352a7 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -108,35 +108,7 @@ static const char scroll_tick_table[16] = {
108 108
109/* optimised archos recorder code is in lcd.S */ 109/* optimised archos recorder code is in lcd.S */
110 110
111#if CONFIG_CPU == TCC730 111#if CONFIG_CPU == PNX0101
112/* Optimization opportunity:
113 In the following I do exactly as in the archos firmware.
114 There is probably a better way (ie. do only one mask operation)
115*/
116void lcd_write_command(int cmd) {
117 P2 &= 0xF7;
118 P2 &= 0xDF;
119 P2 &= 0xFB;
120 P0 = cmd;
121 P2 |= 0x04;
122 P2 |= 0x08;
123 P2 |= 0x20;
124}
125
126void lcd_write_data( const unsigned char* data, int count ) {
127 int i;
128 for (i=0; i < count; i++) {
129 P2 |= 0x08;
130 P2 &= 0xDF;
131 P2 &= 0xFB;
132 P0 = data[i];
133 P2 |= 0x04;
134 P2 |= 0x08;
135 P2 |= 0x20;
136 }
137}
138
139#elif CONFIG_CPU == PNX0101
140 112
141void lcd_write_command(int cmd) 113void lcd_write_command(int cmd)
142{ 114{
@@ -161,9 +133,7 @@ void lcd_write_data( const unsigned char* data, int count )
161 133
162int lcd_default_contrast(void) 134int lcd_default_contrast(void)
163{ 135{
164#if CONFIG_LCD == LCD_GMINI100 136#if CONFIG_LCD == LCD_IFP7XX
165 return 31;
166#elif CONFIG_LCD == LCD_IFP7XX
167 return 45; 137 return 45;
168#else 138#else
169 return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49; 139 return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49;
@@ -192,20 +162,6 @@ void lcd_set_flip(bool yesno)
192#else 162#else
193 if (yesno) 163 if (yesno)
194#endif 164#endif
195#if CONFIG_LCD == LCD_GMINI100
196 {
197 lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01);
198 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08);
199 xoffset = 132 - LCD_WIDTH;
200 }
201 else
202 {
203 lcd_write_command(LCD_SET_SEGMENT_REMAP);
204 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08);
205 xoffset = 0;
206 }
207#else
208
209 { 165 {
210 lcd_write_command(LCD_SET_SEGMENT_REMAP); 166 lcd_write_command(LCD_SET_SEGMENT_REMAP);
211 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION); 167 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION);
@@ -221,7 +177,6 @@ void lcd_set_flip(bool yesno)
221 xoffset = 0; 177 xoffset = 0;
222#endif 178#endif
223 } 179 }
224#endif
225} 180}
226 181
227#endif /* !SIMULATOR */ 182#endif /* !SIMULATOR */
@@ -238,15 +193,7 @@ void lcd_init(void)
238 193
239void lcd_init(void) 194void lcd_init(void)
240{ 195{
241#if CONFIG_CPU == TCC730 196#if CONFIG_CPU == PNX0101
242 /* Initialise P0 & some P2 output pins:
243 P0 -> all pins normal cmos output
244 P2 -> pins 1 to 5 normal cmos output. */
245 P0CON = 0xff;
246 P2CONL |= 0x5a;
247 P2CONL &= 0x5b;
248 P2CONH |= 1;
249#elif CONFIG_CPU == PNX0101
250 LCDREG10 = 0xf; 197 LCDREG10 = 0xf;
251 LCDREG04 = 0x4084; 198 LCDREG04 = 0x4084;
252#else 199#else