diff options
Diffstat (limited to 'firmware/export/lcd-remote.h')
-rw-r--r-- | firmware/export/lcd-remote.h | 109 |
1 files changed, 89 insertions, 20 deletions
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index c27a0d4e73..031fcdfc0f 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h | |||
@@ -27,9 +27,6 @@ | |||
27 | 27 | ||
28 | #ifdef HAVE_REMOTE_LCD | 28 | #ifdef HAVE_REMOTE_LCD |
29 | 29 | ||
30 | #define STYLE_DEFAULT 0 | ||
31 | #define STYLE_INVERT 1 | ||
32 | |||
33 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) | 30 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) |
34 | #define REMOTETYPE_H100_LCD 1 | 31 | #define REMOTETYPE_H100_LCD 1 |
35 | #define REMOTETYPE_H300_LCD 2 | 32 | #define REMOTETYPE_H300_LCD 2 |
@@ -37,35 +34,82 @@ | |||
37 | extern int remote_type(void); | 34 | extern int remote_type(void); |
38 | #endif | 35 | #endif |
39 | 36 | ||
37 | #define STYLE_DEFAULT 0 | ||
38 | #define STYLE_INVERT 1 | ||
39 | |||
40 | #if LCD_REMOTE_DEPTH <= 8 | ||
41 | #if (LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED) \ | ||
42 | || (LCD_REMOTE_PIXELFORMAT == HORIZONTAL_INTERLEAVED) | ||
43 | typedef unsigned short fb_remote_data; | ||
44 | #else | ||
45 | typedef unsigned char fb_remote_data; | ||
46 | #endif | ||
47 | #elif LCD_DEPTH <= 16 | ||
48 | typedef unsigned short fb_remote_data; | ||
49 | #else | ||
50 | typedef unsigned long fb_remote_data; | ||
51 | #endif | ||
52 | |||
53 | #ifndef LCD_REMOTE_FBWIDTH | ||
54 | #define LCD_REMOTE_FBWIDTH LCD_REMOTE_WIDTH | ||
55 | #endif | ||
56 | |||
57 | /* Low-level drawing function types */ | ||
58 | typedef void lcd_remote_pixelfunc_type(int x, int y); | ||
59 | typedef void lcd_remote_blockfunc_type(fb_remote_data *address, unsigned mask, | ||
60 | unsigned bits); | ||
61 | |||
62 | #if LCD_REMOTE_DEPTH > 1 /* greyscale */ | ||
63 | #define LCD_REMOTE_MAX_LEVEL ((1 << LCD_REMOTE_DEPTH) - 1) | ||
64 | #define LCD_REMOTE_BRIGHTNESS(y) (((y) * LCD_REMOTE_MAX_LEVEL + 127) / 255) | ||
65 | |||
66 | #define LCD_REMOTE_BLACK LCD_REMOTE_BRIGHTNESS(0) | ||
67 | #define LCD_REMOTE_DARKGRAY LCD_REMOTE_BRIGHTNESS(85) | ||
68 | #define LCD_REMOTE_LIGHTGRAY LCD_REMOTE_BRIGHTNESS(170) | ||
69 | #define LCD_REMOTE_WHITE LCD_REMOTE_BRIGHTNESS(255) | ||
70 | #define LCD_REMOTE_DEFAULT_FG LCD_REMOTE_BLACK | ||
71 | #define LCD_REMOTE_DEFAULT_BG LCD_REMOTE_WHITE | ||
72 | |||
73 | #endif | ||
74 | |||
75 | /* Memory copy of display bitmap */ | ||
76 | #if LCD_REMOTE_DEPTH == 1 | ||
77 | extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]; | ||
78 | #elif LCD_REMOTE_DEPTH == 2 | ||
79 | #if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED | ||
80 | extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]; | ||
81 | #endif | ||
82 | #endif | ||
83 | |||
40 | extern void lcd_remote_init(void); | 84 | extern void lcd_remote_init(void); |
41 | extern int lcd_remote_default_contrast(void); | 85 | extern int lcd_remote_default_contrast(void); |
42 | extern void lcd_remote_set_contrast(int val); | 86 | extern void lcd_remote_set_contrast(int val); |
43 | extern void lcd_remote_emireduce(bool state); | 87 | extern void lcd_remote_emireduce(bool state); |
44 | 88 | ||
45 | extern void lcd_remote_clear_display(void); | 89 | extern void lcd_remote_clear_display(void); |
46 | extern void lcd_remote_puts(int x, int y, const unsigned char *string); | 90 | extern void lcd_remote_puts(int x, int y, const unsigned char *str); |
47 | extern void lcd_remote_puts_style(int x, int y, const unsigned char *string, | 91 | extern void lcd_remote_puts_style(int x, int y, const unsigned char *str, |
48 | int style); | 92 | int style); |
49 | extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset); | 93 | extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, |
50 | extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset); | 94 | int offset); |
95 | extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, | ||
96 | int style, int offset); | ||
51 | extern void lcd_remote_putc(int x, int y, unsigned short ch); | 97 | extern void lcd_remote_putc(int x, int y, unsigned short ch); |
52 | extern void lcd_remote_stop_scroll(void); | 98 | extern void lcd_remote_stop_scroll(void); |
53 | extern void lcd_remote_scroll_speed(int speed); | 99 | extern void lcd_remote_scroll_speed(int speed); |
54 | extern void lcd_remote_scroll_delay(int ms); | 100 | extern void lcd_remote_scroll_delay(int ms); |
55 | extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string); | 101 | extern void lcd_remote_puts_scroll(int x, int y, const unsigned char *str); |
56 | extern void lcd_remote_puts_scroll_style(int x, int y,const unsigned char* string, | 102 | extern void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *str, |
57 | int style); | 103 | int style); |
58 | extern void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, | 104 | extern void lcd_remote_puts_scroll_offset(int x, int y, |
59 | int offset); | 105 | const unsigned char *str, int offset); |
60 | extern void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string, | 106 | extern void lcd_remote_puts_scroll_style_offset(int x, int y, |
107 | const unsigned char *string, | ||
61 | int style, int offset); | 108 | int style, int offset); |
62 | 109 | ||
63 | extern void lcd_remote_update(void); | 110 | extern void lcd_remote_update(void); |
64 | extern void lcd_remote_update_rect(int x, int y, int width, int height); | 111 | extern void lcd_remote_update_rect(int x, int y, int width, int height); |
65 | 112 | ||
66 | /* Memory copy of display bitmap */ | ||
67 | extern unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]; | ||
68 | |||
69 | extern void lcd_remote_set_invert_display(bool yesno); | 113 | extern void lcd_remote_set_invert_display(bool yesno); |
70 | extern void lcd_remote_set_flip(bool yesno); | 114 | extern void lcd_remote_set_flip(bool yesno); |
71 | extern void lcd_remote_roll(int pixels); | 115 | extern void lcd_remote_roll(int pixels); |
@@ -78,25 +122,50 @@ extern int lcd_remote_getymargin(void); | |||
78 | extern void lcd_remote_setfont(int font); | 122 | extern void lcd_remote_setfont(int font); |
79 | extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); | 123 | extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); |
80 | 124 | ||
125 | /* low level drawing function pointer arrays */ | ||
126 | extern lcd_remote_pixelfunc_type* const lcd_remote_pixelfuncs[8]; | ||
127 | extern lcd_remote_blockfunc_type* const lcd_remote_blockfuncs[8]; | ||
128 | |||
81 | extern void lcd_remote_drawpixel(int x, int y); | 129 | extern void lcd_remote_drawpixel(int x, int y); |
82 | extern void lcd_remote_drawline(int x1, int y1, int x2, int y2); | 130 | extern void lcd_remote_drawline(int x1, int y1, int x2, int y2); |
83 | extern void lcd_remote_hline(int x1, int x2, int y); | 131 | extern void lcd_remote_hline(int x1, int x2, int y); |
84 | extern void lcd_remote_vline(int x, int y1, int y2); | 132 | extern void lcd_remote_vline(int x, int y1, int y2); |
85 | extern void lcd_remote_drawrect(int x, int y, int width, int height); | 133 | extern void lcd_remote_drawrect(int x, int y, int width, int height); |
86 | extern void lcd_remote_fillrect(int x, int y, int width, int height); | 134 | extern void lcd_remote_fillrect(int x, int y, int width, int height); |
87 | extern void lcd_remote_bitmap_part(const unsigned char *src, int src_x, | 135 | extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x, |
88 | int src_y, int stride, int x, int y, | 136 | int src_y, int stride, int x, int y, |
89 | int width, int height); | 137 | int width, int height); |
90 | extern void lcd_remote_bitmap(const unsigned char *src, int x, int y, | 138 | extern void lcd_remote_bitmap(const fb_remote_data *src, int x, int y, |
91 | int width, int height); | 139 | int width, int height); |
92 | extern void lcd_remote_putsxy(int x, int y, const unsigned char *string); | 140 | extern void lcd_remote_putsxy(int x, int y, const unsigned char *str); |
93 | 141 | ||
94 | extern void lcd_remote_invertscroll(int x, int y); | 142 | extern void lcd_remote_invertscroll(int x, int y); |
95 | extern void lcd_remote_bidir_scroll(int threshold); | 143 | extern void lcd_remote_bidir_scroll(int threshold); |
96 | extern void lcd_remote_scroll_step(int pixels); | 144 | extern void lcd_remote_scroll_step(int pixels); |
97 | 145 | ||
146 | #if LCD_REMOTE_DEPTH > 1 | ||
147 | extern void lcd_remote_set_foreground(unsigned foreground); | ||
148 | extern unsigned lcd_remote_get_foreground(void); | ||
149 | extern void lcd_remote_set_background(unsigned background); | ||
150 | extern unsigned lcd_remote_get_background(void); | ||
151 | extern void lcd_remote_set_drawinfo(int mode, unsigned foreground, | ||
152 | unsigned background); | ||
153 | |||
154 | extern void lcd_remote_mono_bitmap_part(const unsigned char *src, int src_x, | ||
155 | int src_y, int stride, int x, int y, | ||
156 | int width, int height); | ||
157 | extern void lcd_remote_mono_bitmap(const unsigned char *src, int x, int y, | ||
158 | int width, int height); | ||
159 | extern void lcd_remote_bitmap_transparent_part(const fb_remote_data *src, | ||
160 | int src_x, int src_y, | ||
161 | int stride, int x, int y, | ||
162 | int width, int height); | ||
163 | extern void lcd_bitmap_remote_transparent(const fb_remote_data *src, int x, | ||
164 | int y, int width, int height); | ||
165 | #else /* LCD_REMOTE_DEPTH == 1 */ | ||
98 | #define lcd_remote_mono_bitmap lcd_remote_bitmap | 166 | #define lcd_remote_mono_bitmap lcd_remote_bitmap |
99 | #define lcd_remote_mono_bitmap_part lcd_remote_bitmap_part | 167 | #define lcd_remote_mono_bitmap_part lcd_remote_bitmap_part |
168 | #endif /* LCD_REMOTE_DEPTH */ | ||
100 | 169 | ||
101 | #endif | 170 | #endif |
102 | #endif | 171 | #endif /* __LCD_REMOTE_H__ */ |