diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/lcd-remote.h | 7 | ||||
-rw-r--r-- | firmware/export/lcd.h | 28 | ||||
-rw-r--r-- | firmware/export/scroll_engine.h | 14 |
3 files changed, 47 insertions, 2 deletions
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index 3be23747ea..34c40e52c1 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "cpu.h" | 24 | #include "cpu.h" |
25 | #include "config.h" | 25 | #include "config.h" |
26 | #include "adc.h" | 26 | #include "adc.h" |
27 | #include "lcd.h" | ||
27 | 28 | ||
28 | #ifdef HAVE_REMOTE_LCD | 29 | #ifdef HAVE_REMOTE_LCD |
29 | 30 | ||
@@ -109,7 +110,9 @@ extern void lcd_remote_init(void); | |||
109 | extern int lcd_remote_default_contrast(void); | 110 | extern int lcd_remote_default_contrast(void); |
110 | extern void lcd_remote_set_contrast(int val); | 111 | extern void lcd_remote_set_contrast(int val); |
111 | 112 | ||
113 | extern void lcd_remote_set_viewport(struct viewport* vp); | ||
112 | extern void lcd_remote_clear_display(void); | 114 | extern void lcd_remote_clear_display(void); |
115 | extern void lcd_remote_clear_viewport(void); | ||
113 | extern void lcd_remote_puts(int x, int y, const unsigned char *str); | 116 | extern void lcd_remote_puts(int x, int y, const unsigned char *str); |
114 | extern void lcd_remote_puts_style(int x, int y, const unsigned char *str, | 117 | extern void lcd_remote_puts_style(int x, int y, const unsigned char *str, |
115 | int style); | 118 | int style); |
@@ -132,6 +135,8 @@ extern void lcd_remote_puts_scroll_style_offset(int x, int y, | |||
132 | 135 | ||
133 | extern void lcd_remote_update(void); | 136 | extern void lcd_remote_update(void); |
134 | extern void lcd_remote_update_rect(int x, int y, int width, int height); | 137 | extern void lcd_remote_update_rect(int x, int y, int width, int height); |
138 | extern void lcd_remote_update_viewport(void); | ||
139 | extern void lcd_remote_update_viewport_rect(int x, int y, int width, int height); | ||
135 | 140 | ||
136 | extern void lcd_remote_set_invert_display(bool yesno); | 141 | extern void lcd_remote_set_invert_display(bool yesno); |
137 | extern void lcd_remote_set_flip(bool yesno); | 142 | extern void lcd_remote_set_flip(bool yesno); |
@@ -141,6 +146,8 @@ extern int lcd_remote_get_drawmode(void); | |||
141 | extern void lcd_remote_setmargins(int xmargin, int ymargin); | 146 | extern void lcd_remote_setmargins(int xmargin, int ymargin); |
142 | extern int lcd_remote_getxmargin(void); | 147 | extern int lcd_remote_getxmargin(void); |
143 | extern int lcd_remote_getymargin(void); | 148 | extern int lcd_remote_getymargin(void); |
149 | extern int lcd_remote_getwidth(void); | ||
150 | extern int lcd_remote_getheight(void); | ||
144 | extern void lcd_remote_setfont(int font); | 151 | extern void lcd_remote_setfont(int font); |
145 | extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); | 152 | extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); |
146 | 153 | ||
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 60d9efaf92..276dcdfedc 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -24,6 +24,28 @@ | |||
24 | #include "cpu.h" | 24 | #include "cpu.h" |
25 | #include "config.h" | 25 | #include "config.h" |
26 | 26 | ||
27 | struct viewport { | ||
28 | int x; | ||
29 | int y; | ||
30 | int width; | ||
31 | int height; | ||
32 | #ifdef HAVE_LCD_BITMAP | ||
33 | int font; | ||
34 | int drawmode; | ||
35 | #endif | ||
36 | int xmargin; /* During the transition only - to be removed */ | ||
37 | int ymargin; /* During the transition only - to be removed */ | ||
38 | #if LCD_DEPTH > 1 | ||
39 | unsigned fg_pattern; | ||
40 | unsigned bg_pattern; | ||
41 | #ifdef HAVE_LCD_COLOR | ||
42 | unsigned lss_pattern; | ||
43 | unsigned lse_pattern; | ||
44 | unsigned lst_pattern; | ||
45 | #endif | ||
46 | #endif | ||
47 | }; | ||
48 | |||
27 | #define STYLE_DEFAULT 0x00000000 | 49 | #define STYLE_DEFAULT 0x00000000 |
28 | #define STYLE_COLORED 0x10000000 | 50 | #define STYLE_COLORED 0x10000000 |
29 | #define STYLE_INVERT 0x20000000 | 51 | #define STYLE_INVERT 0x20000000 |
@@ -76,9 +98,14 @@ extern void lcd_set_contrast(int val); | |||
76 | extern void lcd_setmargins(int xmargin, int ymargin); | 98 | extern void lcd_setmargins(int xmargin, int ymargin); |
77 | extern int lcd_getxmargin(void); | 99 | extern int lcd_getxmargin(void); |
78 | extern int lcd_getymargin(void); | 100 | extern int lcd_getymargin(void); |
101 | extern int lcd_getwidth(void); | ||
102 | extern int lcd_getheight(void); | ||
79 | extern int lcd_getstringsize(const unsigned char *str, int *w, int *h); | 103 | extern int lcd_getstringsize(const unsigned char *str, int *w, int *h); |
80 | 104 | ||
105 | extern void lcd_set_viewport(struct viewport* vp); | ||
81 | extern void lcd_update(void); | 106 | extern void lcd_update(void); |
107 | extern void lcd_update_viewport(void); | ||
108 | extern void lcd_clear_viewport(void); | ||
82 | extern void lcd_clear_display(void); | 109 | extern void lcd_clear_display(void); |
83 | extern void lcd_putsxy(int x, int y, const unsigned char *string); | 110 | extern void lcd_putsxy(int x, int y, const unsigned char *string); |
84 | extern void lcd_puts(int x, int y, const unsigned char *string); | 111 | extern void lcd_puts(int x, int y, const unsigned char *string); |
@@ -119,6 +146,7 @@ extern void lcd_blit(const fb_data* data, int x, int by, int width, | |||
119 | 146 | ||
120 | /* update a fraction of the screen */ | 147 | /* update a fraction of the screen */ |
121 | extern void lcd_update_rect(int x, int y, int width, int height); | 148 | extern void lcd_update_rect(int x, int y, int width, int height); |
149 | extern void lcd_update_viewport_rect(int x, int y, int width, int height); | ||
122 | 150 | ||
123 | #ifdef HAVE_REMOTE_LCD | 151 | #ifdef HAVE_REMOTE_LCD |
124 | extern void lcd_remote_update(void); | 152 | extern void lcd_remote_update(void); |
diff --git a/firmware/export/scroll_engine.h b/firmware/export/scroll_engine.h index 5e39990129..48d5c5cb8c 100644 --- a/firmware/export/scroll_engine.h +++ b/firmware/export/scroll_engine.h | |||
@@ -23,9 +23,17 @@ | |||
23 | #ifndef __SCROLL_ENGINE_H__ | 23 | #ifndef __SCROLL_ENGINE_H__ |
24 | #define __SCROLL_ENGINE_H__ | 24 | #define __SCROLL_ENGINE_H__ |
25 | 25 | ||
26 | #include <lcd.h> | ||
27 | |||
26 | void scroll_init(void); | 28 | void scroll_init(void); |
29 | void lcd_scroll_stop(struct viewport* vp); | ||
30 | void lcd_scroll_stop_line(struct viewport* vp, int y); | ||
27 | void lcd_scroll_fn(void); | 31 | void lcd_scroll_fn(void); |
32 | #ifdef HAVE_REMOTE_LCD | ||
28 | void lcd_remote_scroll_fn(void); | 33 | void lcd_remote_scroll_fn(void); |
34 | void lcd_remote_scroll_stop(struct viewport* vp); | ||
35 | void lcd_remote_scroll_stop_line(struct viewport* vp, int y); | ||
36 | #endif | ||
29 | 37 | ||
30 | /* internal usage, but in multiple drivers */ | 38 | /* internal usage, but in multiple drivers */ |
31 | #define SCROLL_SPACING 3 | 39 | #define SCROLL_SPACING 3 |
@@ -37,8 +45,10 @@ void lcd_remote_scroll_fn(void); | |||
37 | 45 | ||
38 | struct scrollinfo | 46 | struct scrollinfo |
39 | { | 47 | { |
48 | struct viewport* vp; | ||
40 | char line[SCROLL_LINE_SIZE]; | 49 | char line[SCROLL_LINE_SIZE]; |
41 | int len; /* length of line in chars */ | 50 | int len; /* length of line in chars */ |
51 | int y; /* Position of the line on the screen (char co-ordinates) */ | ||
42 | int offset; | 52 | int offset; |
43 | int startx; | 53 | int startx; |
44 | #ifdef HAVE_LCD_BITMAP | 54 | #ifdef HAVE_LCD_BITMAP |
@@ -54,7 +64,7 @@ struct scroll_screen_info | |||
54 | { | 64 | { |
55 | struct scrollinfo * const scroll; | 65 | struct scrollinfo * const scroll; |
56 | const int num_scroll; /* number of scrollable lines (also number of scroll structs) */ | 66 | const int num_scroll; /* number of scrollable lines (also number of scroll structs) */ |
57 | int lines; /* Bitpattern of which lines are scrolling */ | 67 | int lines; /* Number of currently scrolling lines */ |
58 | long ticks; /* # of ticks between updates*/ | 68 | long ticks; /* # of ticks between updates*/ |
59 | long delay; /* ticks delay before start */ | 69 | long delay; /* ticks delay before start */ |
60 | int bidir_limit; /* percent */ | 70 | int bidir_limit; /* percent */ |
@@ -74,7 +84,7 @@ struct scroll_screen_info | |||
74 | #ifdef HAVE_LCD_BITMAP | 84 | #ifdef HAVE_LCD_BITMAP |
75 | #define LCD_SCROLLABLE_LINES ((LCD_HEIGHT+4)/5 < 32 ? (LCD_HEIGHT+4)/5 : 32) | 85 | #define LCD_SCROLLABLE_LINES ((LCD_HEIGHT+4)/5 < 32 ? (LCD_HEIGHT+4)/5 : 32) |
76 | #else | 86 | #else |
77 | #define LCD_SCROLLABLE_LINES LCD_HEIGHT | 87 | #define LCD_SCROLLABLE_LINES LCD_HEIGHT * 2 |
78 | #endif | 88 | #endif |
79 | 89 | ||
80 | extern struct scroll_screen_info lcd_scroll_info; | 90 | extern struct scroll_screen_info lcd_scroll_info; |