summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
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:
-}
-