分类: 嵌入式
2009-07-30 17:36:13
将lcd.c加入编译。
LIB = $(obj)lib$(BOARD).a
COBJS := edukit2410.o nand_read.o lcd.o flash.o
SOBJS := lowlevel_init.o
......
#ifdef CONFIG_HAS_DATAFLASH
extern int AT
extern void dataflash_print_info(void);
#endif
#ifdef CONFIG_DRIVER_LCD
extern void color_lcd_init(void);
#endif
#ifndef CONFIG_IDENT_STRING
#define CONFIG_IDENT_STRING ""
#endif
......
#if defined(CONFIG_DRIVER_LCD)
color_lcd_init();
#endif
/* main_loop() can return to retry autoboot, if so just run it again. */
for (;;) {
main_loop ();
}
/* NOTREACHED - no way out of command loop except booting */
}
如果要进一步显示图片需要在第一步的基础上进行修改。
#define CONFIG_DRIVER_LCD
/*suport LCD*/
#define CONFIG_LCD_BMP
#endif /* __CONFIG_H */
图片以数组的方式存储,数组名为g_ucBitmap[],大小自己定义,但要少于800K。
/********************************************************************
* File�� bmp_data.c
* Author: Embest
* Desc�� bmp data
* History:
********************************************************************/
/*------------------------------------------------------------------------------------------*/
/* global variables */
/*------------------------------------------------------------------------------------------*/
const unsigned char g_ucBitmap[614408] = { 0X00,0X10,0X80,0X02,0XE0,0X01,0X01,0X1B,
0X04,0X08,0X04,0X08,0X04,0X08,0X04,0X08,0X04,0X08,0X04,0X08,0X04,0X08,0X05,0X08,
0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X04,0X08,0X04,0X08,0X04,0X08,
0X04,0X08,0X04,0X08,0X04,0X08,0X04,0X08,0X04,0X08,0X04,0X08,0X04,0X08,0X04,0X08,
0X04,0X08,0X04,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,
0X04,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X04,0X08,0X05,0X08,0X05,0X08,
0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,
0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X05,0X08,0X25,0X08,0X25,0X08,0X25,0X08,
......
}
将bmp.c加入编译。
LIB = $(obj)lib$(BOARD).a
COBJS := edukit2410.o nand_read.o lcd.o bmp.o flash.o
SOBJS := lowlevel_init.o
/*------------------------------------------------------------------------------------------*/
/* extern variables */
/*------------------------------------------------------------------------------------------*/
extern const UINT8T g_ucBitmap[][76800];
......
void lcd_clr_rect(INT16T usLeft, INT16T usTop, INT16T usRight, INT16T usBottom, UINT8T ucColor)
{
UINT32T i, j;
// UINT8T *pDisp = (UINT8T*)LCD_ACTIVE_BUFFER;
for (i = usLeft; i < usRight; i++)
for (j = usTop; j < usBottom; j++)
{
PutPixel(i,j,ucColor);
//*(pDisp+i+j) = ucColor;
}
}
void BitmapViewTft16Bit_640480(UINT8T *pBuffer)
{
UINT32T i, j,t=0;
UINT32T *pView = (UINT32T*)frameBuffer16BitTft640480;
for (i = 0; i < LCD_YSIZE_TFT_640480; i++)
{
for (j = 0; j < LCD_XSIZE_TFT_640480/2 ; j++)
{
pView[j] = ((*(pBuffer+3)) << 24) + ((*(pBuffer+2)) << 16) + ((*(pBuffer+1)) << 8) + (*(pBuffer));
//pView[j] = 0x88888888;
pBuffer += 4;
}
pView+=LCD_XSIZE_TFT_640480;
}
}
......
/********************************************************************
* name: color_lcd_init()
* func: LCD test function
* para: none
* ret: none
* modify:
* comment:
********************************************************************/
void color_lcd_init(void)
{
printf("lcd initial start\n");
lcd_init_app();
lcd_clean(0x66665555);
BitmapViewTft16Bit_640480((UINT8T *)(g_ucBitmap));
printf("lcd initial end\n");
}
......
@ copy U-Boot to RAM
ldr r0, =TEXT_BASE
mov r1, #0x0
#ifdef CONFIG_LCD_BMP
mov r2, #0x100000
#else
mov r2, #0x30000
#endif
......