summaryrefslogtreecommitdiff
path: root/firmware/target/arm/philips/hdd6330
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 /firmware/target/arm/philips/hdd6330
parentabf28a95864f86f952b77bc25740f0dcc7a560bf (diff)
HDD6330: implement initialization and inversion of lcd.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28826 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/philips/hdd6330')
-rw-r--r--firmware/target/arm/philips/hdd6330/lcd-hdd6330.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
index 53c0be1d6e..4549f09d2a 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];