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>
|
2002-04-11 12:35:54 +00:00
|
|
|
#include "sh7034.h"
|
2002-04-18 17:42:42 +00:00
|
|
|
#include "config.h"
|
2002-03-28 15:09:10 +00:00
|
|
|
|
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);
|
2002-06-24 07:57:44 +00:00
|
|
|
extern void lcd_puts(int x, int y, unsigned char *string);
|
2002-08-09 19:17:14 +00:00
|
|
|
extern void lcd_scroll_pause(void);
|
|
|
|
extern void lcd_scroll_resume(void);
|
2002-06-24 07:57:44 +00:00
|
|
|
extern void lcd_puts_scroll(int x, int y, unsigned char* string );
|
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-08-13 11:10:11 +00:00
|
|
|
extern void lcd_set_contrast(int val);
|
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);
|
|
|
|
|
|
|
|
/* 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()
|
|
|
|
#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
|
|
|
|
2002-04-25 15:09:03 +00:00
|
|
|
extern void lcd_define_pattern (int which,char *pattern,int length);
|
2002-05-26 20:54:52 +00:00
|
|
|
extern void lcd_double_height (bool on);
|
2002-04-25 13:45:23 +00:00
|
|
|
|
2002-05-04 12:19:36 +00:00
|
|
|
#endif
|
|
|
|
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
|
|
|
|
|
2002-08-12 22:41:55 +00:00
|
|
|
#if !defined(HAVE_LCD_BITMAP) && defined(SIMULATOR)
|
2002-08-12 22:14:35 +00:00
|
|
|
#define LCD_WIDTH 16*11 /* Display width in pixels */
|
|
|
|
#else
|
2002-04-25 13:45:23 +00:00
|
|
|
#define LCD_WIDTH 112 /* Display width in pixels */
|
2002-08-12 22:14:35 +00:00
|
|
|
#endif
|
2002-04-25 13:45:23 +00:00
|
|
|
#define LCD_HEIGHT 64 /* Display height in pixels */
|
|
|
|
|
2002-08-12 08:47:09 +00:00
|
|
|
#define DRAW_PIXEL(x,y) lcd_framebuffer[(x)][(y)/8] |= (1<<((y)&7))
|
|
|
|
#define CLEAR_PIXEL(x,y) lcd_framebuffer[(x)][(y)/8] &= ~(1<<((y)&7))
|
|
|
|
#define INVERT_PIXEL(x,y) lcd_framebuffer[(x)][(y)/8] ^= (1<<((y)&7))
|
2002-08-07 10:35:26 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Memory copy of display bitmap
|
|
|
|
*/
|
|
|
|
extern unsigned char lcd_framebuffer[LCD_WIDTH][LCD_HEIGHT/8] __attribute__ ((section (".idata")));
|
2002-08-01 13:29:30 +00:00
|
|
|
|
2002-06-24 07:57:44 +00:00
|
|
|
extern void lcd_putsxy(int x, int y, unsigned char *string, int font);
|
2002-05-10 14:54:56 +00:00
|
|
|
extern void lcd_setfont(int font);
|
2002-05-30 06:55:48 +00:00
|
|
|
extern void lcd_getfontsize(unsigned int font, int *width, int *height);
|
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);
|
2002-04-25 13:45:23 +00:00
|
|
|
extern void lcd_bitmap (unsigned char *src, int x, int y, int nx, int ny,
|
|
|
|
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);
|
|
|
|
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);
|
|
|
|
|
|
|
|
#endif /* CHARCELLS / BITMAP */
|
2002-04-11 12:45:06 +00:00
|
|
|
|
2002-08-11 09:17:47 +00:00
|
|
|
#ifdef LOADABLE_FONTS
|
|
|
|
extern int lcd_init_fonts(void);
|
|
|
|
extern void lcd_putsldfxy(int x, int y, unsigned char *str);
|
|
|
|
extern int lcd_getstringsize(unsigned char *str,
|
|
|
|
unsigned char* font,
|
|
|
|
int *w, int *h);
|
|
|
|
extern void lcd_setldfont(unsigned char* f);
|
|
|
|
|
|
|
|
extern unsigned char* lcd_getcurrentldfont(void);
|
|
|
|
#endif
|
|
|
|
|
2002-08-15 06:36:25 +00:00
|
|
|
#ifdef LCD_PROPFONTS
|
|
|
|
extern int lcd_getstringsize(unsigned char *str, unsigned int font, int *w, int *h);
|
|
|
|
#endif
|
|
|
|
|
2002-04-18 17:42:42 +00:00
|
|
|
#endif /* __LCD_H__ */
|