|
我这边 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;
} |
|