diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2008-10-31 22:02:41 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2008-10-31 22:02:41 +0000 |
commit | 603a9c7c7ded195de7af15a35d10f5961f2e88f1 (patch) | |
tree | ff215c32de10e82172bf953ae7e043ddc5d353bb /firmware/target/arm/as3525/sansa-clip/backlight-clip.c | |
parent | ee593c95e22b0361431f97dcc8a91c0264a5485a (diff) | |
download | rockbox-603a9c7c7ded195de7af15a35d10f5961f2e88f1.tar.gz rockbox-603a9c7c7ded195de7af15a35d10f5961f2e88f1.zip |
Clip: add backlight and buttonlight code
Revive lcd_enable() as well, and use it in _backlight_on/off()
Don't update the lcd framebuffer if the display is off
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18952 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clip/backlight-clip.c')
-rw-r--r-- | firmware/target/arm/as3525/sansa-clip/backlight-clip.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/sansa-clip/backlight-clip.c b/firmware/target/arm/as3525/sansa-clip/backlight-clip.c new file mode 100644 index 0000000000..2064f0992f --- /dev/null +++ b/firmware/target/arm/as3525/sansa-clip/backlight-clip.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright © 2008 Rafaël Carré | ||
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 "backlight-target.h" | ||
23 | #include "as3525.h" | ||
24 | |||
25 | /* TODO : backlight brightness */ | ||
26 | |||
27 | /* XXX : xpd is used for SD/MCI interface | ||
28 | * If interrupts are used to access this interface, they should be | ||
29 | * disabled in _buttonlight_on/off () | ||
30 | */ | ||
31 | |||
32 | void _buttonlight_on(void) | ||
33 | { | ||
34 | int saved_ccu_io; | ||
35 | |||
36 | saved_ccu_io = CCU_IO; /* save XPD setting */ | ||
37 | |||
38 | CCU_IO &= ~(3<<2); /* setup xpd as GPIO */ | ||
39 | |||
40 | GPIOD_DIR |= (1<<7); | ||
41 | GPIOD_PIN(7) = (1<<7); /* set pin d7 high */ | ||
42 | |||
43 | CCU_IO = saved_ccu_io; /* restore the previous XPD setting */ | ||
44 | } | ||
45 | |||
46 | void _buttonlight_off(void) | ||
47 | { | ||
48 | int saved_ccu_io; | ||
49 | |||
50 | saved_ccu_io = CCU_IO; /* save XPD setting */ | ||
51 | |||
52 | CCU_IO &= ~(3<<2); /* setup xpd as GPIO */ | ||
53 | |||
54 | GPIOD_DIR |= (1<<7); | ||
55 | GPIOD_PIN(7) = 0; /* set pin d7 low */ | ||
56 | |||
57 | CCU_IO = saved_ccu_io; /* restore the previous XPD setting */ | ||
58 | } | ||