summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>2005-01-20 22:13:41 +0000
committerJean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>2005-01-20 22:13:41 +0000
commitcacc37d2e0c1daf8dfa94faa366b859827354be0 (patch)
tree45f7557bf28c0f6d093ac658d0d72f5d860bf3cc
parent2f9bf25175b9b1701b8af4133ed660263b034a05 (diff)
downloadrockbox-cacc37d2e0c1daf8dfa94faa366b859827354be0.tar.gz
rockbox-cacc37d2e0c1daf8dfa94faa366b859827354be0.tar.bz2
rockbox-cacc37d2e0c1daf8dfa94faa366b859827354be0.zip
Support for gmini100 series LCD
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5619 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/lcd-recorder.c54
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 };
static const unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff};
+
+#if CONFIG_CPU == TCC730
+/* Optimization opportunity:
+ In the following I do exactly as in the archos firmware.
+ There is probably is a better way (ie. do only one mask operation)
+*/
+void lcd_write_command(int cmd) {
+ P2 &= 0xF7;
+ P2 &= 0xDF;
+ P2 &= 0xFB;
+ P0 = cmd;
+ P2 |= 0x04;
+ P2 |= 0x08;
+ P2 |= 0x20;
+}
+
+void lcd_write_data( const unsigned char* data, int count ) {
+ int i;
+ for (i=0; i < count; i++) {
+ P2 |= 0x08;
+ P2 &= 0xDF;
+ P2 &= 0xFB;
+ P0 = data[i];
+ P2 |= 0x04;
+ P2 |= 0x08;
+ P2 |= 0x20;
+ }
+}
+#endif
+
+
int lcd_default_contrast(void)
{
#ifdef SIMULATOR
@@ -137,9 +168,19 @@ void lcd_init(void)
*/
void lcd_init (void)
{
+#if CONFIG_CPU == TCC730
+ /* Initialise P0 & some P2 output pins:
+ P0 -> all pins normal cmos output
+ P2 -> pins 1 to 5 normal cmos output. */
+ P0CON = 0xff;
+ P2CONL |= 0x5a;
+ P2CONL &= 0x5b;
+ P2CONH |= 1;
+#else
/* Initialize PB0-3 as output pins */
PBCR2 &= 0xff00; /* MD = 00 */
PBIOR |= 0x000f; /* IOR = 1 */
+#endif
/* inits like the original firmware */
lcd_write_command(LCD_SOFTWARE_RESET);
@@ -253,6 +294,18 @@ void lcd_set_flip(bool yesno)
#else
if (yesno)
#endif
+#if CONFIG_LCD == LCD_GMINI100
+ {
+ lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01);
+ lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08);
+ xoffset = 132 - LCD_WIDTH;
+ } else {
+ lcd_write_command(LCD_SET_SEGMENT_REMAP);
+ lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08);
+ xoffset = 0;
+ }
+#else
+
{
lcd_write_command(LCD_SET_SEGMENT_REMAP);
lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION);
@@ -264,6 +317,7 @@ void lcd_set_flip(bool yesno)
lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08);
xoffset = 0;
}
+#endif
}
/**