Submit FS#9890 by Boris Gjenero. Enabling option for iPod Video to shut down LCD...
[kugel-rb.git] / firmware / target / arm / ipod / backlight-target.h
blob28c519e4c04e49443c3fe1f179ea70fa64b4d571
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 HAVE_LCD_SLEEP
33 void lcd_awake(void);
34 #endif
36 #ifdef BOOTLOADER
37 #define _backlight_on() do { _backlight_hw_enable(true); \
38 _backlight_led_on(); } while(0)
39 #define _backlight_off() do { _backlight_led_off(); \
40 _backlight_hw_enable(false); } while(0)
41 #else /* !BOOTLOADER */
42 #define _backlight_on_isr() _backlight_led_on()
43 #define _backlight_off_isr() _backlight_led_off()
44 #define _backlight_on_normal() do { _backlight_hw_enable(true); \
45 _backlight_led_on(); } while(0)
46 #define _backlight_off_normal() do { _backlight_led_off(); \
47 _backlight_hw_enable(false); } while(0)
48 #define _BACKLIGHT_FADE_ENABLE
49 #endif /* !BOOTLOADER */
51 #elif defined(IPOD_4G) || defined(IPOD_COLOR)
53 bool _backlight_init(void);
54 void _backlight_on(void);
55 void _backlight_off(void);
57 #elif defined(IPOD_MINI) || defined(IPOD_MINI2G)
59 #define _backlight_init() true
60 void _backlight_hw_on(void);
61 void _backlight_hw_off(void);
63 #ifdef BOOTLOADER
64 #define _backlight_on() _backlight_hw_on()
65 #define _backlight_off() _backlight_hw_off()
66 #else
67 #define _backlight_on_isr() _backlight_hw_on()
68 #define _backlight_off_isr() _backlight_hw_off()
69 #define _backlight_on_normal() _backlight_hw_on()
70 #define _backlight_off_normal() _backlight_hw_off()
71 #endif
73 #elif defined(IPOD_1G2G) || defined(IPOD_3G)
75 #define _backlight_init() true
76 void _backlight_on(void);
77 void _backlight_off(void);
78 #endif
80 #endif