1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Alan Korr
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
27 #define STYLE_DEFAULT 0
28 #define STYLE_INVERT 1
30 /* common functions */
31 extern void lcd_init(void);
32 extern void lcd_clear_display(void);
33 extern void lcd_backlight(bool on
);
34 extern void lcd_puts(int x
, int y
, const unsigned char *string
);
35 extern void lcd_puts_style(int x
, int y
, const unsigned char *string
, int style
);
36 extern void lcd_putc(int x
, int y
, unsigned short ch
);
38 extern void lcd_puts_scroll(int x
, int y
, const unsigned char* string
);
39 extern void lcd_puts_scroll_style(int x
, int y
, const unsigned char* string
,
41 extern void lcd_icon(int icon
, bool enable
);
42 extern void lcd_stop_scroll(void);
43 extern void lcd_scroll_speed( int speed
);
44 extern void lcd_scroll_delay( int ms
);
45 extern void lcd_set_contrast(int val
);
46 extern void lcd_write_command( int byte
);
47 extern void lcd_write_data( const unsigned char* p_bytes
, int count
);
48 extern int lcd_default_contrast(void);
50 #if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP)
51 extern void lcd_update(void);
52 /* performance function */
53 extern void lcd_blit (const unsigned char* p_data
, int x
, int y
, int width
,
54 int height
, int stride
);
56 /* update a fraction of the screen */
57 extern void lcd_update_rect(int x
, int y
, int width
, int height
);
60 #define lcd_update_rect(x,y,w,h)
63 #if defined(SIMULATOR)
64 #include "sim_icons.h"
67 #ifdef HAVE_LCD_CHARCELLS
69 /* Icon definitions for lcd_icon() */
92 extern void lcd_define_hw_pattern (int which
,const char *pattern
,int length
);
93 extern void lcd_define_pattern (int which
,const char *pattern
);
94 extern void lcd_double_height (bool on
);
95 #define JUMP_SCROLL_ALWAYS 5
96 extern void lcd_jump_scroll (int mode
); /* 0=off, 1=once, ..., ALWAYS */
97 extern void lcd_jump_scroll_delay( int ms
);
98 unsigned char lcd_get_locked_pattern(void);
99 void lcd_unlock_pattern(unsigned char pat
);
100 void lcd_allow_bidirectional_scrolling(bool on
);
101 extern void lcd_bidir_scroll(int threshold
);
102 void lcd_put_cursor(int x
, int y
, char cursor_char
);
103 void lcd_remove_cursor(void);
106 #if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
107 #if defined(HAVE_LCD_CHARCELLS) && defined(SIMULATOR)
110 #define DRAW_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] |= (1<<((y)&7))
111 #define CLEAR_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] &= ~(1<<((y)&7))
112 #define INVERT_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] ^= (1<<((y)&7))
115 * Memory copy of display bitmap
117 extern unsigned char lcd_framebuffer
[LCD_HEIGHT
/8][LCD_WIDTH
];
119 extern void lcd_setmargins(int xmargin
, int ymargin
);
120 extern int lcd_getxmargin(void);
121 extern int lcd_getymargin(void);
122 extern void lcd_bitmap (const unsigned char *src
, int x
, int y
, int nx
, int ny
,
124 extern void lcd_clearrect (int x
, int y
, int nx
, int ny
);
125 extern void lcd_fillrect (int x
, int y
, int nx
, int ny
);
126 extern void lcd_drawrect (int x
, int y
, int nx
, int ny
);
127 extern void lcd_invertrect (int x
, int y
, int nx
, int ny
);
128 extern void lcd_invertscroll(int x
, int y
);
129 extern void lcd_drawline( int x1
, int y1
, int x2
, int y2
);
130 extern void lcd_clearline( int x1
, int y1
, int x2
, int y2
);
131 extern void lcd_drawpixel(int x
, int y
);
132 extern void lcd_clearpixel(int x
, int y
);
133 extern void lcd_invertpixel(int x
, int y
);
134 extern void lcd_roll(int pixels
);
135 extern void lcd_set_invert_display(bool yesno
);
136 extern void lcd_set_flip(bool yesno
);
137 extern void lcd_bidir_scroll(int threshold
);
138 extern void lcd_scroll_step(int pixels
);
139 extern void lcd_setfont(int font
);
140 extern void lcd_putsxy(int x
, int y
, const unsigned char *string
);
141 extern int lcd_getstringsize(const unsigned char *str
, int *w
, int *h
);
143 #endif /* CHARCELLS / BITMAP */
145 #endif /* __LCD_H__ */