summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Dziok <b0hoon@o2.pl>2010-12-13 21:13:04 +0000
committerSzymon Dziok <b0hoon@o2.pl>2010-12-13 21:13:04 +0000
commitbf34449638ddea6b88a5743b1d345e33e7052384 (patch)
treefe734eab39af977aa50fa17d8d1facbd6a611612
parentabf28a95864f86f952b77bc25740f0dcc7a560bf (diff)
downloadrockbox-bf34449638ddea6b88a5743b1d345e33e7052384.zip
rockbox-bf34449638ddea6b88a5743b1d345e33e7052384.tar.gz
rockbox-bf34449638ddea6b88a5743b1d345e33e7052384.tar.bz2
rockbox-bf34449638ddea6b88a5743b1d345e33e7052384.tar.xz
HDD6330: implement initialization and inversion of lcd.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28826 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config/gogearhdd6330.h2
-rw-r--r--firmware/target/arm/philips/hdd6330/lcd-hdd6330.c53
2 files changed, 30 insertions, 25 deletions
diff --git a/firmware/export/config/gogearhdd6330.h b/firmware/export/config/gogearhdd6330.h
index 786b9ad..c91e2a4 100644
--- a/firmware/export/config/gogearhdd6330.h
+++ b/firmware/export/config/gogearhdd6330.h
@@ -74,7 +74,7 @@
/* #define HAVE_LCD_FLIP */
/* define this if you can invert the colours on your LCD */
-/* #define HAVE_LCD_INVERT */
+#define HAVE_LCD_INVERT
/* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */
diff --git a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
index 53c0be1..4549f09 100644
--- a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
+++ b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
@@ -24,6 +24,16 @@
#include "kernel.h"
#include "system.h"
+/* register defines for Philips LCD 220x176x16 - model: LPH9165-2 */
+#define LCD_REG_UNKNOWN_00 0x00
+#define LCD_REG_UNKNOWN_01 0x01
+#define LCD_REG_UNKNOWN_05 0x05
+#define LCD_REG_WRITE_DATA_2_GRAM 0x06
+#define LCD_REG_HORIZ_ADDR_START 0x08
+#define LCD_REG_HORIZ_ADDR_END 0x09
+#define LCD_REG_VERT_ADDR_START 0x0a
+#define LCD_REG_VERT_ADDR_END 0x0b
+
/* Display status */
static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
@@ -50,7 +60,12 @@ static void lcd_send_reg(unsigned reg)
void lcd_init_device(void)
{
- /* init handled by the OF bootloader */
+ lcd_send_reg(LCD_REG_UNKNOWN_00);
+ lcd_send_data(0x00);
+ lcd_send_reg(LCD_REG_UNKNOWN_01);
+ lcd_send_data(0x48);
+ lcd_send_reg(LCD_REG_UNKNOWN_05);
+ lcd_send_data(0x0f);
}
/*** hardware configuration ***/
@@ -66,7 +81,9 @@ void lcd_set_contrast(int val)
void lcd_set_invert_display(bool yesno)
{
- (void)yesno;
+ int invert = (yesno) ? 0x40 : 0x00;
+ lcd_send_reg(LCD_REG_UNKNOWN_00);
+ lcd_send_data(invert);
}
/* turn the display upside down (call lcd_update() afterwards) */
@@ -107,25 +124,19 @@ void lcd_blit_yuv(unsigned char * const src[3],
width = (width + 1) & ~1;
- lcd_send_reg(0x01);
- lcd_send_data(0x48);
-
- lcd_send_reg(0x05);
- lcd_send_data(0x0f);
-
- lcd_send_reg(0x08);
+ lcd_send_reg(LCD_REG_HORIZ_ADDR_START);
lcd_send_data(y);
- lcd_send_reg(0x09);
+ lcd_send_reg(LCD_REG_HORIZ_ADDR_END);
lcd_send_data(y + height - 1);
- lcd_send_reg(0x0a);
+ lcd_send_reg(LCD_REG_VERT_ADDR_START);
lcd_send_data(x + 16);
- lcd_send_reg(0x0b);
+ lcd_send_reg(LCD_REG_VERT_ADDR_END);
lcd_send_data(x + width - 1 + 16);
- lcd_send_reg(0x06);
+ lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM);
const int stride_div_csub_x = stride/CSUB_X;
@@ -205,25 +216,19 @@ void lcd_update_rect(int x, int y, int width, int height)
if ((width <= 0) || (height <= 0))
return; /* Nothing left to do. */
- lcd_send_reg(0x01);
- lcd_send_data(0x48);
-
- lcd_send_reg(0x05);
- lcd_send_data(0x0f);
-
- lcd_send_reg(0x08);
+ lcd_send_reg(LCD_REG_HORIZ_ADDR_START);
lcd_send_data(y);
- lcd_send_reg(0x09);
+ lcd_send_reg(LCD_REG_HORIZ_ADDR_END);
lcd_send_data(y + height - 1);
- lcd_send_reg(0x0a);
+ lcd_send_reg(LCD_REG_VERT_ADDR_START);
lcd_send_data(x + 16);
- lcd_send_reg(0x0b);
+ lcd_send_reg(LCD_REG_VERT_ADDR_END);
lcd_send_data(x + width - 1 + 16);
- lcd_send_reg(0x06);
+ lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM);
addr = (unsigned long*)&lcd_framebuffer[y][x];