summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-10-23 14:20:47 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-10-23 14:20:47 +0000
commit94c573f3eca59347cd397d6b68159997bb674246 (patch)
tree8baf49fd0e7571f84be4f3ce258473d2008efc22 /firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
parentbf831106f5edaa383f441cacabb1c8fe081c851f (diff)
downloadrockbox-94c573f3eca59347cd397d6b68159997bb674246.tar.gz
rockbox-94c573f3eca59347cd397d6b68159997bb674246.tar.bz2
rockbox-94c573f3eca59347cd397d6b68159997bb674246.zip
Sansa clipzip: miscellaneous updates
* add support for OF version 01.01.17 in mkamsboot * introduce and implement oled_brightness function * configure voltage CVDD2 to 2.8V (like the OF does) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30831 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.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
index bfee2d253e..899eb538ea 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
@@ -336,18 +336,28 @@ 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)
+void oled_brightness(int brightness)
{
+ int r, g, b;
+
if (lcd_type == 0) {
- lcd_write(0x40, red); /* COLUMN_CURRENT_R */
- lcd_write(0x41, green); /* COLUMN_CURRENT_G */
- lcd_write(0x42, blue); /* COLUMN_CURRENT_B */
+ r = 2 + 16*brightness;
+ g = 1 + 10*brightness;
+ b = 1 + (23*brightness)/2;
+
+ lcd_write(0x40, r); /* COLUMN_CURRENT_R */
+ lcd_write(0x41, g); /* COLUMN_CURRENT_G */
+ lcd_write(0x42, b); /* COLUMN_CURRENT_B */
}
else {
+ r = 6 + 10*brightness;
+ g = 1 + 6*brightness;
+ b = 3 + 10*brightness;
+
lcd_write_cmd(0x0E);
- lcd_write_nibbles(red);
- lcd_write_nibbles(green);
- lcd_write_nibbles(blue);
+ lcd_write_nibbles(r);
+ lcd_write_nibbles(g);
+ lcd_write_nibbles(b);
}
}