summaryrefslogtreecommitdiff
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
parent194bc59478751a951bd23eb55bf9cae467211be4 (diff)
downloadrockbox-5b7a150807f7a709c335d3cc25d1f0cfc678cb46.tar.gz
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
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c19
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/lcd-target.h27
2 files changed, 45 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 @@
22#include "config.h" 22#include "config.h"
23 23
24#include "lcd.h" 24#include "lcd.h"
25#include "lcd-target.h"
25#include "system.h" 26#include "system.h"
26#include "cpu.h" 27#include "cpu.h"
27 28
@@ -154,7 +155,7 @@ static void lcd_init_type0(void)
154/* writes a table entry (for type 1 LCDs) */ 155/* writes a table entry (for type 1 LCDs) */
155static void lcd_write_table(uint8_t val) 156static void lcd_write_table(uint8_t val)
156{ 157{
157 lcd_write_dat((val >> 4) & 0x07); 158 lcd_write_dat((val >> 4) & 0x0F);
158 lcd_write_dat((val >> 0) & 0x0F); 159 lcd_write_dat((val >> 0) & 0x0F);
159} 160}
160 161
@@ -354,6 +355,22 @@ static void lcd_setup_rect(int x, int x_end, int y, int y_end)
354 } 355 }
355} 356}
356 357
358/* sets the brightness of the OLED */
359void lcd_brightness(uint8_t red, uint8_t green, uint8_t blue)
360{
361 if (lcd_type == 0) {
362 lcd_write(0x40, red);
363 lcd_write(0x41, green);
364 lcd_write(0x42, blue);
365 }
366 else {
367 lcd_write_cmd(0x0E);
368 lcd_write_table(red);
369 lcd_write_table(green);
370 lcd_write_table(blue);
371 }
372}
373
357/* Updates a fraction of the display. */ 374/* Updates a fraction of the display. */
358void lcd_update_rect(int x, int y, int width, int height) 375void lcd_update_rect(int x, int y, int width, int height)
359{ 376{
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-target.h b/firmware/target/arm/as3525/sansa-clipzip/lcd-target.h
new file mode 100644
index 0000000000..137e9731dd
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-target.h
@@ -0,0 +1,27 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2011 Bertrik Sikken
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdint.h>
23#include "config.h"
24
25/* target-specific OLED brightness function */
26void lcd_brightness(uint8_t red, uint8_t green, uint8_t blue);
27