forked from len0rd/rockbox
hm60x: Implement lcd_update_rect for v2 display.
Change-Id: I9d6b14bcbd26cfd760516f1ef3bf421698507806
This commit is contained in:
parent
fce81a8a74
commit
83554cce8d
1 changed files with 19 additions and 12 deletions
|
|
@ -252,9 +252,6 @@ static void lcd_v2_display_init(void)
|
||||||
|
|
||||||
lcd_write_reg(0x07, 0x1017);
|
lcd_write_reg(0x07, 0x1017);
|
||||||
|
|
||||||
lcd_write_reg(0x20, 0x00AF);
|
|
||||||
lcd_write_reg(0x21, 0x0000);
|
|
||||||
|
|
||||||
lcd_cmd(0x22);
|
lcd_cmd(0x22);
|
||||||
|
|
||||||
for (x=0; x<LCD_WIDTH; x++)
|
for (x=0; x<LCD_WIDTH; x++)
|
||||||
|
|
@ -271,23 +268,33 @@ static void lcd_v2_enable (bool on)
|
||||||
|
|
||||||
static void lcd_v2_set_gram_area(int x, int y, int width, int height)
|
static void lcd_v2_set_gram_area(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
(void) x;
|
|
||||||
(void) y;
|
|
||||||
(void) width;
|
|
||||||
(void) height;
|
|
||||||
lcdctrl_bypass(1);
|
lcdctrl_bypass(1);
|
||||||
LCDC_CTRL |= RGB24B;
|
LCDC_CTRL |= RGB24B;
|
||||||
|
|
||||||
|
lcd_write_reg(0x36, height-1);
|
||||||
|
lcd_write_reg(0x37, y);
|
||||||
|
lcd_write_reg(0x38, width-1);
|
||||||
|
lcd_write_reg(0x39, x);
|
||||||
|
|
||||||
|
/* set GRAM address */
|
||||||
|
lcd_write_reg(0x20, y);
|
||||||
|
lcd_write_reg(0x21, x);
|
||||||
|
|
||||||
lcd_cmd(0x22);
|
lcd_cmd(0x22);
|
||||||
LCDC_CTRL &= ~RGB24B;
|
LCDC_CTRL &= ~RGB24B;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lcd_v2_update_rect(int x, int y, int width, int height)
|
static void lcd_v2_update_rect(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
(void) x;
|
int px = x, py = y;
|
||||||
(void) y;
|
int pxmax = x + width, pymax = y + height;
|
||||||
(void) width;
|
|
||||||
(void) height;
|
lcd_v2_set_gram_area(x, y, pxmax, pymax);
|
||||||
lcd_update();
|
|
||||||
|
for (py=y; py<pymax; py++)
|
||||||
|
for (px=x; px<pxmax; px++)
|
||||||
|
LCD_DATA = (*FBADDR(px, py));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_display_init(void)
|
void lcd_display_init(void)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue