From 4c99f9a74964c4a44ca27a216f302bdc79b23121 Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Wed, 21 May 2008 03:50:48 +0000 Subject: [PATCH] Contrast settings for the gigabeat F/X git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17590 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-gigabeat.h | 7 +++++++ .../arm/s3c2440/gigabeat-fx/lcd-meg-fx.c | 19 ++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h index a3c737187b..03cedd0049 100644 --- a/firmware/export/config-gigabeat.h +++ b/firmware/export/config-gigabeat.h @@ -113,6 +113,13 @@ #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 */ /* #define HAVE_LCD_INVERT */ diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c index 5ace2a61f6..7484cae94e 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c @@ -310,6 +310,20 @@ void lcd_set_flip(bool yesno) { 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) { if (!lcd_on) return; @@ -498,8 +512,3 @@ void lcd_blit_yuv(unsigned char * const src[3], } } -void lcd_set_contrast(int val) { - (void) val; - // TODO: -} -