forked from len0rd/rockbox
Make some functions static, point to the wiki, and comit the code to invert the screen, but don't enable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17589 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
29c45a66ce
commit
7a4d1609ee
2 changed files with 31 additions and 25 deletions
|
@ -113,6 +113,9 @@
|
|||
|
||||
#define HAVE_LCD_FLIP
|
||||
|
||||
/* LCD invert - does not currently work */
|
||||
/* #define HAVE_LCD_INVERT */
|
||||
|
||||
/* Define this if you have a Motorola SCF5249 */
|
||||
#define CONFIG_CPU S3C2440
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ inline void delay_cycles(volatile int delay)
|
|||
while(delay>0) delay--;
|
||||
}
|
||||
|
||||
void LCD_CTRL_setup(void)
|
||||
static void LCD_CTRL_setup(void)
|
||||
{
|
||||
/* ENVID = 0, BPPMODE = 16 bpp, PNRMODE = TFT, MMODE = Each Frame, CLKVAL = 8 */
|
||||
LCDCON1 = 0x878;
|
||||
|
@ -88,7 +88,7 @@ void LCD_CTRL_setup(void)
|
|||
LCDSADDR3 = 0x000000F0;
|
||||
}
|
||||
|
||||
void LCD_CTRL_clock(bool onoff)
|
||||
static void LCD_CTRL_clock(bool onoff)
|
||||
{
|
||||
if(onoff)
|
||||
{
|
||||
|
@ -117,7 +117,7 @@ void LCD_CTRL_clock(bool onoff)
|
|||
}
|
||||
}
|
||||
|
||||
void reset_LCD(bool reset)
|
||||
static void reset_LCD(bool reset)
|
||||
{
|
||||
GPBCON&=~0xC000;
|
||||
GPBCON|=0x4000;
|
||||
|
@ -127,7 +127,7 @@ void reset_LCD(bool reset)
|
|||
GPBDAT&=~0x80;
|
||||
}
|
||||
|
||||
void LCD_SPI_send(const unsigned char *array, int count)
|
||||
static void LCD_SPI_send(const unsigned char *array, int count)
|
||||
{
|
||||
while (count--)
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ void LCD_SPI_setreg(unsigned char reg, unsigned char value)
|
|||
LCD_SPI_send(regval, sizeof(regval));
|
||||
}
|
||||
|
||||
void LCD_SPI_SS(bool select)
|
||||
static void LCD_SPI_SS(bool select)
|
||||
{
|
||||
delay_cycles(0x4FFF);
|
||||
|
||||
|
@ -177,7 +177,7 @@ void LCD_SPI_stop(void)
|
|||
s3c_regclr(&CLKCON, 0x40000); /* disable SPI clock */
|
||||
}
|
||||
|
||||
void LCD_SPI_powerdown(void)
|
||||
static void LCD_SPI_powerdown(void)
|
||||
{
|
||||
lcd_powered = false;
|
||||
|
||||
|
@ -189,7 +189,7 @@ void LCD_SPI_powerdown(void)
|
|||
LCD_CTRL_clock(false);
|
||||
}
|
||||
|
||||
void LCD_SPI_powerup(void)
|
||||
static void LCD_SPI_powerup(void)
|
||||
{
|
||||
LCD_CTRL_clock(true);
|
||||
|
||||
|
@ -200,13 +200,12 @@ void LCD_SPI_powerup(void)
|
|||
lcd_powered = true;
|
||||
}
|
||||
|
||||
void LCD_SPI_init(void)
|
||||
static void LCD_SPI_init(void)
|
||||
{
|
||||
/* SPI data - Right now we are not sure what each of these SPI writes is
|
||||
* actually telling the lcd. Many thanks to Alex Gerchanovsky for
|
||||
* discovering them.
|
||||
*
|
||||
* Addr 0x04 is used more than once is an enable.
|
||||
/*
|
||||
* SPI setup - Some of these registers are known; they are documented in
|
||||
* the wiki. Many thanks to Alex Gerchanovsky for discovering this
|
||||
* sequence.
|
||||
*/
|
||||
|
||||
LCD_CTRL_clock(true);
|
||||
|
@ -299,13 +298,6 @@ void lcd_set_flip(bool yesno) {
|
|||
if (!lcd_on)
|
||||
return;
|
||||
|
||||
/* Register 0x06 sets the screen orientation:
|
||||
*
|
||||
* Known Values:
|
||||
* 0x04: Right side up portrait
|
||||
* 0x02: Upside down protrait
|
||||
*/
|
||||
|
||||
LCD_SPI_start();
|
||||
if(yesno)
|
||||
{
|
||||
|
@ -318,6 +310,22 @@ void lcd_set_flip(bool yesno) {
|
|||
LCD_SPI_stop();
|
||||
}
|
||||
|
||||
void lcd_set_invert_display(bool yesno) {
|
||||
if (!lcd_on)
|
||||
return;
|
||||
|
||||
LCD_SPI_start();
|
||||
if(yesno)
|
||||
{
|
||||
LCD_SPI_setreg(0x27, 0x10);
|
||||
}
|
||||
else
|
||||
{
|
||||
LCD_SPI_setreg(0x27, 0x00);
|
||||
}
|
||||
LCD_SPI_stop();
|
||||
}
|
||||
|
||||
/* Update a fraction of the display. */
|
||||
void lcd_update_rect(int x, int y, int width, int height)
|
||||
{
|
||||
|
@ -495,8 +503,3 @@ void lcd_set_contrast(int val) {
|
|||
// TODO:
|
||||
}
|
||||
|
||||
void lcd_set_invert_display(bool yesno) {
|
||||
(void) yesno;
|
||||
// TODO:
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue