Contrast settings for the gigabeat F/X

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17590 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Karl Kurbjun 2008-05-21 03:50:48 +00:00
parent 7a4d1609ee
commit 4c99f9a749
2 changed files with 21 additions and 5 deletions

View file

@ -113,6 +113,13 @@
#define HAVE_LCD_FLIP #define HAVE_LCD_FLIP
/* Define this if your LCD can set contrast */
#define HAVE_LCD_CONTRAST
#define MIN_CONTRAST_SETTING 0
#define MAX_CONTRAST_SETTING 63
#define DEFAULT_CONTRAST_SETTING 47 /* Match boot contrast */
/* LCD invert - does not currently work */ /* LCD invert - does not currently work */
/* #define HAVE_LCD_INVERT */ /* #define HAVE_LCD_INVERT */

View file

@ -310,6 +310,20 @@ void lcd_set_flip(bool yesno) {
LCD_SPI_stop(); LCD_SPI_stop();
} }
int lcd_default_contrast(void)
{
return DEFAULT_CONTRAST_SETTING;
}
void lcd_set_contrast(int val) {
if (!lcd_on)
return;
LCD_SPI_start();
LCD_SPI_setreg(0x0B, (unsigned char) val);
LCD_SPI_stop();
}
void lcd_set_invert_display(bool yesno) { void lcd_set_invert_display(bool yesno) {
if (!lcd_on) if (!lcd_on)
return; return;
@ -498,8 +512,3 @@ void lcd_blit_yuv(unsigned char * const src[3],
} }
} }
void lcd_set_contrast(int val) {
(void) val;
// TODO:
}