Fix red
[kugel-rb.git] / firmware / target / arm / ipod / backlight-target.h
blobceef726b4142134939f7e032326dcd3835bad0f3
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 by Barry Wardell
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef BACKLIGHT_TARGET_H
22 #define BACKLIGHT_TARGET_H
24 #if defined(IPOD_VIDEO) || defined(IPOD_NANO)
26 bool _backlight_init(void);
27 void _backlight_set_brightness(int val);
28 void _backlight_led_on(void);
29 void _backlight_led_off(void);
30 void _backlight_hw_enable(bool on);
32 #ifdef BOOTLOADER
33 #define _backlight_on() do { _backlight_hw_enable(true); \
34 _backlight_led_on(); } while(0)
35 #define _backlight_off() do { _backlight_led_off(); \
36 _backlight_hw_enable(false); } while(0)
37 #else /* !BOOTLOADER */
38 #define _backlight_on_isr() _backlight_led_on()
39 #define _backlight_off_isr() _backlight_led_off()
40 #define _backlight_on_normal() do { _backlight_hw_enable(true); \
41 _backlight_led_on(); } while(0)
42 #define _backlight_off_normal() do { _backlight_led_off(); \
43 _backlight_hw_enable(false); } while(0)
44 #define _BACKLIGHT_FADE_ENABLE
45 #endif /* !BOOTLOADER */
47 #elif defined(IPOD_4G) || defined(IPOD_COLOR)
49 bool _backlight_init(void);
50 void _backlight_on(void);
51 void _backlight_off(void);
53 /* Mini G1, G2, Video, Nano */
54 #elif (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM) || defined(BOOTLOADER)
56 #define _backlight_init() true
57 void _backlight_hw_on(void);
58 void _backlight_hw_off(void);
60 #ifdef BOOTLOADER
61 #define _backlight_on() _backlight_hw_on()
62 #define _backlight_off() _backlight_hw_off()
63 #else
64 #define _backlight_on_isr() _backlight_hw_on()
65 #define _backlight_off_isr() _backlight_hw_off()
66 #define _backlight_on_normal() _backlight_hw_on()
67 #define _backlight_off_normal() _backlight_hw_off()
68 #endif
70 #else /* G1, G2, G3 */
72 #define _backlight_init() true
73 void _backlight_on(void);
74 void _backlight_off(void);
75 #endif
77 #endif