summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2009-08-01 17:27:22 +0000
committerBertrik Sikken <bertrik@sikken.nl>2009-08-01 17:27:22 +0000
commit4e7517dfb1946ad8e7cbc626db2252d04dee629b (patch)
tree1deaa077f678ddca85baf0b1661ae717b7efb201 /firmware
parent0f0bf7b25836fb78f5d4dc7c7085fb9f0e949d02 (diff)
downloadrockbox-4e7517dfb1946ad8e7cbc626db2252d04dee629b.tar.gz
rockbox-4e7517dfb1946ad8e7cbc626db2252d04dee629b.tar.bz2
rockbox-4e7517dfb1946ad8e7cbc626db2252d04dee629b.zip
Samsung YP-S3: implement button lights
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22100 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/config-yps3.h6
-rw-r--r--firmware/target/arm/s5l8700/yps3/backlight-yps3.c19
2 files changed, 25 insertions, 0 deletions
diff --git a/firmware/export/config-yps3.h b/firmware/export/config-yps3.h
index 2685f0228a..a1485eadad 100644
--- a/firmware/export/config-yps3.h
+++ b/firmware/export/config-yps3.h
@@ -72,8 +72,14 @@
should be defined as well. */
//#define HAVE_LCD_SLEEP
+/* We have button lights */
+#define HAVE_BUTTON_LIGHT
+
#define CONFIG_KEYPAD MEIZU_M3_PAD
+/* We have headphone detection */
+#define HAVE_HEADPHONE_DETECTION
+
//#define AB_REPEAT_ENABLE 1
//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
diff --git a/firmware/target/arm/s5l8700/yps3/backlight-yps3.c b/firmware/target/arm/s5l8700/yps3/backlight-yps3.c
index 0a9cf3cc9a..7fda82a29c 100644
--- a/firmware/target/arm/s5l8700/yps3/backlight-yps3.c
+++ b/firmware/target/arm/s5l8700/yps3/backlight-yps3.c
@@ -30,6 +30,9 @@
The PWM duty cycle depends exponentially on the configured brightness
level. This makes the brightness curve more linear to the human eye.
+
+ The button LEDs are all activated at the same time (even though there
+ are three individually controllable groups: menu/back, cursor, middle).
*/
void _backlight_set_brightness(int brightness)
@@ -52,8 +55,24 @@ void _backlight_off(void)
_backlight_set_brightness(MIN_BRIGHTNESS_SETTING);
}
+void _buttonlight_on(void)
+{
+ PDAT3 |= (3 << 2);
+ PDAT4 |= (1 << 2);
+}
+
+void _buttonlight_off(void)
+{
+ PDAT3 &= ~(3 << 2);
+ PDAT4 &= ~(1 << 2);
+}
+
bool _backlight_init(void)
{
+ /* Enable button LEDs: P3.2 (menu/back), P3.3 (cursor), P4.2 (middle) */
+ PCON3 = (PCON3 & ~0x0000FF00) | 0x00001100;
+ PCON4 = (PCON4 & ~0x00000F00) | 0x00000100;
+
/* enable backlight pin as timer output */
PCON0 = ((PCON0 & ~(3 << 0)) | (2 << 0));