#include <common.h>
#include <lcd.h>
#include <mpc5xxx.h>
+#include <malloc.h>
#ifdef CONFIG_LCD
#define PSOC_RETRIES 10 /* each of PSOC_WAIT_TIME */
#define PSOC_WAIT_TIME 10 /* usec */
+#include <video_font.h>
+#define FONT_WIDTH VIDEO_FONT_WIDTH
+
DECLARE_GLOBAL_DATA_PTR;
/*
LCD_WIDTH, LCD_HEIGHT, LCD_BPP
};
-int lcd_line_length;
-
-int lcd_color_fg;
-int lcd_color_bg;
-
-/*
- * Frame buffer memory information
- */
-void *lcd_base; /* Start of framebuffer memory */
-void *lcd_console_address; /* Start of console buffer */
-
-short console_col = 0;
-short console_row = 0;
/*
* The device we use to communicate with PSoC
*/
int serial_inited = 0;
-/*
- * Exported functions
- */
-void lcd_initcolregs (void);
-void lcd_ctrl_init (void *lcdbase);
-void lcd_enable (void);
-
/*
* Imported functions to support the PSoC protocol
*/
#if !defined(SWAPPED_LCD)
for (i=0; i<fb_size; i++) {
- serial_putc_raw_dev (PSOC_PSC, ((char *)lcd_base)[i]);
+ serial_putc_raw_dev(PSOC_PSC, ((char *)gd->fb_base)[i]);
}
#else
{
int x, y, pwidth;
- char *p = (char *)lcd_base;
+ char *p = (char *)gd->fb_base;
pwidth = ((panel_info.vl_col+7) >> 3);
for (y=0; y<panel_info.vl_row; y++) {
}
#ifdef CONFIG_PROGRESSBAR
-#define FONT_WIDTH 8 /* the same as VIDEO_FONT_WIDTH in video_font.h */
void show_progress (int size, int tot)
{
int cnt;
}
#endif
+
+int bmp_display(ulong addr, int x, int y)
+{
+ int ret;
+ bmp_image_t *bmp = (bmp_image_t *)addr;
+
+ if (!bmp) {
+ printf("There is no valid bmp file at the given address\n");
+ return 1;
+ }
+
+ ret = lcd_display_bitmap((ulong)bmp, x, y);
+
+ if ((unsigned long)bmp != addr)
+ free(bmp);
+
+ return ret;
+}
+
#endif /* CONFIG_LCD */