找回密码
 注册
搜索
查看: 507|回复: 1

[资料] LCD驱动问题,求大侠帮忙

[复制链接]
发表于 2010-11-10 18:10:32 | 显示全部楼层 |阅读模式
我这边 MT6253平台  调屏出问题了,出白屏,求大侠帮忙
下面是屏的4个函数
void ILI9327Initial(void)
{
// VCI=2.8V
//************* Reset LCD Driver ****************//

//************* Start Initial Sequence **********//

          int i,j;

         kal_prompt_trace(MOD_MED,"lcd_id found ILI9327_CMO26_Initial",lcd_id);

        GPRICE1("#######LCD_Init_Custom:lcd_id=%x#########\n\r", lcd_id);
       
         LCD_CtrlWrite_CUSTOM(0xE9);
         LCD_DataWrite_CUSTOM(0x20);
         LCD_CtrlWrite_CUSTOM(0x11); //Exit Sleep
         Delayms(100);
           LCD_CtrlWrite_CUSTOM(0xD1);
         LCD_DataWrite_CUSTOM(0x00);
         LCD_DataWrite_CUSTOM(0x4E);
         LCD_DataWrite_CUSTOM(0x17);

         LCD_CtrlWrite_CUSTOM(0xD0);
         LCD_DataWrite_CUSTOM(0x07);
         LCD_DataWrite_CUSTOM(0x02);
         LCD_DataWrite_CUSTOM(0x88);

         LCD_CtrlWrite_CUSTOM(0x36);
         LCD_DataWrite_CUSTOM(0x08);

         LCD_CtrlWrite_CUSTOM(0xC1);
         LCD_DataWrite_CUSTOM(0x10);
         LCD_DataWrite_CUSTOM(0x10);
         LCD_DataWrite_CUSTOM(0x02);
         LCD_DataWrite_CUSTOM(0x02);

         LCD_CtrlWrite_CUSTOM(0xC0); //Set Default Gamma
         LCD_DataWrite_CUSTOM(0x00);
         LCD_DataWrite_CUSTOM(0x35);
         LCD_DataWrite_CUSTOM(0x00);
         LCD_DataWrite_CUSTOM(0x00);
         LCD_DataWrite_CUSTOM(0x01);
         LCD_DataWrite_CUSTOM(0x02);

         LCD_CtrlWrite_CUSTOM(0xC5); //Set frame rate
         LCD_DataWrite_CUSTOM(0x02);

         LCD_CtrlWrite_CUSTOM(0xD2); //power setting
         LCD_DataWrite_CUSTOM(0x01);
         LCD_DataWrite_CUSTOM(0x44);

         LCD_CtrlWrite_CUSTOM(0xC8); //Set Gamma
         LCD_DataWrite_CUSTOM(0x00);
         LCD_DataWrite_CUSTOM(0x56);
         LCD_DataWrite_CUSTOM(0x45);
         LCD_DataWrite_CUSTOM(0x04);
         LCD_DataWrite_CUSTOM(0x03);
         LCD_DataWrite_CUSTOM(0x01);
         LCD_DataWrite_CUSTOM(0x23);
         LCD_DataWrite_CUSTOM(0x12);
         LCD_DataWrite_CUSTOM(0x77);
         LCD_DataWrite_CUSTOM(0x40);
         LCD_DataWrite_CUSTOM(0x09);
         LCD_DataWrite_CUSTOM(0x06);
         LCD_DataWrite_CUSTOM(0x88);
         LCD_DataWrite_CUSTOM(0x88);
         LCD_DataWrite_CUSTOM(0x88);

         LCD_CtrlWrite_CUSTOM(0x3A);
         LCD_DataWrite_CUSTOM(0x55);

         LCD_CtrlWrite_CUSTOM(0x29); //display on

           for(j=0;j<240;j++)                       
        {
                for(i=0;i<400;i++)       
                {
                        LCD_DataWrite_CUSTOM(0x1F);
                        LCD_DataWrite_CUSTOM(0x1F);
                }
        }
           LCD_DelayXms(500);
}
static void LCD_EnterSleep_Custom( void )
{
       
         LCD_CtrlWrite_CUSTOM(0x10);
}
static void LCD_ExitSleep_Custom( void )
{
         LCD_CtrlWrite_CUSTOM(0x11);
}

static void LCD_BlockWrite_Custom(kal_uint16 startx,kal_uint16 starty,kal_uint16 endx,kal_uint16 endy)
{
           kal_uint16 l_startx=startx, l_starty=starty, l_endx=endx, l_endy=endy,counter=0;
       
                        //while (LCD_IS_RUNNING){};
                        SET_LCD_CMD_PARAMETER(counter++,LCD_CMD,0x2a);
                        SET_LCD_CMD_PARAMETER(counter++,LCD_DATA,(startx>>8));       
                        SET_LCD_CMD_PARAMETER(counter++,LCD_DATA,startx);       
                        SET_LCD_CMD_PARAMETER(counter++,LCD_DATA,(endx>>8));
                        SET_LCD_CMD_PARAMETER(counter++,LCD_DATA,endx);       
                       
                        SET_LCD_CMD_PARAMETER(counter++,LCD_CMD,0x2b);
                        SET_LCD_CMD_PARAMETER(counter++,LCD_DATA,(starty>>8));
                        SET_LCD_CMD_PARAMETER(counter++,LCD_DATA,starty&0xff);       
                        SET_LCD_CMD_PARAMETER(counter++,LCD_DATA,(endy>>8));
                        SET_LCD_CMD_PARAMETER(counter++,LCD_DATA,endy&0xff);
                                                       
                        SET_LCD_CMD_PARAMETER(counter++,LCD_CMD,0x2c);
                        ENABLE_LCD_TRANSFER_COMPLETE_INT;       
                    SET_LCD_ROI_CTRL_NUMBER_OF_CMD(counter);
                        ENABLE_LCD_ROI_CTRL_CMD_FIRST;
                        while (LCD_IS_RUNNING) {};
                        START_LCD_TRANSFER;
               
   
           return;
}
发表于 2010-11-10 19:39:30 | 显示全部楼层
RESET,读写时间延长
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2025-1-25 02:33 , Processed in 0.048005 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表