diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/lcd-remote.h | 110 |
1 files changed, 58 insertions, 52 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__ */ |