diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2012-01-07 19:07:36 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2012-01-07 19:07:36 +0000 |
commit | 50f96943bef6996f354aa01a0f5265cbe14764b6 (patch) | |
tree | 03fe117e4dce71dce2e9f4b0b79c602502125726 | |
parent | 666f2e61f0737062b0ce14618f5b7c704273a236 (diff) | |
download | rockbox-50f96943bef6996f354aa01a0f5265cbe14764b6.tar.gz rockbox-50f96943bef6996f354aa01a0f5265cbe14764b6.zip |
remote_detect(): move to lcd-remote.h
Reorganize lcd-remote.h so it works for iaudio-m3 too
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31605 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/export/lcd-remote.h | 110 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h | 2 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/lcd-remote-target.h | 1 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m3/button-m3.c | 2 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/button-m5.c | 2 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/x5/button-x5.c | 2 | ||||
-rw-r--r-- | firmware/target/coldfire/iriver/lcd-remote-target.h | 2 |
8 files changed, 61 insertions, 62 deletions
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index f2fbbc62f3..41042e04d0 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "config.h" | 27 | #include "config.h" |
28 | #include "lcd.h" | 28 | #include "lcd.h" |
29 | 29 | ||
30 | #ifdef HAVE_REMOTE_LCD | 30 | #ifdef HAVE_REMOTE_LCD /* Not for the players with *only* a remote LCD (m3) */ |
31 | 31 | ||
32 | #ifndef __PCTOOL__ | 32 | #ifndef __PCTOOL__ |
33 | #include "lcd-remote-target.h" | 33 | #include "lcd-remote-target.h" |
@@ -61,17 +61,6 @@ typedef unsigned long fb_remote_data; | |||
61 | #define FB_RDATA_SZ 4 | 61 | #define FB_RDATA_SZ 4 |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | /* common functions */ | ||
65 | void lcd_remote_init(void); | ||
66 | void lcd_remote_write_command(int cmd); | ||
67 | void lcd_remote_write_command_ex(int cmd, int data); | ||
68 | void lcd_remote_write_data(const fb_remote_data *data, int count); | ||
69 | |||
70 | /* Low-level drawing function types */ | ||
71 | typedef void lcd_remote_pixelfunc_type(int x, int y); | ||
72 | typedef void lcd_remote_blockfunc_type(fb_remote_data *address, unsigned mask, | ||
73 | unsigned bits); | ||
74 | |||
75 | #if LCD_REMOTE_DEPTH > 1 /* greyscale - 8 bit max */ | 64 | #if LCD_REMOTE_DEPTH > 1 /* greyscale - 8 bit max */ |
76 | #ifdef HAVE_LCD_COLOR | 65 | #ifdef HAVE_LCD_COLOR |
77 | extern unsigned lcd_remote_color_to_native(unsigned color); | 66 | extern unsigned lcd_remote_color_to_native(unsigned color); |
@@ -109,14 +98,70 @@ extern unsigned lcd_remote_color_to_native(unsigned color); | |||
109 | #ifndef LCD_REMOTE_FBHEIGHT | 98 | #ifndef LCD_REMOTE_FBHEIGHT |
110 | #define LCD_REMOTE_FBHEIGHT LCD_REMOTE_HEIGHT | 99 | #define LCD_REMOTE_FBHEIGHT LCD_REMOTE_HEIGHT |
111 | #endif | 100 | #endif |
101 | |||
112 | /* The actual framebuffer */ | 102 | /* The actual framebuffer */ |
113 | extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_FBHEIGHT][LCD_REMOTE_FBWIDTH]; | 103 | extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_FBHEIGHT][LCD_REMOTE_FBWIDTH]; |
114 | 104 | ||
105 | #if LCD_REMOTE_DEPTH > 1 | ||
106 | extern void lcd_remote_set_foreground(unsigned foreground); | ||
107 | extern unsigned lcd_remote_get_foreground(void); | ||
108 | extern void lcd_remote_set_background(unsigned background); | ||
109 | extern unsigned lcd_remote_get_background(void); | ||
110 | extern void lcd_remote_set_drawinfo(int mode, unsigned foreground, | ||
111 | unsigned background); | ||
112 | void lcd_remote_set_backdrop(fb_remote_data* backdrop); | ||
113 | fb_remote_data* lcd_remote_get_backdrop(void); | ||
114 | |||
115 | extern void lcd_remote_mono_bitmap_part(const unsigned char *src, int src_x, | ||
116 | int src_y, int stride, int x, int y, | ||
117 | int width, int height); | ||
118 | extern void lcd_remote_mono_bitmap(const unsigned char *src, int x, int y, | ||
119 | int width, int height); | ||
120 | extern void lcd_remote_bitmap_transparent_part(const fb_remote_data *src, | ||
121 | int src_x, int src_y, | ||
122 | int stride, int x, int y, | ||
123 | int width, int height); | ||
124 | extern void lcd_bitmap_remote_transparent(const fb_remote_data *src, int x, | ||
125 | int y, int width, int height); | ||
126 | #else /* LCD_REMOTE_DEPTH == 1 */ | ||
127 | #define lcd_remote_mono_bitmap lcd_remote_bitmap | ||
128 | #define lcd_remote_mono_bitmap_part lcd_remote_bitmap_part | ||
129 | #endif /* LCD_REMOTE_DEPTH */ | ||
130 | |||
131 | /* common functions */ | ||
132 | void lcd_remote_init(void); | ||
133 | void lcd_remote_write_command(int cmd); | ||
134 | void lcd_remote_write_command_ex(int cmd, int data); | ||
135 | void lcd_remote_write_data(const fb_remote_data *data, int count); | ||
136 | |||
137 | extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x, | ||
138 | int src_y, int stride, int x, int y, | ||
139 | int width, int height); | ||
140 | extern void lcd_remote_bitmap(const fb_remote_data *src, int x, int y, | ||
141 | int width, int height); | ||
142 | |||
143 | /* Low-level drawing function types */ | ||
144 | typedef void lcd_remote_pixelfunc_type(int x, int y); | ||
145 | typedef void lcd_remote_blockfunc_type(fb_remote_data *address, unsigned mask, | ||
146 | unsigned bits); | ||
147 | |||
148 | /* low level drawing function pointer arrays */ | ||
149 | #if LCD_REMOTE_DEPTH > 1 | ||
150 | extern lcd_remote_pixelfunc_type* const *lcd_remote_pixelfuncs; | ||
151 | extern lcd_remote_blockfunc_type* const *lcd_remote_blockfuncs; | ||
152 | #else | ||
153 | extern lcd_remote_pixelfunc_type* const lcd_remote_pixelfuncs[8]; | ||
154 | extern lcd_remote_blockfunc_type* const lcd_remote_blockfuncs[8]; | ||
155 | #endif | ||
156 | |||
157 | #endif /* HAVE_LCD_REMOTE */ | ||
158 | |||
115 | void lcd_remote_init_device(void); | 159 | void lcd_remote_init_device(void); |
116 | void lcd_remote_on(void); | 160 | void lcd_remote_on(void); |
117 | void lcd_remote_off(void); | 161 | void lcd_remote_off(void); |
118 | 162 | ||
119 | extern bool remote_initialized; | 163 | extern bool remote_initialized; |
164 | bool remote_detect(void); | ||
120 | 165 | ||
121 | extern void lcd_remote_init(void); | 166 | extern void lcd_remote_init(void); |
122 | extern int lcd_remote_default_contrast(void); | 167 | extern int lcd_remote_default_contrast(void); |
@@ -168,15 +213,6 @@ extern void lcd_remote_setfont(int font); | |||
168 | extern int lcd_remote_getfont(void); | 213 | extern int lcd_remote_getfont(void); |
169 | extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); | 214 | extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); |
170 | 215 | ||
171 | /* low level drawing function pointer arrays */ | ||
172 | #if LCD_REMOTE_DEPTH > 1 | ||
173 | extern lcd_remote_pixelfunc_type* const *lcd_remote_pixelfuncs; | ||
174 | extern lcd_remote_blockfunc_type* const *lcd_remote_blockfuncs; | ||
175 | #else | ||
176 | extern lcd_remote_pixelfunc_type* const lcd_remote_pixelfuncs[8]; | ||
177 | extern lcd_remote_blockfunc_type* const lcd_remote_blockfuncs[8]; | ||
178 | #endif | ||
179 | |||
180 | extern void lcd_remote_drawpixel(int x, int y); | 216 | extern void lcd_remote_drawpixel(int x, int y); |
181 | extern void lcd_remote_drawline(int x1, int y1, int x2, int y2); | 217 | extern void lcd_remote_drawline(int x1, int y1, int x2, int y2); |
182 | extern void lcd_remote_hline(int x1, int x2, int y); | 218 | extern void lcd_remote_hline(int x1, int x2, int y); |
@@ -185,44 +221,14 @@ extern void lcd_remote_drawrect(int x, int y, int width, int height); | |||
185 | extern void lcd_remote_fillrect(int x, int y, int width, int height); | 221 | extern void lcd_remote_fillrect(int x, int y, int width, int height); |
186 | extern void lcd_remote_draw_border_viewport(void); | 222 | extern void lcd_remote_draw_border_viewport(void); |
187 | extern void lcd_remote_fill_viewport(void); | 223 | extern void lcd_remote_fill_viewport(void); |
188 | extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x, | ||
189 | int src_y, int stride, int x, int y, | ||
190 | int width, int height); | ||
191 | extern void lcd_remote_bitmap(const fb_remote_data *src, int x, int y, | ||
192 | int width, int height); | ||
193 | extern void lcd_remote_putsxy(int x, int y, const unsigned char *str); | 224 | extern void lcd_remote_putsxy(int x, int y, const unsigned char *str); |
194 | extern void lcd_remote_putsxyf(int x, int y, const unsigned char *fmt, ...); | 225 | extern void lcd_remote_putsxyf(int x, int y, const unsigned char *fmt, ...); |
195 | 226 | ||
196 | extern void lcd_remote_bidir_scroll(int threshold); | 227 | extern void lcd_remote_bidir_scroll(int threshold); |
197 | extern void lcd_remote_scroll_step(int pixels); | 228 | extern void lcd_remote_scroll_step(int pixels); |
198 | 229 | ||
199 | #if LCD_REMOTE_DEPTH > 1 | ||
200 | extern void lcd_remote_set_foreground(unsigned foreground); | ||
201 | extern unsigned lcd_remote_get_foreground(void); | ||
202 | extern void lcd_remote_set_background(unsigned background); | ||
203 | extern unsigned lcd_remote_get_background(void); | ||
204 | extern void lcd_remote_set_drawinfo(int mode, unsigned foreground, | ||
205 | unsigned background); | ||
206 | void lcd_remote_set_backdrop(fb_remote_data* backdrop); | ||
207 | fb_remote_data* lcd_remote_get_backdrop(void); | ||
208 | |||
209 | extern void lcd_remote_mono_bitmap_part(const unsigned char *src, int src_x, | ||
210 | int src_y, int stride, int x, int y, | ||
211 | int width, int height); | ||
212 | extern void lcd_remote_mono_bitmap(const unsigned char *src, int x, int y, | ||
213 | int width, int height); | ||
214 | extern void lcd_remote_bitmap_transparent_part(const fb_remote_data *src, | ||
215 | int src_x, int src_y, | ||
216 | int stride, int x, int y, | ||
217 | int width, int height); | ||
218 | extern void lcd_bitmap_remote_transparent(const fb_remote_data *src, int x, | ||
219 | int y, int width, int height); | ||
220 | #else /* LCD_REMOTE_DEPTH == 1 */ | ||
221 | #define lcd_remote_mono_bitmap lcd_remote_bitmap | ||
222 | #define lcd_remote_mono_bitmap_part lcd_remote_bitmap_part | ||
223 | #endif /* LCD_REMOTE_DEPTH */ | ||
224 | extern void lcd_remote_bmp_part(const struct bitmap* bm, int src_x, int src_y, | 230 | extern void lcd_remote_bmp_part(const struct bitmap* bm, int src_x, int src_y, |
225 | int x, int y, int width, int height); | 231 | int x, int y, int width, int height); |
226 | extern void lcd_remote_bmp(const struct bitmap* bm, int x, int y); | 232 | extern void lcd_remote_bmp(const struct bitmap* bm, int x, int y); |
227 | #endif | 233 | |
228 | #endif /* __LCD_REMOTE_H__ */ | 234 | #endif /* __LCD_REMOTE_H__ */ |
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h b/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h index 6226f4462e..a214690aec 100644 --- a/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h +++ b/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h | |||
@@ -21,8 +21,6 @@ | |||
21 | #ifndef LCD_REMOTE_TARGET_H | 21 | #ifndef LCD_REMOTE_TARGET_H |
22 | #define LCD_REMOTE_TARGET_H | 22 | #define LCD_REMOTE_TARGET_H |
23 | 23 | ||
24 | bool remote_detect(void); /* returns detection status */ | ||
25 | |||
26 | void lcd_remote_backlight(bool on); | 24 | void lcd_remote_backlight(bool on); |
27 | 25 | ||
28 | bool lcd_remote_read_device(unsigned char *data); | 26 | bool lcd_remote_read_device(unsigned char *data); |
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h index ee3443b666..a3657490eb 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h +++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h | |||
@@ -26,8 +26,6 @@ | |||
26 | 26 | ||
27 | void lcd_remote_powersave(bool on); | 27 | void lcd_remote_powersave(bool on); |
28 | 28 | ||
29 | bool remote_detect(void); | ||
30 | |||
31 | #ifndef SIMULATOR | 29 | #ifndef SIMULATOR |
32 | void _remote_backlight_on(void); | 30 | void _remote_backlight_on(void); |
33 | void _remote_backlight_off(void); | 31 | void _remote_backlight_off(void); |
diff --git a/firmware/target/coldfire/iaudio/lcd-remote-target.h b/firmware/target/coldfire/iaudio/lcd-remote-target.h index 435eee08c8..fe55212b81 100644 --- a/firmware/target/coldfire/iaudio/lcd-remote-target.h +++ b/firmware/target/coldfire/iaudio/lcd-remote-target.h | |||
@@ -24,7 +24,6 @@ | |||
24 | #define REMOTE_INIT_LCD 1 | 24 | #define REMOTE_INIT_LCD 1 |
25 | #define REMOTE_DEINIT_LCD 2 | 25 | #define REMOTE_DEINIT_LCD 2 |
26 | 26 | ||
27 | bool remote_detect(void); | ||
28 | void lcd_remote_powersave(bool on); | 27 | void lcd_remote_powersave(bool on); |
29 | void lcd_remote_poweroff(void); /* for when remote is plugged during shutdown*/ | 28 | void lcd_remote_poweroff(void); /* for when remote is plugged during shutdown*/ |
30 | 29 | ||
diff --git a/firmware/target/coldfire/iaudio/m3/button-m3.c b/firmware/target/coldfire/iaudio/m3/button-m3.c index 308f656ad2..3c31c962c8 100644 --- a/firmware/target/coldfire/iaudio/m3/button-m3.c +++ b/firmware/target/coldfire/iaudio/m3/button-m3.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "button.h" | 24 | #include "button.h" |
25 | #include "backlight.h" | 25 | #include "backlight.h" |
26 | #include "adc.h" | 26 | #include "adc.h" |
27 | #include "lcd-remote-target.h" | 27 | #include "lcd-remote.h" |
28 | 28 | ||
29 | static bool hold_button = false; | 29 | static bool hold_button = false; |
30 | static bool remote_hold_button = false; | 30 | static bool remote_hold_button = false; |
diff --git a/firmware/target/coldfire/iaudio/m5/button-m5.c b/firmware/target/coldfire/iaudio/m5/button-m5.c index cccda5e598..6dbd2023f2 100644 --- a/firmware/target/coldfire/iaudio/m5/button-m5.c +++ b/firmware/target/coldfire/iaudio/m5/button-m5.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include "button.h" | 23 | #include "button.h" |
24 | #include "backlight.h" | 24 | #include "backlight.h" |
25 | #include "adc.h" | 25 | #include "adc.h" |
26 | #include "lcd-remote-target.h" | 26 | #include "lcd-remote.h" |
27 | 27 | ||
28 | /* have buttons scan by default */ | 28 | /* have buttons scan by default */ |
29 | static bool button_scan_on = true; | 29 | static bool button_scan_on = true; |
diff --git a/firmware/target/coldfire/iaudio/x5/button-x5.c b/firmware/target/coldfire/iaudio/x5/button-x5.c index c901105100..e1f68de36b 100644 --- a/firmware/target/coldfire/iaudio/x5/button-x5.c +++ b/firmware/target/coldfire/iaudio/x5/button-x5.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include "button.h" | 23 | #include "button.h" |
24 | #include "backlight.h" | 24 | #include "backlight.h" |
25 | #include "adc.h" | 25 | #include "adc.h" |
26 | #include "lcd-remote-target.h" | 26 | #include "lcd-remote.h" |
27 | 27 | ||
28 | /* have buttons scan by default */ | 28 | /* have buttons scan by default */ |
29 | static bool button_scan_on = true; | 29 | static bool button_scan_on = true; |
diff --git a/firmware/target/coldfire/iriver/lcd-remote-target.h b/firmware/target/coldfire/iriver/lcd-remote-target.h index 7e2b6f5940..85bc754143 100644 --- a/firmware/target/coldfire/iriver/lcd-remote-target.h +++ b/firmware/target/coldfire/iriver/lcd-remote-target.h | |||
@@ -29,6 +29,4 @@ void lcd_remote_emireduce(bool state); | |||
29 | #endif | 29 | #endif |
30 | void lcd_remote_powersave(bool on); | 30 | void lcd_remote_powersave(bool on); |
31 | 31 | ||
32 | bool remote_detect(void); | ||
33 | |||
34 | #endif | 32 | #endif |