summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2008-05-21 03:50:48 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2008-05-21 03:50:48 +0000
commit4c99f9a74964c4a44ca27a216f302bdc79b23121 (patch)
tree46fa958655a835c51f788b7afa04c2f25b68f9ab /firmware
parent7a4d1609ee12a928d25a1ee58c0cee448853ff82 (diff)
Contrast settings for the gigabeat F/X
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17590 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/config-gigabeat.h7
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c19
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:
-}
-