1
0
Fork 0
forked from len0rd/rockbox

H10 LCD driver size reductions: Un-inline a function for H10 20GB, and introduce lcd_write_reg() for H10 5/6GB.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15090 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-10-12 17:09:33 +00:00
parent abd8c39a4d
commit d160c10e37
2 changed files with 16 additions and 16 deletions

View file

@ -101,9 +101,8 @@ static inline void lcd_send_data_swapped(unsigned v)
LCD2_PORT = LCD2_DATA_MASK | (v >> 8);
}
/* Write value to register */
static inline void lcd_write_reg(int reg, int val)
static void lcd_write_reg(int reg, int val)
{
lcd_send_cmd(reg);
lcd_send_data(val);

View file

@ -74,6 +74,13 @@ static inline void lcd_send_data(unsigned v)
LCD2_PORT = LCD2_DATA_MASK | (v & 0xff);
}
/* Write value to register */
static void lcd_write_reg(int reg, int val)
{
lcd_send_cmd(reg);
lcd_send_data(val);
}
/*** hardware configuration ***/
@ -150,16 +157,13 @@ void lcd_yuv_blit(unsigned char * const src[3],
y1 = y + height - 1;
/* max horiz << 8 | start horiz */
lcd_send_cmd(R_HORIZ_RAM_ADDR_POS);
lcd_send_data((x1 << 8) | x0);
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (x1 << 8) | x0);
/* max vert << 8 | start vert */
lcd_send_cmd(R_VERT_RAM_ADDR_POS);
lcd_send_data((y1 << 8) | y0);
lcd_write_reg(R_VERT_RAM_ADDR_POS, (y1 << 8) | y0);
/* start vert << 8 | start horiz */
lcd_send_cmd(R_RAM_ADDR_SET);
lcd_send_data((y0 << 8) | x0);
lcd_write_reg(R_RAM_ADDR_SET, (y0 << 8) | x0);
/* start drawing */
lcd_send_cmd(R_WRITE_DATA_2_GRAM);
@ -320,16 +324,13 @@ void lcd_update_rect(int x0, int y0, int width, int height)
}
/* max horiz << 8 | start horiz */
lcd_send_cmd(R_HORIZ_RAM_ADDR_POS);
lcd_send_data((x1 << 8) | x0);
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (x1 << 8) | x0);
/* max vert << 8 | start vert */
lcd_send_cmd(R_VERT_RAM_ADDR_POS);
lcd_send_data((y1 << 8) | y0);
lcd_write_reg(R_VERT_RAM_ADDR_POS, (y1 << 8) | y0);
/* start vert << 8 | start horiz */
lcd_send_cmd(R_RAM_ADDR_SET);
lcd_send_data((y0 << 8) | x0);
lcd_write_reg(R_RAM_ADDR_SET, (y0 << 8) | x0);
/* start drawing */
lcd_send_cmd(R_WRITE_DATA_2_GRAM);