summaryrefslogtreecommitdiff
path: root/firmware/target/arm/sandisk/backlight-c200_e200.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/sandisk/backlight-c200_e200.c')
-rw-r--r--firmware/target/arm/sandisk/backlight-c200_e200.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/firmware/target/arm/sandisk/backlight-c200_e200.c b/firmware/target/arm/sandisk/backlight-c200_e200.c
new file mode 100644
index 0000000000..29c6ab4b45
--- /dev/null
+++ b/firmware/target/arm/sandisk/backlight-c200_e200.c
@@ -0,0 +1,58 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Barry Wardell
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#include "backlight-target.h"
20#include "system.h"
21#include "lcd.h"
22#include "backlight.h"
23#include "i2c-pp.h"
24
25static unsigned short backlight_brightness = DEFAULT_BRIGHTNESS_SETTING;
26
27void __backlight_set_brightness(int brightness)
28{
29 backlight_brightness = brightness;
30
31 if (brightness > 0)
32 __backlight_on();
33 else
34 __backlight_off();
35}
36
37void __backlight_on(void)
38{
39 lcd_enable(true); /* power on lcd */
40 pp_i2c_send( 0x46, 0x23, backlight_brightness);
41}
42
43void __backlight_off(void)
44{
45 pp_i2c_send( 0x46, 0x23, 0x0);
46 lcd_enable(false); /* power off lcd */
47}
48
49
50void __button_backlight_on(void)
51{
52 GPIOG_OUTPUT_VAL |=0x80;
53}
54
55void __button_backlight_off(void)
56{
57 GPIOG_OUTPUT_VAL &=~ 0x80;
58}