diff options
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c')
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c | 19 |
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) { |