summaryrefslogtreecommitdiff
path: root/firmware/export/lcd-remote.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/lcd-remote.h')
-rw-r--r--firmware/export/lcd-remote.h109
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 @@
37extern int remote_type(void); 34extern 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)
43typedef unsigned short fb_remote_data;
44#else
45typedef unsigned char fb_remote_data;
46#endif
47#elif LCD_DEPTH <= 16
48typedef unsigned short fb_remote_data;
49#else
50typedef 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 */
58typedef void lcd_remote_pixelfunc_type(int x, int y);
59typedef 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
77extern 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
80extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH];
81#endif
82#endif
83
40extern void lcd_remote_init(void); 84extern void lcd_remote_init(void);
41extern int lcd_remote_default_contrast(void); 85extern int lcd_remote_default_contrast(void);
42extern void lcd_remote_set_contrast(int val); 86extern void lcd_remote_set_contrast(int val);
43extern void lcd_remote_emireduce(bool state); 87extern void lcd_remote_emireduce(bool state);
44 88
45extern void lcd_remote_clear_display(void); 89extern void lcd_remote_clear_display(void);
46extern void lcd_remote_puts(int x, int y, const unsigned char *string); 90extern void lcd_remote_puts(int x, int y, const unsigned char *str);
47extern void lcd_remote_puts_style(int x, int y, const unsigned char *string, 91extern void lcd_remote_puts_style(int x, int y, const unsigned char *str,
48 int style); 92 int style);
49extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset); 93extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str,
50extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset); 94 int offset);
95extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str,
96 int style, int offset);
51extern void lcd_remote_putc(int x, int y, unsigned short ch); 97extern void lcd_remote_putc(int x, int y, unsigned short ch);
52extern void lcd_remote_stop_scroll(void); 98extern void lcd_remote_stop_scroll(void);
53extern void lcd_remote_scroll_speed(int speed); 99extern void lcd_remote_scroll_speed(int speed);
54extern void lcd_remote_scroll_delay(int ms); 100extern void lcd_remote_scroll_delay(int ms);
55extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string); 101extern void lcd_remote_puts_scroll(int x, int y, const unsigned char *str);
56extern void lcd_remote_puts_scroll_style(int x, int y,const unsigned char* string, 102extern void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *str,
57 int style); 103 int style);
58extern void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, 104extern void lcd_remote_puts_scroll_offset(int x, int y,
59 int offset); 105 const unsigned char *str, int offset);
60extern void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string, 106extern 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
63extern void lcd_remote_update(void); 110extern void lcd_remote_update(void);
64extern void lcd_remote_update_rect(int x, int y, int width, int height); 111extern void lcd_remote_update_rect(int x, int y, int width, int height);
65 112
66/* Memory copy of display bitmap */
67extern unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH];
68
69extern void lcd_remote_set_invert_display(bool yesno); 113extern void lcd_remote_set_invert_display(bool yesno);
70extern void lcd_remote_set_flip(bool yesno); 114extern void lcd_remote_set_flip(bool yesno);
71extern void lcd_remote_roll(int pixels); 115extern void lcd_remote_roll(int pixels);
@@ -78,25 +122,50 @@ extern int lcd_remote_getymargin(void);
78extern void lcd_remote_setfont(int font); 122extern void lcd_remote_setfont(int font);
79extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); 123extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h);
80 124
125/* low level drawing function pointer arrays */
126extern lcd_remote_pixelfunc_type* const lcd_remote_pixelfuncs[8];
127extern lcd_remote_blockfunc_type* const lcd_remote_blockfuncs[8];
128
81extern void lcd_remote_drawpixel(int x, int y); 129extern void lcd_remote_drawpixel(int x, int y);
82extern void lcd_remote_drawline(int x1, int y1, int x2, int y2); 130extern void lcd_remote_drawline(int x1, int y1, int x2, int y2);
83extern void lcd_remote_hline(int x1, int x2, int y); 131extern void lcd_remote_hline(int x1, int x2, int y);
84extern void lcd_remote_vline(int x, int y1, int y2); 132extern void lcd_remote_vline(int x, int y1, int y2);
85extern void lcd_remote_drawrect(int x, int y, int width, int height); 133extern void lcd_remote_drawrect(int x, int y, int width, int height);
86extern void lcd_remote_fillrect(int x, int y, int width, int height); 134extern void lcd_remote_fillrect(int x, int y, int width, int height);
87extern void lcd_remote_bitmap_part(const unsigned char *src, int src_x, 135extern 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);
90extern void lcd_remote_bitmap(const unsigned char *src, int x, int y, 138extern void lcd_remote_bitmap(const fb_remote_data *src, int x, int y,
91 int width, int height); 139 int width, int height);
92extern void lcd_remote_putsxy(int x, int y, const unsigned char *string); 140extern void lcd_remote_putsxy(int x, int y, const unsigned char *str);
93 141
94extern void lcd_remote_invertscroll(int x, int y); 142extern void lcd_remote_invertscroll(int x, int y);
95extern void lcd_remote_bidir_scroll(int threshold); 143extern void lcd_remote_bidir_scroll(int threshold);
96extern void lcd_remote_scroll_step(int pixels); 144extern void lcd_remote_scroll_step(int pixels);
97 145
146#if LCD_REMOTE_DEPTH > 1
147extern void lcd_remote_set_foreground(unsigned foreground);
148extern unsigned lcd_remote_get_foreground(void);
149extern void lcd_remote_set_background(unsigned background);
150extern unsigned lcd_remote_get_background(void);
151extern void lcd_remote_set_drawinfo(int mode, unsigned foreground,
152 unsigned background);
153
154extern 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);
157extern void lcd_remote_mono_bitmap(const unsigned char *src, int x, int y,
158 int width, int height);
159extern 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);
163extern 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__ */