diff options
Diffstat (limited to 'firmware/export/lcd.h')
-rw-r--r-- | firmware/export/lcd.h | 271 |
1 files changed, 170 insertions, 101 deletions
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index ae06307dca..af734da913 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -23,30 +23,11 @@ | |||
23 | #define __LCD_H__ | 23 | #define __LCD_H__ |
24 | 24 | ||
25 | #include <stdbool.h> | 25 | #include <stdbool.h> |
26 | #include <stddef.h> | ||
26 | #include "cpu.h" | 27 | #include "cpu.h" |
27 | #include "config.h" | 28 | #include "config.h" |
28 | #include "events.h" | 29 | #include "events.h" |
29 | 30 | ||
30 | #define VP_FLAG_ALIGN_RIGHT 0x01 | ||
31 | #define VP_FLAG_ALIGN_CENTER 0x02 | ||
32 | |||
33 | #define VP_FLAG_ALIGNMENT_MASK \ | ||
34 | (VP_FLAG_ALIGN_RIGHT|VP_FLAG_ALIGN_CENTER) | ||
35 | |||
36 | #define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_ALIGN_RIGHT) | ||
37 | |||
38 | struct viewport { | ||
39 | int x; | ||
40 | int y; | ||
41 | int width; | ||
42 | int height; | ||
43 | int flags; | ||
44 | int font; | ||
45 | int drawmode; | ||
46 | /* needed for even for mono displays to support greylib */ | ||
47 | unsigned fg_pattern; | ||
48 | unsigned bg_pattern; | ||
49 | }; | ||
50 | 31 | ||
51 | /* Frame buffer stride | 32 | /* Frame buffer stride |
52 | * | 33 | * |
@@ -101,7 +82,7 @@ enum screen_type { | |||
101 | 82 | ||
102 | struct scrollinfo; | 83 | struct scrollinfo; |
103 | 84 | ||
104 | #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE | 85 | #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE |
105 | #define STRIDE_MAIN(w, h) (h) | 86 | #define STRIDE_MAIN(w, h) (h) |
106 | #else | 87 | #else |
107 | #define STRIDE_MAIN(w, h) (w) | 88 | #define STRIDE_MAIN(w, h) (w) |
@@ -115,46 +96,105 @@ struct scrollinfo; | |||
115 | #if LCD_DEPTH <=8 | 96 | #if LCD_DEPTH <=8 |
116 | #if (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) \ | 97 | #if (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) \ |
117 | || (LCD_PIXELFORMAT == HORIZONTAL_INTERLEAVED) | 98 | || (LCD_PIXELFORMAT == HORIZONTAL_INTERLEAVED) |
118 | typedef unsigned short fb_data; | 99 | typedef unsigned short fb_data; |
119 | #define FB_DATA_SZ 2 | 100 | #define FB_DATA_SZ 2 |
120 | #else | 101 | #else |
121 | typedef unsigned char fb_data; | 102 | typedef unsigned char fb_data; |
122 | #define FB_DATA_SZ 1 | 103 | #define FB_DATA_SZ 1 |
123 | #endif | 104 | #endif |
124 | #elif LCD_DEPTH <= 16 | 105 | #elif LCD_DEPTH <= 16 |
125 | typedef unsigned short fb_data; | 106 | typedef unsigned short fb_data; |
126 | #define FB_DATA_SZ 2 | 107 | #define FB_DATA_SZ 2 |
127 | #elif LCD_DEPTH <= 24 | 108 | #elif LCD_DEPTH <= 24 |
128 | struct _fb_pixel { | 109 | struct _fb_pixel { |
129 | unsigned char b, g, r; | 110 | unsigned char b, g, r; |
130 | }; | 111 | }; |
131 | typedef struct _fb_pixel fb_data; | 112 | typedef struct _fb_pixel fb_data; |
132 | #define FB_DATA_SZ 3 | 113 | #define FB_DATA_SZ 3 |
133 | #else /* LCD_DEPTH > 24 */ | 114 | #else /* LCD_DEPTH > 24 */ |
134 | #if (LCD_PIXELFORMAT == XRGB8888) | 115 | #if (LCD_PIXELFORMAT == XRGB8888) |
135 | struct _fb_pixel { | 116 | struct _fb_pixel { |
136 | unsigned char b, g, r, x; | 117 | unsigned char b, g, r, x; |
137 | }; | 118 | }; |
138 | typedef struct _fb_pixel fb_data; | 119 | typedef struct _fb_pixel fb_data; |
139 | #else | 120 | #else |
140 | typedef unsigned long fb_data; | 121 | typedef unsigned long fb_data; |
141 | #endif | 122 | #endif |
142 | #define FB_DATA_SZ 4 | 123 | #define FB_DATA_SZ 4 |
143 | #endif /* LCD_DEPTH */ | 124 | #endif /* LCD_DEPTH */ |
144 | 125 | ||
126 | #ifdef HAVE_REMOTE_LCD | ||
127 | #if LCD_REMOTE_DEPTH <= 8 | ||
128 | #if (LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED) \ | ||
129 | || (LCD_REMOTE_PIXELFORMAT == HORIZONTAL_INTERLEAVED) | ||
130 | typedef unsigned short fb_remote_data; | ||
131 | #define FB_RDATA_SZ 2 | ||
132 | #else | ||
133 | typedef unsigned char fb_remote_data; | ||
134 | #define FB_RDATA_SZ 1 | ||
135 | #endif | ||
136 | #elif LCD_DEPTH <= 16 | ||
137 | typedef unsigned short fb_remote_data; | ||
138 | #define FB_RDATA_SZ 2 | ||
139 | #else | ||
140 | typedef unsigned long fb_remote_data; | ||
141 | #define FB_RDATA_SZ 4 | ||
142 | #endif | ||
143 | #endif | ||
144 | |||
145 | #if defined(HAVE_LCD_MODES) | 145 | #if defined(HAVE_LCD_MODES) |
146 | void lcd_set_mode(int mode); | 146 | void lcd_set_mode(int mode); |
147 | #define LCD_MODE_RGB565 0x00000001 | 147 | #define LCD_MODE_RGB565 0x00000001 |
148 | #define LCD_MODE_YUV 0x00000002 | 148 | #define LCD_MODE_YUV 0x00000002 |
149 | #define LCD_MODE_PAL256 0x00000004 | 149 | #define LCD_MODE_PAL256 0x00000004 |
150 | 150 | ||
151 | #if HAVE_LCD_MODES & LCD_MODE_PAL256 | 151 | #if HAVE_LCD_MODES & LCD_MODE_PAL256 |
152 | void lcd_blit_pal256(unsigned char *src, int src_x, int src_y, int x, int y, | 152 | void lcd_blit_pal256(unsigned char *src, int src_x, int src_y, int x, int y, |
153 | int width, int height); | 153 | int width, int height); |
154 | void lcd_pal256_update_pal(fb_data *palette); | 154 | void lcd_pal256_update_pal(fb_data *palette); |
155 | #endif | 155 | #endif |
156 | #endif | 156 | #endif |
157 | 157 | ||
158 | struct frame_buffer_t { | ||
159 | union | ||
160 | { | ||
161 | void *data; | ||
162 | char *ch_ptr; | ||
163 | fb_data *fb_ptr; | ||
164 | #ifdef HAVE_REMOTE_LCD | ||
165 | fb_remote_data *fb_remote_ptr; | ||
166 | #endif | ||
167 | }; | ||
168 | void *(*get_address_fn)(int x, int y); | ||
169 | ptrdiff_t stride; | ||
170 | size_t elems; | ||
171 | }; | ||
172 | |||
173 | #define VP_FLAG_ALIGN_RIGHT 0x01 | ||
174 | #define VP_FLAG_ALIGN_CENTER 0x02 | ||
175 | |||
176 | #define VP_FLAG_ALIGNMENT_MASK \ | ||
177 | (VP_FLAG_ALIGN_RIGHT|VP_FLAG_ALIGN_CENTER) | ||
178 | |||
179 | #define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_ALIGN_RIGHT) | ||
180 | |||
181 | #define VP_FLAG_VP_DIRTY 0x4000 | ||
182 | #define VP_FLAG_CLEAR_FLAG 0x8000 | ||
183 | #define VP_FLAG_VP_SET_CLEAN (VP_FLAG_CLEAR_FLAG | VP_FLAG_VP_DIRTY) | ||
184 | |||
185 | struct viewport { | ||
186 | int x; | ||
187 | int y; | ||
188 | int width; | ||
189 | int height; | ||
190 | int flags; | ||
191 | int font; | ||
192 | int drawmode; | ||
193 | struct frame_buffer_t *buffer; | ||
194 | /* needed for even for mono displays to support greylib */ | ||
195 | unsigned fg_pattern; | ||
196 | unsigned bg_pattern; | ||
197 | }; | ||
158 | 198 | ||
159 | /* common functions */ | 199 | /* common functions */ |
160 | extern void lcd_write_command(int byte); | 200 | extern void lcd_write_command(int byte); |
@@ -171,7 +211,10 @@ extern int lcd_getwidth(void); | |||
171 | extern int lcd_getheight(void); | 211 | extern int lcd_getheight(void); |
172 | extern int lcd_getstringsize(const unsigned char *str, int *w, int *h); | 212 | extern int lcd_getstringsize(const unsigned char *str, int *w, int *h); |
173 | 213 | ||
174 | extern void lcd_set_viewport(struct viewport* vp); | 214 | extern struct viewport* lcd_init_viewport(struct viewport* vp); |
215 | extern struct viewport* lcd_set_viewport(struct viewport* vp); | ||
216 | extern struct viewport* lcd_set_viewport_ex(struct viewport* vp, int flags); | ||
217 | |||
175 | extern void lcd_update(void); | 218 | extern void lcd_update(void); |
176 | extern void lcd_update_viewport(void); | 219 | extern void lcd_update_viewport(void); |
177 | extern void lcd_update_viewport_rect(int x, int y, int width, int height); | 220 | extern void lcd_update_viewport_rect(int x, int y, int width, int height); |
@@ -193,15 +236,15 @@ extern bool lcd_putsxy_scroll_func(int x, int y, const unsigned char *string, | |||
193 | #if defined(HAVE_LCD_COLOR) | 236 | #if defined(HAVE_LCD_COLOR) |
194 | #if MEMORYSIZE > 2 | 237 | #if MEMORYSIZE > 2 |
195 | #define LCD_YUV_DITHER 0x1 | 238 | #define LCD_YUV_DITHER 0x1 |
196 | extern void lcd_yuv_set_options(unsigned options); | 239 | extern void lcd_yuv_set_options(unsigned options); |
197 | extern void lcd_blit_yuv(unsigned char * const src[3], | 240 | extern void lcd_blit_yuv(unsigned char * const src[3], |
198 | int src_x, int src_y, int stride, | 241 | int src_x, int src_y, int stride, |
199 | int x, int y, int width, int height); | 242 | int x, int y, int width, int height); |
200 | #endif /* MEMORYSIZE > 2 */ | 243 | #endif /* MEMORYSIZE > 2 */ |
201 | #else | 244 | #else |
202 | extern void lcd_blit_mono(const unsigned char *data, int x, int by, int width, | 245 | extern void lcd_blit_mono(const unsigned char *data, int x, int by, int width, |
203 | int bheight, int stride); | 246 | int bheight, int stride); |
204 | extern void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases, | 247 | extern void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases, |
205 | int bx, int by, int bwidth, int bheight, | 248 | int bx, int by, int bwidth, int bheight, |
206 | int stride); | 249 | int stride); |
207 | #endif | 250 | #endif |
@@ -211,9 +254,9 @@ extern void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases, | |||
211 | extern void lcd_update_rect(int x, int y, int width, int height); | 254 | extern void lcd_update_rect(int x, int y, int width, int height); |
212 | 255 | ||
213 | #ifdef HAVE_REMOTE_LCD | 256 | #ifdef HAVE_REMOTE_LCD |
214 | extern void lcd_remote_update(void); | 257 | extern void lcd_remote_update(void); |
215 | /* update a fraction of the screen */ | 258 | /* update a fraction of the screen */ |
216 | extern void lcd_remote_update_rect(int x, int y, int width, int height); | 259 | extern void lcd_remote_update_rect(int x, int y, int width, int height); |
217 | #endif /* HAVE_REMOTE_LCD */ | 260 | #endif /* HAVE_REMOTE_LCD */ |
218 | 261 | ||
219 | /* Bitmap formats */ | 262 | /* Bitmap formats */ |
@@ -239,13 +282,13 @@ enum | |||
239 | typedef void lcd_pixelfunc_type(int x, int y); | 282 | typedef void lcd_pixelfunc_type(int x, int y); |
240 | typedef void lcd_blockfunc_type(fb_data *address, unsigned mask, unsigned bits); | 283 | typedef void lcd_blockfunc_type(fb_data *address, unsigned mask, unsigned bits); |
241 | #if LCD_DEPTH >= 8 | 284 | #if LCD_DEPTH >= 8 |
242 | typedef void lcd_fastpixelfunc_type(fb_data *address); | 285 | typedef void lcd_fastpixelfunc_type(fb_data *address); |
243 | #endif | 286 | #endif |
244 | 287 | ||
245 | #if defined(HAVE_LCD_COLOR) && defined(LCD_REMOTE_DEPTH) && \ | 288 | #if defined(HAVE_LCD_COLOR) && defined(LCD_REMOTE_DEPTH) && \ |
246 | LCD_REMOTE_DEPTH > 1 | 289 | LCD_REMOTE_DEPTH > 1 |
247 | /* Just return color for screens use */ | 290 | /* Just return color for screens use */ |
248 | static inline unsigned lcd_color_to_native(unsigned color) | 291 | static inline unsigned lcd_color_to_native(unsigned color) |
249 | { return color; } | 292 | { return color; } |
250 | #define SCREEN_COLOR_TO_NATIVE(screen, color) (screen)->color_to_native(color) | 293 | #define SCREEN_COLOR_TO_NATIVE(screen, color) (screen)->color_to_native(color) |
251 | #else | 294 | #else |
@@ -286,7 +329,7 @@ static inline unsigned lcd_color_to_native(unsigned color) | |||
286 | (((b) >> 3) << 8) ) | 329 | (((b) >> 3) << 8) ) |
287 | /* swap color once - not currenly used in static inits */ | 330 | /* swap color once - not currenly used in static inits */ |
288 | #define _SWAPUNPACK(x, _unp_) \ | 331 | #define _SWAPUNPACK(x, _unp_) \ |
289 | ({ typeof (x) _x_ = swap16(x); _unp_(_x_); }) | 332 | ({ typeof (x) _x_ = swap16(x); _unp_(_x_); }) |
290 | #define RGB_UNPACK_RED(x) _SWAPUNPACK((x), _RGB_UNPACK_RED) | 333 | #define RGB_UNPACK_RED(x) _SWAPUNPACK((x), _RGB_UNPACK_RED) |
291 | #define RGB_UNPACK_GREEN(x) _SWAPUNPACK((x), _RGB_UNPACK_GREEN) | 334 | #define RGB_UNPACK_GREEN(x) _SWAPUNPACK((x), _RGB_UNPACK_GREEN) |
292 | #define RGB_UNPACK_BLUE(x) _SWAPUNPACK((x), _RGB_UNPACK_BLUE) | 335 | #define RGB_UNPACK_BLUE(x) _SWAPUNPACK((x), _RGB_UNPACK_BLUE) |
@@ -374,16 +417,16 @@ static inline unsigned lcd_color_to_native(unsigned color) | |||
374 | * format, so it's the reverse of FB_SCALARPACK_LCD | 417 | * format, so it's the reverse of FB_SCALARPACK_LCD |
375 | */ | 418 | */ |
376 | #if LCD_DEPTH >= 24 | 419 | #if LCD_DEPTH >= 24 |
377 | static inline fb_data scalar_to_fb(unsigned p) | 420 | static inline fb_data scalar_to_fb(unsigned p) |
378 | { | 421 | { |
379 | union { fb_data st; unsigned sc; } convert; | 422 | union { fb_data st; unsigned sc; } convert; |
380 | convert.sc = p; return convert.st; | 423 | convert.sc = p; return convert.st; |
381 | } | 424 | } |
382 | static inline unsigned fb_to_scalar(fb_data p) | 425 | static inline unsigned fb_to_scalar(fb_data p) |
383 | { | 426 | { |
384 | union { fb_data st; unsigned sc; } convert; | 427 | union { fb_data st; unsigned sc; } convert; |
385 | convert.st = p; return convert.sc; | 428 | convert.st = p; return convert.sc; |
386 | } | 429 | } |
387 | #define FB_RGBPACK(r_, g_, b_) ((fb_data){.r = r_, .g = g_, .b = b_}) | 430 | #define FB_RGBPACK(r_, g_, b_) ((fb_data){.r = r_, .g = g_, .b = b_}) |
388 | #define FB_RGBPACK_LCD(r_, g_, b_) FB_RGBPACK(r_, g_, b_) | 431 | #define FB_RGBPACK_LCD(r_, g_, b_) FB_RGBPACK(r_, g_, b_) |
389 | #define FB_UNPACK_RED(fb) ((fb).r) | 432 | #define FB_UNPACK_RED(fb) ((fb).r) |
@@ -411,17 +454,28 @@ static inline unsigned fb_to_scalar(fb_data p) | |||
411 | /* Frame buffer dimensions */ | 454 | /* Frame buffer dimensions */ |
412 | #if LCD_DEPTH == 1 | 455 | #if LCD_DEPTH == 1 |
413 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | 456 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |
414 | #define LCD_FBWIDTH ((LCD_WIDTH+7)/8) | 457 | #define LCD_FBSTRIDE(w, h) ((w+7)/8) |
458 | #define LCD_FBWIDTH LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) | ||
459 | #define LCD_NBELEMS(w, h) (((h*LCD_FBSTRIDE(w, h)) + w) / sizeof(fb_data)) | ||
415 | #else /* LCD_PIXELFORMAT == VERTICAL_PACKING */ | 460 | #else /* LCD_PIXELFORMAT == VERTICAL_PACKING */ |
416 | #define LCD_FBHEIGHT ((LCD_HEIGHT+7)/8) | 461 | #define LCD_FBSTRIDE(w, h) ((h+7)/8) |
462 | #define LCD_FBHEIGHT LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) | ||
463 | #define LCD_NBELEMS(w, h) (((w*LCD_FBSTRIDE(w, h)) + h) / sizeof(fb_data)) | ||
417 | #endif /* LCD_PIXELFORMAT */ | 464 | #endif /* LCD_PIXELFORMAT */ |
418 | #elif LCD_DEPTH == 2 | 465 | #elif LCD_DEPTH == 2 |
419 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | 466 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |
420 | #define LCD_FBWIDTH ((LCD_WIDTH+3)/4) | 467 | #define LCD_FBSTRIDE(w, h) ((w+3)>>2) |
468 | #define LCD_NATIVE_STRIDE(s) LCD_FBSTRIDE(s, s) | ||
469 | #define LCD_FBWIDTH LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) | ||
470 | #define LCD_NBELEMS(w, h) (((h*LCD_FBSTRIDE(w, h)) + w) / sizeof(fb_data)) | ||
421 | #elif LCD_PIXELFORMAT == VERTICAL_PACKING | 471 | #elif LCD_PIXELFORMAT == VERTICAL_PACKING |
422 | #define LCD_FBHEIGHT ((LCD_HEIGHT+3)/4) | 472 | #define LCD_FBSTRIDE(w, h) ((h+3)/4) |
473 | #define LCD_FBHEIGHT LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) | ||
474 | #define LCD_NBELEMS(w, h) (((w*LCD_FBSTRIDE(w, h)) + h) / sizeof(fb_data)) | ||
423 | #elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED | 475 | #elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED |
424 | #define LCD_FBHEIGHT ((LCD_HEIGHT+7)/8) | 476 | #define LCD_FBSTRIDE(w, h) ((h+7)/8) |
477 | #define LCD_FBHEIGHT LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) | ||
478 | #define LCD_NBELEMS(w, h) (((w*LCD_FBSTRIDE(w, h)) + h) / sizeof(fb_data)) | ||
425 | #endif /* LCD_PIXELFORMAT */ | 479 | #endif /* LCD_PIXELFORMAT */ |
426 | #endif /* LCD_DEPTH */ | 480 | #endif /* LCD_DEPTH */ |
427 | /* Set defaults if not defined different yet. The defaults apply to both | 481 | /* Set defaults if not defined different yet. The defaults apply to both |
@@ -432,13 +486,29 @@ static inline unsigned fb_to_scalar(fb_data p) | |||
432 | #ifndef LCD_FBHEIGHT | 486 | #ifndef LCD_FBHEIGHT |
433 | #define LCD_FBHEIGHT LCD_HEIGHT | 487 | #define LCD_FBHEIGHT LCD_HEIGHT |
434 | #endif | 488 | #endif |
435 | /* The actual framebuffer */ | 489 | |
436 | extern fb_data *lcd_framebuffer; | 490 | #ifndef LCD_NATIVE_STRIDE |
491 | /* 2-bit Horz is the only display that actually defines this */ | ||
492 | #define LCD_NATIVE_STRIDE(s) (s) | ||
493 | #endif | ||
494 | |||
495 | #ifndef LCD_NBELEMS | ||
437 | #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE | 496 | #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE |
438 | #define FBADDR(x, y) (lcd_framebuffer + ((x) * LCD_FBHEIGHT) + (y)) | 497 | #define LCD_NBELEMS(w, h) ((w*STRIDE_MAIN(w, h)) + h) |
439 | #else | 498 | #else |
440 | #define FBADDR(x, y) (lcd_framebuffer + ((y) * LCD_FBWIDTH) + (x)) | 499 | #define LCD_NBELEMS(w, h) ((h*STRIDE_MAIN(w, h)) + w) |
441 | #endif | 500 | #endif |
501 | #define LCD_FBSTRIDE(w, h) STRIDE_MAIN(w, h) | ||
502 | #endif | ||
503 | |||
504 | #ifndef LCD_STRIDE | ||
505 | #define LCD_STRIDE(w, h) STRIDE_MAIN(w, h) | ||
506 | #endif | ||
507 | |||
508 | extern struct viewport* lcd_current_viewport; | ||
509 | |||
510 | #define FBADDR(x,y) ((fb_data*) lcd_current_viewport->buffer->get_address_fn(x, y)) | ||
511 | |||
442 | #define FRAMEBUFFER_SIZE (sizeof(fb_data)*LCD_FBWIDTH*LCD_FBHEIGHT) | 512 | #define FRAMEBUFFER_SIZE (sizeof(fb_data)*LCD_FBWIDTH*LCD_FBHEIGHT) |
443 | 513 | ||
444 | /** Port-specific functions. Enable in port config file. **/ | 514 | /** Port-specific functions. Enable in port config file. **/ |
@@ -499,7 +569,7 @@ struct bitmap { | |||
499 | 569 | ||
500 | extern void lcd_set_invert_display(bool yesno); | 570 | extern void lcd_set_invert_display(bool yesno); |
501 | #ifdef HAVE_BACKLIGHT_INVERSION | 571 | #ifdef HAVE_BACKLIGHT_INVERSION |
502 | extern void lcd_set_backlight_inversion(bool yesno); | 572 | extern void lcd_set_backlight_inversion(bool yesno); |
503 | #endif /* HAVE_BACKLIGHT_INVERSION */ | 573 | #endif /* HAVE_BACKLIGHT_INVERSION */ |
504 | extern void lcd_set_flip(bool yesno); | 574 | extern void lcd_set_flip(bool yesno); |
505 | 575 | ||
@@ -510,13 +580,13 @@ extern int lcd_getfont(void); | |||
510 | 580 | ||
511 | /* low level drawing function pointer arrays */ | 581 | /* low level drawing function pointer arrays */ |
512 | #if LCD_DEPTH >= 8 | 582 | #if LCD_DEPTH >= 8 |
513 | extern lcd_fastpixelfunc_type* const *lcd_fastpixelfuncs; | 583 | extern lcd_fastpixelfunc_type* const *lcd_fastpixelfuncs; |
514 | #elif LCD_DEPTH > 1 | 584 | #elif LCD_DEPTH > 1 |
515 | extern lcd_pixelfunc_type* const *lcd_pixelfuncs; | 585 | extern lcd_pixelfunc_type* const *lcd_pixelfuncs; |
516 | extern lcd_blockfunc_type* const *lcd_blockfuncs; | 586 | extern lcd_blockfunc_type* const *lcd_blockfuncs; |
517 | #else /* LCD_DEPTH == 1*/ | 587 | #else /* LCD_DEPTH == 1*/ |
518 | extern lcd_pixelfunc_type* const lcd_pixelfuncs[8]; | 588 | extern lcd_pixelfunc_type* const lcd_pixelfuncs[8]; |
519 | extern lcd_blockfunc_type* const lcd_blockfuncs[8]; | 589 | extern lcd_blockfunc_type* const lcd_blockfuncs[8]; |
520 | #endif /* LCD_DEPTH */ | 590 | #endif /* LCD_DEPTH */ |
521 | 591 | ||
522 | extern void lcd_drawpixel(int x, int y); | 592 | extern void lcd_drawpixel(int x, int y); |
@@ -526,45 +596,44 @@ extern void lcd_vline(int x, int y1, int y2); | |||
526 | extern void lcd_drawrect(int x, int y, int width, int height); | 596 | extern void lcd_drawrect(int x, int y, int width, int height); |
527 | extern void lcd_fillrect(int x, int y, int width, int height); | 597 | extern void lcd_fillrect(int x, int y, int width, int height); |
528 | extern void lcd_gradient_fillrect(int x, int y, int width, int height, | 598 | extern void lcd_gradient_fillrect(int x, int y, int width, int height, |
529 | unsigned start_rgb, unsigned end_rgb); | 599 | unsigned start_rgb, unsigned end_rgb); |
530 | extern void lcd_gradient_fillrect_part(int x, int y, int width, int height, | 600 | extern void lcd_gradient_fillrect_part(int x, int y, int width, int height, |
531 | unsigned start_rgb, unsigned end_rgb, int src_height, int row_skip); | 601 | unsigned start_rgb, unsigned end_rgb, int src_height, int row_skip); |
532 | extern void lcd_draw_border_viewport(void); | 602 | extern void lcd_draw_border_viewport(void); |
533 | extern void lcd_fill_viewport(void); | 603 | extern void lcd_fill_viewport(void); |
534 | extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y, | 604 | extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y, |
535 | int stride, int x, int y, int width, int height); | 605 | int stride, int x, int y, int width, int height); |
536 | extern void lcd_bitmap(const fb_data *src, int x, int y, int width, | 606 | extern void lcd_bitmap(const fb_data *src, int x, int y, int width, |
537 | int height); | 607 | int height); |
538 | extern void lcd_set_framebuffer(fb_data *fb); | ||
539 | 608 | ||
540 | extern void lcd_scroll_step(int pixels); | 609 | extern void lcd_scroll_step(int pixels); |
541 | 610 | ||
542 | #if LCD_DEPTH > 1 | 611 | #if LCD_DEPTH > 1 |
543 | extern void lcd_set_foreground(unsigned foreground); | 612 | extern void lcd_set_foreground(unsigned foreground); |
544 | extern unsigned lcd_get_foreground(void); | 613 | extern unsigned lcd_get_foreground(void); |
545 | extern void lcd_set_background(unsigned background); | 614 | extern void lcd_set_background(unsigned background); |
546 | extern unsigned lcd_get_background(void); | 615 | extern unsigned lcd_get_background(void); |
547 | #ifdef HAVE_LCD_COLOR | 616 | #ifdef HAVE_LCD_COLOR |
548 | extern void lcd_set_selector_start(unsigned selector); | 617 | extern void lcd_set_selector_start(unsigned selector); |
549 | extern void lcd_set_selector_end(unsigned selector); | 618 | extern void lcd_set_selector_end(unsigned selector); |
550 | extern void lcd_set_selector_text(unsigned selector_text); | 619 | extern void lcd_set_selector_text(unsigned selector_text); |
551 | #endif | 620 | #endif |
552 | extern void lcd_set_drawinfo(int mode, unsigned foreground, | 621 | extern void lcd_set_drawinfo(int mode, unsigned foreground, |
553 | unsigned background); | 622 | unsigned background); |
554 | void lcd_set_backdrop(fb_data* backdrop); | 623 | void lcd_set_backdrop(fb_data* backdrop); |
555 | 624 | ||
556 | fb_data* lcd_get_backdrop(void); | 625 | fb_data* lcd_get_backdrop(void); |
557 | 626 | ||
558 | extern void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y, | 627 | extern void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y, |
559 | int stride, int x, int y, int width, int height); | 628 | int stride, int x, int y, int width, int height); |
560 | extern void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, | 629 | extern void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, |
561 | int height); | 630 | int height); |
562 | extern void lcd_bitmap_transparent_part(const fb_data *src, | 631 | extern void lcd_bitmap_transparent_part(const fb_data *src, |
563 | int src_x, int src_y, | 632 | int src_x, int src_y, |
564 | int stride, int x, int y, int width, | 633 | int stride, int x, int y, int width, |
565 | int height); | 634 | int height); |
566 | extern void lcd_bitmap_transparent(const fb_data *src, int x, int y, | 635 | extern void lcd_bitmap_transparent(const fb_data *src, int x, int y, |
567 | int width, int height); | 636 | int width, int height); |
568 | #else /* LCD_DEPTH == 1 */ | 637 | #else /* LCD_DEPTH == 1 */ |
569 | #define lcd_mono_bitmap lcd_bitmap | 638 | #define lcd_mono_bitmap lcd_bitmap |
570 | #define lcd_mono_bitmap_part lcd_bitmap_part | 639 | #define lcd_mono_bitmap_part lcd_bitmap_part |
@@ -577,10 +646,10 @@ extern void lcd_nine_segment_bmp(const struct bitmap* bm, int x, int y, | |||
577 | 646 | ||
578 | /* TODO: Impement this for remote displays if ever needed */ | 647 | /* TODO: Impement this for remote displays if ever needed */ |
579 | #if defined(LCD_DPI) && (LCD_DPI > 0) | 648 | #if defined(LCD_DPI) && (LCD_DPI > 0) |
580 | /* returns the pixel density of the display */ | 649 | /* returns the pixel density of the display */ |
581 | static inline int lcd_get_dpi(void) { return LCD_DPI; } | 650 | static inline int lcd_get_dpi(void) { return LCD_DPI; } |
582 | #else | 651 | #else |
583 | extern int lcd_get_dpi(void); | 652 | extern int lcd_get_dpi(void); |
584 | #endif /* LCD_DPI */ | 653 | #endif /* LCD_DPI */ |
585 | 654 | ||
586 | #endif /* __LCD_H__ */ | 655 | #endif /* __LCD_H__ */ |