summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-09-02 19:57:29 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-09-02 19:57:29 +0000
commit5b7a150807f7a709c335d3cc25d1f0cfc678cb46 (patch)
tree1a4404d2601f829d29f926ba5e486a4eee893645 /firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
parent194bc59478751a951bd23eb55bf9cae467211be4 (diff)
downloadrockbox-5b7a150807f7a709c335d3cc25d1f0cfc678cb46.tar.gz
rockbox-5b7a150807f7a709c335d3cc25d1f0cfc678cb46.tar.bz2
rockbox-5b7a150807f7a709c335d3cc25d1f0cfc678cb46.zip
sansa clipzip: add lcd_brightness function (to be used later to set the 'backlight' brightness)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30410 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c')
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
index 49241c10d2..c3f81fb989 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
@@ -22,6 +22,7 @@
#include "config.h"
#include "lcd.h"
+#include "lcd-target.h"
#include "system.h"
#include "cpu.h"
@@ -154,7 +155,7 @@ static void lcd_init_type0(void)
/* writes a table entry (for type 1 LCDs) */
static void lcd_write_table(uint8_t val)
{
- lcd_write_dat((val >> 4) & 0x07);
+ lcd_write_dat((val >> 4) & 0x0F);
lcd_write_dat((val >> 0) & 0x0F);
}
@@ -354,6 +355,22 @@ static void lcd_setup_rect(int x, int x_end, int y, int y_end)
}
}
+/* sets the brightness of the OLED */
+void lcd_brightness(uint8_t red, uint8_t green, uint8_t blue)
+{
+ if (lcd_type == 0) {
+ lcd_write(0x40, red);
+ lcd_write(0x41, green);
+ lcd_write(0x42, blue);
+ }
+ else {
+ lcd_write_cmd(0x0E);
+ lcd_write_table(red);
+ lcd_write_table(green);
+ lcd_write_table(blue);
+ }
+}
+
/* Updates a fraction of the display. */
void lcd_update_rect(int x, int y, int width, int height)
{