Chinaunix首页 | 论坛 | 博客
  • 博客访问: 89572
  • 博文数量: 19
  • 博客积分: 760
  • 博客等级: 军士长
  • 技术积分: 260
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-30 16:30
文章存档

2011年(1)

2009年(18)

我的朋友

分类: 嵌入式

2009-07-30 17:36:13

3)修改/board/Embest/edukit2410/Makefile文件

lcd.c加入编译。

LIB   = $(obj)lib$(BOARD).a

 

COBJS     := edukit2410.o nand_read.o lcd.o flash.o

SOBJS     := lowlevel_init.o

4)修改/lib_arm/board.c文件

......

#ifdef CONFIG_HAS_DATAFLASH

extern int  AT91F_DataflashInit(void);

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 */

}

4.1        驱动lcd,并显示图片

如果要进一步显示图片需要在第一步的基础上进行修改

1)修改include/configs/edukit2410.h文件

#define CONFIG_DRIVER_LCD

/*suport LCD*/

#define CONFIG_LCD_BMP

#endif    /* __CONFIG_H */

2)添加图片信息文件bmp.c

图片以数组的方式存储,数组名为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,

......

}

3)修改/board/Embest/edukit2410/Makefile文件

bmp.c加入编译。

 

LIB   = $(obj)lib$(BOARD).a

 

COBJS     := edukit2410.o nand_read.o lcd.o bmp.o flash.o

SOBJS     := lowlevel_init.o

4)修改/board/Embest/edukit2410/lcd.c,添加图片显示函数。

/*------------------------------------------------------------------------------------------*/

/*                                                            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");

}

5)修改/cpu/arm920t/start.S,以支持更大的uboot自我拷贝

......

 

@ copy U-Boot to RAM

   ldr r0, =TEXT_BASE

  mov r1, #0x0

 

#ifdef CONFIG_LCD_BMP

  mov r2, #0x100000

#else

  mov r2, #0x30000

#endif

......

 

阅读(1862) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~