summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/lcd.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index f095bbffa0..2d04cec054 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -34,10 +34,16 @@
34#include "file.h" /* for MAX_PATH; FIXME: Why does this not work for sims? */ 34#include "file.h" /* for MAX_PATH; FIXME: Why does this not work for sims? */
35#endif 35#endif
36 36
37#if LCD_DEPTH <=8
38typedef unsigned char fb_data;
39#elif LCD_DEPTH <= 16
40typedef unsigned short fb_data;
41#endif
42
37/* common functions */ 43/* common functions */
38extern void lcd_write_command(int byte); 44extern void lcd_write_command(int byte);
39extern void lcd_write_command_ex(int cmd, int data1, int data2); 45extern void lcd_write_command_ex(int cmd, int data1, int data2);
40extern void lcd_write_data(const unsigned char* p_bytes, int count); 46extern void lcd_write_data(const fb_data* p_bytes, int count);
41extern void lcd_init(void); 47extern void lcd_init(void);
42#ifdef SIMULATOR 48#ifdef SIMULATOR
43/* Define a dummy device specific init for the sims */ 49/* Define a dummy device specific init for the sims */
@@ -63,7 +69,7 @@ extern void lcd_icon(int icon, bool enable);
63 69
64#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP) 70#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP)
65/* performance function */ 71/* performance function */
66extern void lcd_blit(const unsigned char* data, int x, int by, int width, 72extern void lcd_blit(const fb_data* data, int x, int by, int width,
67 int bheight, int stride); 73 int bheight, int stride);
68 74
69extern void lcd_update(void); 75extern void lcd_update(void);
@@ -161,11 +167,11 @@ struct rgb {
161 167
162/* Memory copy of display bitmap */ 168/* Memory copy of display bitmap */
163#if LCD_DEPTH == 1 169#if LCD_DEPTH == 1
164extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; 170extern fb_data lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
165#elif LCD_DEPTH == 2 171#elif LCD_DEPTH == 2
166extern unsigned char lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; 172extern fb_data lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH];
167#elif LCD_DEPTH == 16 173#elif LCD_DEPTH == 16
168extern unsigned char lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH*2]; 174extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH];
169#endif 175#endif
170 176
171extern void lcd_set_invert_display(bool yesno); 177extern void lcd_set_invert_display(bool yesno);
@@ -190,9 +196,9 @@ extern void lcd_hline(int x1, int x2, int y);
190extern void lcd_vline(int x, int y1, int y2); 196extern void lcd_vline(int x, int y1, int y2);
191extern void lcd_drawrect(int x, int y, int width, int height); 197extern void lcd_drawrect(int x, int y, int width, int height);
192extern void lcd_fillrect(int x, int y, int width, int height); 198extern void lcd_fillrect(int x, int y, int width, int height);
193extern void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, 199extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
194 int stride, int x, int y, int width, int height); 200 int stride, int x, int y, int width, int height);
195extern void lcd_bitmap(const unsigned char *src, int x, int y, int width, 201extern void lcd_bitmap(const fb_data *src, int x, int y, int width,
196 int height); 202 int height);
197extern void lcd_putsxy(int x, int y, const unsigned char *string); 203extern void lcd_putsxy(int x, int y, const unsigned char *string);
198 204