as3525*: make sure fclk is 24MHz before using it as the clock source for pclk
[kugel-rb.git] / firmware / export / backlight.h
blob3b33e1a01922bab959bf2ae925f119b20aaed602
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Daniel Stenberg
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_H
22 #define BACKLIGHT_H
24 #include "config.h"
28 #if !defined(BOOTLOADER)
29 /* The whole driver should be built */
30 #define BACKLIGHT_FULL_INIT
31 #endif
33 bool is_backlight_on(bool ignore_always_off);
34 void backlight_on(void);
35 void backlight_off(void);
36 void backlight_set_timeout(int value);
38 #ifdef HAVE_BACKLIGHT
39 void backlight_init(void) INIT_ATTR;
40 void backlight_close(void);
42 int backlight_get_current_timeout(void);
44 #if defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
45 void backlight_set_fade_in(int value);
46 void backlight_set_fade_out(int value);
47 #elif defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING)
48 void backlight_set_fade_in(bool value);
49 void backlight_set_fade_out(bool value);
50 #endif
52 void backlight_set_timeout_plugged(int value);
54 #ifdef HAS_BUTTON_HOLD
55 void backlight_hold_changed(bool hold_button);
56 void backlight_set_on_button_hold(int index);
57 #endif
59 #if defined(HAVE_LCD_SLEEP) && defined(HAVE_LCD_SLEEP_SETTING)
60 void lcd_set_sleep_after_backlight_off(int index);
61 #endif
63 #else /* !HAVE_BACKLIGHT */
64 #define backlight_init()
65 #endif /* !HAVE_BACKLIGHT */
67 #ifdef HAVE_REMOTE_LCD
68 void remote_backlight_on(void);
69 void remote_backlight_off(void);
70 void remote_backlight_set_timeout(int value);
71 void remote_backlight_set_timeout_plugged(int value);
72 bool is_remote_backlight_on(bool ignore_always_off);
73 int remote_backlight_get_current_timeout(void);
75 #ifdef HAS_REMOTE_BUTTON_HOLD
76 void remote_backlight_hold_changed(bool rc_hold_button);
77 void remote_backlight_set_on_button_hold(int index);
78 #endif
79 #endif /* HAVE_REMOTE_LCD */
81 #ifdef SIMULATOR
82 void sim_backlight(int value);
83 void sim_remote_backlight(int value);
84 #endif
86 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
87 #ifdef BACKLIGHT_FULL_INIT
88 extern int backlight_brightness;
89 #else
90 #define backlight_brightness DEFAULT_BRIGHTNESS_SETTING
91 #endif
92 void backlight_set_brightness(int val);
93 #endif /* HAVE_BACKLIGHT_BRIGHTNESS */
95 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
96 void buttonlight_set_brightness(int val);
97 #endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */
99 #ifdef HAVE_BUTTON_LIGHT
100 void buttonlight_on(void);
101 void buttonlight_off(void);
102 void buttonlight_set_timeout(int value);
103 #endif
105 /* Private API for use in target tree backlight code only */
106 #ifdef HAVE_BUTTON_LIGHT
107 int buttonlight_get_current_timeout(void);
108 #endif
110 #endif /* BACKLIGHT_H */