diff options
author | Szymon Dziok <b0hoon@o2.pl> | 2010-12-13 21:13:04 +0000 |
---|---|---|
committer | Szymon Dziok <b0hoon@o2.pl> | 2010-12-13 21:13:04 +0000 |
commit | bf34449638ddea6b88a5743b1d345e33e7052384 (patch) | |
tree | fe734eab39af977aa50fa17d8d1facbd6a611612 | |
parent | abf28a95864f86f952b77bc25740f0dcc7a560bf (diff) | |
download | rockbox-bf34449638ddea6b88a5743b1d345e33e7052384.tar.gz rockbox-bf34449638ddea6b88a5743b1d345e33e7052384.zip |
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.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/philips/hdd6330/lcd-hdd6330.c | 53 |
2 files changed, 30 insertions, 25 deletions
diff --git a/firmware/export/config/gogearhdd6330.h b/firmware/export/config/gogearhdd6330.h index 786b9ad30a..c91e2a45d8 100644 --- a/firmware/export/config/gogearhdd6330.h +++ b/firmware/export/config/gogearhdd6330.h | |||
@@ -74,7 +74,7 @@ | |||
74 | /* #define HAVE_LCD_FLIP */ | 74 | /* #define HAVE_LCD_FLIP */ |
75 | 75 | ||
76 | /* define this if you can invert the colours on your LCD */ | 76 | /* define this if you can invert the colours on your LCD */ |
77 | /* #define HAVE_LCD_INVERT */ | 77 | #define HAVE_LCD_INVERT |
78 | 78 | ||
79 | /* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */ | 79 | /* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */ |
80 | 80 | ||
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 @@ | |||
24 | #include "kernel.h" | 24 | #include "kernel.h" |
25 | #include "system.h" | 25 | #include "system.h" |
26 | 26 | ||
27 | /* register defines for Philips LCD 220x176x16 - model: LPH9165-2 */ | ||
28 | #define LCD_REG_UNKNOWN_00 0x00 | ||
29 | #define LCD_REG_UNKNOWN_01 0x01 | ||
30 | #define LCD_REG_UNKNOWN_05 0x05 | ||
31 | #define LCD_REG_WRITE_DATA_2_GRAM 0x06 | ||
32 | #define LCD_REG_HORIZ_ADDR_START 0x08 | ||
33 | #define LCD_REG_HORIZ_ADDR_END 0x09 | ||
34 | #define LCD_REG_VERT_ADDR_START 0x0a | ||
35 | #define LCD_REG_VERT_ADDR_END 0x0b | ||
36 | |||
27 | /* Display status */ | 37 | /* Display status */ |
28 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; | 38 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; |
29 | 39 | ||
@@ -50,7 +60,12 @@ static void lcd_send_reg(unsigned reg) | |||
50 | 60 | ||
51 | void lcd_init_device(void) | 61 | void lcd_init_device(void) |
52 | { | 62 | { |
53 | /* init handled by the OF bootloader */ | 63 | lcd_send_reg(LCD_REG_UNKNOWN_00); |
64 | lcd_send_data(0x00); | ||
65 | lcd_send_reg(LCD_REG_UNKNOWN_01); | ||
66 | lcd_send_data(0x48); | ||
67 | lcd_send_reg(LCD_REG_UNKNOWN_05); | ||
68 | lcd_send_data(0x0f); | ||
54 | } | 69 | } |
55 | 70 | ||
56 | /*** hardware configuration ***/ | 71 | /*** hardware configuration ***/ |
@@ -66,7 +81,9 @@ void lcd_set_contrast(int val) | |||
66 | 81 | ||
67 | void lcd_set_invert_display(bool yesno) | 82 | void lcd_set_invert_display(bool yesno) |
68 | { | 83 | { |
69 | (void)yesno; | 84 | int invert = (yesno) ? 0x40 : 0x00; |
85 | lcd_send_reg(LCD_REG_UNKNOWN_00); | ||
86 | lcd_send_data(invert); | ||
70 | } | 87 | } |
71 | 88 | ||
72 | /* turn the display upside down (call lcd_update() afterwards) */ | 89 | /* turn the display upside down (call lcd_update() afterwards) */ |
@@ -107,25 +124,19 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
107 | 124 | ||
108 | width = (width + 1) & ~1; | 125 | width = (width + 1) & ~1; |
109 | 126 | ||
110 | lcd_send_reg(0x01); | 127 | lcd_send_reg(LCD_REG_HORIZ_ADDR_START); |
111 | lcd_send_data(0x48); | ||
112 | |||
113 | lcd_send_reg(0x05); | ||
114 | lcd_send_data(0x0f); | ||
115 | |||
116 | lcd_send_reg(0x08); | ||
117 | lcd_send_data(y); | 128 | lcd_send_data(y); |
118 | 129 | ||
119 | lcd_send_reg(0x09); | 130 | lcd_send_reg(LCD_REG_HORIZ_ADDR_END); |
120 | lcd_send_data(y + height - 1); | 131 | lcd_send_data(y + height - 1); |
121 | 132 | ||
122 | lcd_send_reg(0x0a); | 133 | lcd_send_reg(LCD_REG_VERT_ADDR_START); |
123 | lcd_send_data(x + 16); | 134 | lcd_send_data(x + 16); |
124 | 135 | ||
125 | lcd_send_reg(0x0b); | 136 | lcd_send_reg(LCD_REG_VERT_ADDR_END); |
126 | lcd_send_data(x + width - 1 + 16); | 137 | lcd_send_data(x + width - 1 + 16); |
127 | 138 | ||
128 | lcd_send_reg(0x06); | 139 | lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM); |
129 | 140 | ||
130 | const int stride_div_csub_x = stride/CSUB_X; | 141 | const int stride_div_csub_x = stride/CSUB_X; |
131 | 142 | ||
@@ -205,25 +216,19 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
205 | if ((width <= 0) || (height <= 0)) | 216 | if ((width <= 0) || (height <= 0)) |
206 | return; /* Nothing left to do. */ | 217 | return; /* Nothing left to do. */ |
207 | 218 | ||
208 | lcd_send_reg(0x01); | 219 | lcd_send_reg(LCD_REG_HORIZ_ADDR_START); |
209 | lcd_send_data(0x48); | ||
210 | |||
211 | lcd_send_reg(0x05); | ||
212 | lcd_send_data(0x0f); | ||
213 | |||
214 | lcd_send_reg(0x08); | ||
215 | lcd_send_data(y); | 220 | lcd_send_data(y); |
216 | 221 | ||
217 | lcd_send_reg(0x09); | 222 | lcd_send_reg(LCD_REG_HORIZ_ADDR_END); |
218 | lcd_send_data(y + height - 1); | 223 | lcd_send_data(y + height - 1); |
219 | 224 | ||
220 | lcd_send_reg(0x0a); | 225 | lcd_send_reg(LCD_REG_VERT_ADDR_START); |
221 | lcd_send_data(x + 16); | 226 | lcd_send_data(x + 16); |
222 | 227 | ||
223 | lcd_send_reg(0x0b); | 228 | lcd_send_reg(LCD_REG_VERT_ADDR_END); |
224 | lcd_send_data(x + width - 1 + 16); | 229 | lcd_send_data(x + width - 1 + 16); |
225 | 230 | ||
226 | lcd_send_reg(0x06); | 231 | lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM); |
227 | 232 | ||
228 | addr = (unsigned long*)&lcd_framebuffer[y][x]; | 233 | addr = (unsigned long*)&lcd_framebuffer[y][x]; |
229 | 234 | ||