2416 RBG 接口 LCD 换成 I80 接口 LCD 驱动修改 NK 部分

 

在 OEMInit 里面初始化 LCD 。

1、初始化 IO 

       volatile S3C2416_IOPORT_REG *s2450IOP = (S3C2416_IOPORT_REG *)OALPAtoVA(S3C2416_BASE_REG_PA_IOPORT, FALSE);
    s2450IOP->MISCCR |= (1<<28);  // select LCD controller for TFT lcd controller
    s2450IOP->GPCUDP     = 0xFFFFFFFF;
    s2450IOP->GPCCON    = 0xAAAAAAAA;
    s2450IOP->GPDUDP     = 0xFFFFFFFF;
    s2450IOP->GPDCON    = 0xAAAAAAAA;
    s2450IOP->GPLCON = s2450IOP->GPLCON & ~(0x3ff<<20) | (0x1<< 28) | (0x1<< 26) | (0x1<< 24) | (0x1<< 22) | (0x1<< 20);
    s2450IOP->GPLDAT |= (0x1f<<10);

    s2450IOP->GPBDAT &= ~(1<<1);

2、初始化 LCD 控制寄存器和 EBOOT 的方法一样。


3、初始化 系统 LCD 

  

void LCDC_Common_Init(void)
{
volatile S3C2416_LCD_REG    *s2450LCD = (S3C2416_LCD_REG *)OALPAtoVA(S3C2416_BASE_REG_PA_LCD, FALSE);

    s2450LCD->VIDCON0 = VIDCON0_S_CPU_IF_MAIN|VIDCON0_S_RGB_PAR|VIDCON0_S_VCLK_GATING_OFF|\
    VIDCON0_S_CLKDIR_DIVIDED|VIDCON0_S_CLKSEL_HCLK;
// s2450LCD->WINCON0 |= (1<<23) ;
s2450LCD->SYSIFCON0 = (0<<16)|(0<<12)|(0<<8)|(0<<4)|(1<<2)|(1<<1)|(1);
    s2450LCD->VIDTCON2 = ((320-1)<<11)|(240-1);
}


void Basic_Display_Setting(void)
{
volatile S3C2416_LCD_REG    *s2450LCD = (S3C2416_LCD_REG *)OALPAtoVA(S3C2416_BASE_REG_PA_LCD, FALSE);
    volatile S3C2416_INTR_REG    *s2450INTR = (S3C2416_INTR_REG *)OALPAtoVA(S3C2416_BASE_REG_PA_INTR, FALSE);
    int i,x,y;
    unsigned short *pFB,*pFB1;
#if 1
    s2450LCD->WINCON1 = (0<<23)|(0<<22)|(0<<16)|(1<<9)|(5<<2); 
    s2450LCD->VIDOSD1A =(0<<11)|(0);
    s2450LCD->VIDOSD1B =((240-1)<<11)|(320-1);
    s2450LCD->VIDW01ADD0 = (UINT32)IMAGE_FRAMEBUFFER_DMA_BASE;
    s2450LCD->VIDW01ADD1 = (UINT32)IMAGE_FRAMEBUFFER_DMA_BASE + ((240*2)*320);
    s2450LCD->VIDW01ADD2 = (0<<13)|(240*2);
    s2450LCD->WIN1MAP=0;
    s2450LCD->VIDOSD1C=0;
    s2450LCD->W1KEYCON0=0;
    s2450LCD->W1KEYCON1=0;
    s2450INTR->INTMSK1 &= ~(1<<16);
    s2450LCD->VIDINTCON = (0x3f<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<0); //Main & Sub Sending complete
    
    s2450INTR->INTSUBMSK |= (0x7 << 15);    // MASK all LCD Sub Interrupt
s2450INTR->INTSUBMSK &= ~(1<<17);//i80 I/F
    pFB = (unsigned short *)IMAGE_FRAMEBUFFER_UA_BASE;


wr_cmd(0x0020);
wr_data(0);
wr_cmd(0x0021);
wr_data(0);
    wr_cmd(0x0022);
    delayLoop(50000);
    s2450LCD->SIFCCON0 &= ~(1<<6); // nWE disable
    s2450LCD->SIFCCON0 |= (1<<8); // nCS0(Main) disable
    s2450LCD->SIFCCON0 |= (1<<1); // RS high
    s2450LCD->SIFCCON0 &= ~(1<<0); // command mode disable


for(y=0;y<320*240;y++)
{
      //  *pFB++ =kay16bpp[y];
        *pFB++ =0x001f;
}
    s2450LCD->WINCON1 |= 0x01;
    s2450LCD->VIDCON0 |=0x03;
    s2450LCD->CPUTRIGCON2 = 1;
    //while(1);


#endif
}

到这里 LCD 应该跑起来了, 到最后的 DISPLAY 部分了


4、DISPLAY 文件夹部分。

     发现 LDI_LTE480WV_RGB 类型的 LCD 刚好是 240*320 的 CPU 接口 LCD

    结果把 LCD 类型设置为 LDI_LTE480WV_RGB 就可以了~!

哈哈,万幸~!



你可能感兴趣的:(c,image,IO,cmd,command,basic)