2002-03-28 15:09:10 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 by Alan Korr
|
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __LCD_H__
|
|
|
|
#define __LCD_H__
|
|
|
|
|
2002-05-13 12:29:34 +00:00
|
|
|
#include <stdbool.h>
|
2004-10-26 05:40:24 +00:00
|
|
|
#include "cpu.h"
|
2002-04-18 17:42:42 +00:00
|
|
|
#include "config.h"
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2003-04-16 00:12:31 +00:00
|
|
|
#define STYLE_DEFAULT 0
|
|
|
|
#define STYLE_INVERT 1
|
|
|
|
|
2005-02-22 12:19:12 +00:00
|
|
|
#ifdef SIMULATOR
|
|
|
|
#define lcd_icon(x,y) sim_lcd_icon(x,y)
|
|
|
|
#endif
|
|
|
|
|
2002-04-25 15:09:03 +00:00
|
|
|
/* common functions */
|
|
|
|
extern void lcd_init(void);
|
|
|
|
extern void lcd_clear_display(void);
|
|
|
|
extern void lcd_backlight(bool on);
|
2004-08-01 21:50:57 +00:00
|
|
|
extern void lcd_puts(int x, int y, const unsigned char *string);
|
|
|
|
extern void lcd_puts_style(int x, int y, const unsigned char *string, int style);
|
2003-01-10 09:58:04 +00:00
|
|
|
extern void lcd_putc(int x, int y, unsigned short ch);
|
2003-01-23 14:24:52 +00:00
|
|
|
|
2004-08-16 23:37:23 +00:00
|
|
|
extern void lcd_puts_scroll(int x, int y, const unsigned char* string );
|
|
|
|
extern void lcd_puts_scroll_style(int x, int y, const unsigned char* string,
|
2003-04-16 00:12:31 +00:00
|
|
|
int style);
|
2002-07-22 22:37:03 +00:00
|
|
|
extern void lcd_icon(int icon, bool enable);
|
2002-06-10 12:36:54 +00:00
|
|
|
extern void lcd_stop_scroll(void);
|
|
|
|
extern void lcd_scroll_speed( int speed );
|
2002-12-12 15:20:37 +00:00
|
|
|
extern void lcd_scroll_delay( int ms );
|
2002-08-13 11:10:11 +00:00
|
|
|
extern void lcd_set_contrast(int val);
|
2004-04-21 09:39:29 +00:00
|
|
|
extern void lcd_write_command( int byte );
|
2005-01-27 00:00:05 +00:00
|
|
|
extern void lcd_write_command_ex( int cmd, int data1, int data2);
|
2004-08-17 01:45:48 +00:00
|
|
|
extern void lcd_write_data( const unsigned char* p_bytes, int count );
|
2003-07-09 23:07:49 +00:00
|
|
|
extern int lcd_default_contrast(void);
|
2002-05-21 08:50:46 +00:00
|
|
|
|
2002-05-24 09:03:08 +00:00
|
|
|
#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP)
|
2002-08-09 12:20:54 +00:00
|
|
|
extern void lcd_update(void);
|
2003-12-12 22:11:08 +00:00
|
|
|
/* performance function */
|
2004-08-17 01:45:48 +00:00
|
|
|
extern void lcd_blit (const unsigned char* p_data, int x, int y, int width,
|
|
|
|
int height, int stride);
|
2002-08-09 12:20:54 +00:00
|
|
|
|
|
|
|
/* update a fraction of the screen */
|
|
|
|
extern void lcd_update_rect(int x, int y, int width, int height);
|
2002-05-21 08:50:46 +00:00
|
|
|
#else
|
|
|
|
#define lcd_update()
|
2002-09-10 08:42:03 +00:00
|
|
|
#define lcd_update_rect(x,y,w,h)
|
2002-05-21 08:50:46 +00:00
|
|
|
#endif
|
2002-04-25 15:09:03 +00:00
|
|
|
|
2002-04-11 12:35:54 +00:00
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2002-07-22 22:37:03 +00:00
|
|
|
|
|
|
|
/* Icon definitions for lcd_icon() */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ICON_BATTERY = 0,
|
|
|
|
ICON_BATTERY_1,
|
|
|
|
ICON_BATTERY_2,
|
|
|
|
ICON_BATTERY_3,
|
|
|
|
ICON_USB,
|
|
|
|
ICON_PLAY,
|
|
|
|
ICON_RECORD,
|
|
|
|
ICON_PAUSE,
|
|
|
|
ICON_AUDIO,
|
|
|
|
ICON_REPEAT,
|
|
|
|
ICON_1,
|
|
|
|
ICON_VOLUME,
|
|
|
|
ICON_VOLUME_1,
|
|
|
|
ICON_VOLUME_2,
|
|
|
|
ICON_VOLUME_3,
|
|
|
|
ICON_VOLUME_4,
|
|
|
|
ICON_VOLUME_5,
|
|
|
|
ICON_PARAM
|
|
|
|
};
|
2002-04-11 12:35:54 +00:00
|
|
|
|
2004-08-17 01:45:48 +00:00
|
|
|
extern void lcd_define_hw_pattern (int which,const char *pattern,int length);
|
|
|
|
extern void lcd_define_pattern (int which,const char *pattern);
|
2002-05-26 20:54:52 +00:00
|
|
|
extern void lcd_double_height (bool on);
|
2003-05-27 12:54:11 +00:00
|
|
|
#define JUMP_SCROLL_ALWAYS 5
|
|
|
|
extern void lcd_jump_scroll (int mode); /* 0=off, 1=once, ..., ALWAYS */
|
|
|
|
extern void lcd_jump_scroll_delay( int ms );
|
2003-01-10 10:12:17 +00:00
|
|
|
unsigned char lcd_get_locked_pattern(void);
|
2003-01-10 09:58:04 +00:00
|
|
|
void lcd_unlock_pattern(unsigned char pat);
|
2003-01-10 13:30:08 +00:00
|
|
|
void lcd_allow_bidirectional_scrolling(bool on);
|
2003-01-14 10:45:57 +00:00
|
|
|
extern void lcd_bidir_scroll(int threshold);
|
2003-01-27 14:37:03 +00:00
|
|
|
void lcd_put_cursor(int x, int y, char cursor_char);
|
2003-01-29 11:48:35 +00:00
|
|
|
void lcd_remove_cursor(void);
|
2002-05-04 12:19:36 +00:00
|
|
|
#endif
|
2002-10-17 18:44:02 +00:00
|
|
|
|
2002-05-04 12:19:36 +00:00
|
|
|
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
|
2002-10-21 20:21:43 +00:00
|
|
|
#if defined(HAVE_LCD_CHARCELLS) && defined(SIMULATOR)
|
2002-10-17 18:44:02 +00:00
|
|
|
#endif
|
2002-04-25 13:45:23 +00:00
|
|
|
|
2003-12-23 23:41:45 +00:00
|
|
|
#define DRAW_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] |= (1<<((y)&7))
|
|
|
|
#define CLEAR_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] &= ~(1<<((y)&7))
|
|
|
|
#define INVERT_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] ^= (1<<((y)&7))
|
2002-08-07 10:35:26 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Memory copy of display bitmap
|
|
|
|
*/
|
2003-12-23 23:41:45 +00:00
|
|
|
extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
|
2002-08-01 13:29:30 +00:00
|
|
|
|
2002-05-10 14:54:56 +00:00
|
|
|
extern void lcd_setmargins(int xmargin, int ymargin);
|
2002-08-20 19:33:55 +00:00
|
|
|
extern int lcd_getxmargin(void);
|
|
|
|
extern int lcd_getymargin(void);
|
2004-07-19 21:46:37 +00:00
|
|
|
extern void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny,
|
2002-04-25 13:45:23 +00:00
|
|
|
bool clear);
|
|
|
|
extern void lcd_clearrect (int x, int y, int nx, int ny);
|
|
|
|
extern void lcd_fillrect (int x, int y, int nx, int ny);
|
2002-05-03 06:23:30 +00:00
|
|
|
extern void lcd_drawrect (int x, int y, int nx, int ny);
|
2002-04-25 13:45:23 +00:00
|
|
|
extern void lcd_invertrect (int x, int y, int nx, int ny);
|
2003-12-10 00:11:25 +00:00
|
|
|
extern void lcd_invertscroll(int x, int y);
|
2002-04-25 13:45:23 +00:00
|
|
|
extern void lcd_drawline( int x1, int y1, int x2, int y2 );
|
2002-07-16 11:21:59 +00:00
|
|
|
extern void lcd_clearline( int x1, int y1, int x2, int y2 );
|
2002-04-25 13:45:23 +00:00
|
|
|
extern void lcd_drawpixel(int x, int y);
|
|
|
|
extern void lcd_clearpixel(int x, int y);
|
2002-08-28 14:21:25 +00:00
|
|
|
extern void lcd_invertpixel(int x, int y);
|
2002-09-19 10:28:10 +00:00
|
|
|
extern void lcd_roll(int pixels);
|
2003-02-27 14:22:30 +00:00
|
|
|
extern void lcd_set_invert_display(bool yesno);
|
2003-12-12 22:11:08 +00:00
|
|
|
extern void lcd_set_flip(bool yesno);
|
2002-12-12 15:20:37 +00:00
|
|
|
extern void lcd_bidir_scroll(int threshold);
|
|
|
|
extern void lcd_scroll_step(int pixels);
|
2002-09-20 08:07:51 +00:00
|
|
|
extern void lcd_setfont(int font);
|
2004-07-19 21:46:37 +00:00
|
|
|
extern void lcd_putsxy(int x, int y, const unsigned char *string);
|
2004-08-01 21:50:57 +00:00
|
|
|
extern int lcd_getstringsize(const unsigned char *str, int *w, int *h);
|
2002-09-20 08:07:51 +00:00
|
|
|
|
2002-04-25 13:45:23 +00:00
|
|
|
#endif /* CHARCELLS / BITMAP */
|
2002-04-11 12:45:06 +00:00
|
|
|
|
2002-04-18 17:42:42 +00:00
|
|
|
#endif /* __LCD_H__ */
|