summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2007-02-03 13:39:20 +0000
committerBarry Wardell <rockbox@barrywardell.net>2007-02-03 13:39:20 +0000
commita7af649766ff3a673783ac375a264ab69fbbe104 (patch)
tree50c8f5430557424af3c53398e84ce30c76d28617 /firmware
parent1a2dddc346e60211210c8f3b0b378be54108f652 (diff)
downloadrockbox-a7af649766ff3a673783ac375a264ab69fbbe104.tar.gz
rockbox-a7af649766ff3a673783ac375a264ab69fbbe104.tar.bz2
rockbox-a7af649766ff3a673783ac375a264ab69fbbe104.zip
Backlight support for Sansa, including brightness. Thanks to Rene
Peinthor and FS#6608. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12186 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/config-e200.h6
-rw-r--r--firmware/target/arm/sandisk/sansa-e200/backlight-e200.c16
-rw-r--r--firmware/target/arm/sandisk/sansa-e200/backlight-target.h1
3 files changed, 23 insertions, 0 deletions
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h
index 4eb4840709..d1a060202b 100644
--- a/firmware/export/config-e200.h
+++ b/firmware/export/config-e200.h
@@ -16,6 +16,12 @@
/* define this if you have a colour LCD */
#define HAVE_LCD_COLOR 1
+#define HAVE_BACKLIGHT_BRIGHTNESS
+/* Main LCD backlight brightness range and defaults */
+#define MIN_BRIGHTNESS_SETTING 1
+#define MAX_BRIGHTNESS_SETTING 12
+#define DEFAULT_BRIGHTNESS_SETTING 6
+
/* define this if you have access to the quickscreen */
#define HAVE_QUICKSCREEN
diff --git a/firmware/target/arm/sandisk/sansa-e200/backlight-e200.c b/firmware/target/arm/sandisk/sansa-e200/backlight-e200.c
index 492942361a..787f14b1a6 100644
--- a/firmware/target/arm/sandisk/sansa-e200/backlight-e200.c
+++ b/firmware/target/arm/sandisk/sansa-e200/backlight-e200.c
@@ -16,10 +16,26 @@
* KIND, either express or implied.
*
****************************************************************************/
+#include "config.h"
+#include "backlight-target.h"
+#include "system.h"
+#include "backlight.h"
+#include "i2c-pp.h"
+
+static unsigned short backlight_brightness;
+
+void __backlight_set_brightness(int brightness)
+{
+ backlight_brightness = brightness;
+ pp_i2c_send( 0x46, 0x23, backlight_brightness);
+}
+
void __backlight_on(void)
{
+ pp_i2c_send( 0x46, 0x23, backlight_brightness);
}
void __backlight_off(void)
{
+ pp_i2c_send( 0x46, 0x23, 0x0);
}
diff --git a/firmware/target/arm/sandisk/sansa-e200/backlight-target.h b/firmware/target/arm/sandisk/sansa-e200/backlight-target.h
index d35dccdc4a..5b96ae5e7e 100644
--- a/firmware/target/arm/sandisk/sansa-e200/backlight-target.h
+++ b/firmware/target/arm/sandisk/sansa-e200/backlight-target.h
@@ -21,5 +21,6 @@
void __backlight_on(void);
void __backlight_off(void);
+void __backlight_set_brightness(int brightness);
#endif