|
InitLDI_LTV350函数:
- #define LTV350 (TRUE)
- void InitLDI_LTV350(void)
- {
- volatile S3C2450_IOPORT_REG *s2450IOP = (S3C2450_IOPORT_REG *)OALPAtoVA(S3C2450_BASE_REG_PA_IOPORT, FALSE);
- volatile S3C2450_LCD_REG *s2450LCD = (S3C2450_LCD_REG *)OALPAtoVA(S3C2450_BASE_REG_PA_LCD, FALSE);
- volatile S3C2450_CLKPWR_REG *s2450PWR = (S3C2450_CLKPWR_REG *)OALPAtoVA(S3C2450_BASE_REG_PA_CLOCK_POWER, FALSE);
-
- // enable EPLL CLOCK for LCD
- s2450PWR->SCLKCON |= (1<<10);
- // LCD module reset
- s2450IOP->GPBDAT |= (1<<(LCD_nRESET));
- s2450IOP->GPBDAT &= ~(1<<(LCD_nRESET)); // goes to LOW
- // delay about 5ms
- delayLoop(LCD_DELAY_1MS*10);
- s2450IOP->GPBDAT |= (1<<(LCD_nRESET)); // goes to HIGH
-
- //SET_CONFIG_PORT( spi1)
- s2450IOP->GPLCON &= ~(((3<<(LCD_DEN_BIT*2))) | ((3<<(LCD_DCLK_BIT*2))) | ((3<<(LCD_DSERI_BIT*2))));
- s2450IOP->GPLCON |= (((1<<(LCD_DEN_BIT*2))) | ((1<<(LCD_DCLK_BIT*2))) | ((1<<(LCD_DSERI_BIT*2))));
- // pull-up pull-down disable
- s2450IOP->GPLUDP &= ~(((3<<(LCD_DEN_BIT*2))) | ((3<<(LCD_DCLK_BIT*2))) | ((3<<(LCD_DSERI_BIT*2))));
- s2450IOP->GPLUDP |= (((1<<(LCD_DEN_BIT*2))) | ((1<<(LCD_DCLK_BIT*2))) | ((1<<(LCD_DSERI_BIT*2))));
- // delay about 5ms
- delayLoop(LCD_DELAY_1MS*10);
-
- LCD_DEN_Hi;
- LCD_DCLK_Hi;
- LCD_DSERI_Hi;
- ///////////////////////////////////////////////////////////////////
- // Init_Lcd_Function
- //////////////////////////////////////////////////////////////////
- #if LTV350
- Write_LDI_LTV350(0x01,0x001d);
- Write_LDI_LTV350(0x02,0x0000);
- Write_LDI_LTV350(0x03,0x0000);
- Write_LDI_LTV350(0x04,0x0000);
- Write_LDI_LTV350(0x05,0x50a3);
- Write_LDI_LTV350(0x06,0x0000);
- Write_LDI_LTV350(0x07,0x0000);
- Write_LDI_LTV350(0x08,0x0000);
- Write_LDI_LTV350(0x09,0x0000);
- Write_LDI_LTV350(0x0a,0x0000);
- Write_LDI_LTV350(0x10,0x0000);
- Write_LDI_LTV350(0x11,0x0000);
- Write_LDI_LTV350(0x12,0x0000);
- Write_LDI_LTV350(0x13,0x0000);
- Write_LDI_LTV350(0x14,0x0000);
- Write_LDI_LTV350(0x15,0x0000);
- Write_LDI_LTV350(0x16,0x0000);
- Write_LDI_LTV350(0x17,0x0000);
- Write_LDI_LTV350(0x18,0x0000);
- Write_LDI_LTV350(0x19,0x0000);
- #else
- Write_LDI_LTV350(0x09,0x0000);
- #endif
- ///////////////////////////////////////////////////////////////////
- // Power On Reset Display off State
- //////////////////////////////////////////////////////////////////
- //Write_LDI_LTV350(0x09,0x0000);
- // delay about 10ms
- delayLoop(LCD_DELAY_1MS*10);
- ///////////////////////////////////////////////////////////////////
- // Power Setting Function 1
- //////////////////////////////////////////////////////////////////
- #if LTV350
- Write_LDI_LTV350(0x09,0x4055);
- Write_LDI_LTV350(0x0a,0x0000);
- #else
- Write_LDI_LTV350(0x09,0x4055);
- Write_LDI_LTV350(0x0a,0x2000);
- #endif
- // delay about 10ms
- delayLoop(LCD_DELAY_1MS*10);
- /////////////////////////////////////////////////////////////////////
- // Power Setting 2
- /////////////////////////////////////////////////////////////////////
- #if LTV350
- Write_LDI_LTV350(0x0a,0x2000);
- #else
- Write_LDI_LTV350(0x09,0x4055);
- #endif
- // delay about 50ms
- delayLoop(LCD_DELAY_1MS*50);
- ///////////////////////////////////////////////////////////////////
- // Instruction Setting
- ///////////////////////////////////////////////////////////////////
- #if LTV350
- Write_LDI_LTV350(0x01,0x409d);
- Write_LDI_LTV350(0x02,0x0204);
- Write_LDI_LTV350(0x03,0x2100);
- Write_LDI_LTV350(0x04,0x1000);
- Write_LDI_LTV350(0x05,0x5003);
- Write_LDI_LTV350(0x06,0x0009); //vbp
- Write_LDI_LTV350(0x07,0x000f); //hbp
- Write_LDI_LTV350(0x08,0x0800);
- Write_LDI_LTV350(0x10,0x0000);
- Write_LDI_LTV350(0x11,0x0000);
- Write_LDI_LTV350(0x12,0x000f);
- Write_LDI_LTV350(0x13,0x1f00);
- Write_LDI_LTV350(0x14,0x0000);
- Write_LDI_LTV350(0x15,0x0000);
- Write_LDI_LTV350(0x16,0x0000);
- Write_LDI_LTV350(0x17,0x0000);
- Write_LDI_LTV350(0x18,0x0000);
- Write_LDI_LTV350(0x19,0x0000);
- #else
- Write_LDI_LTV350(0x01,0x409d);
- Write_LDI_LTV350(0x02,0x0204);
- Write_LDI_LTV350(0x03,0x0100);
- Write_LDI_LTV350(0x04,0x3000);
- Write_LDI_LTV350(0x05,0x4003);
- Write_LDI_LTV350(0x06,0x0009); //vbp
- Write_LDI_LTV350(0x07,0x000f); //hbp
- Write_LDI_LTV350(0x08,0x0c00);
- Write_LDI_LTV350(0x10,0x0103);
- Write_LDI_LTV350(0x11,0x0301);
- Write_LDI_LTV350(0x12,0x1f0f);
- Write_LDI_LTV350(0x13,0x1f0f);
- Write_LDI_LTV350(0x14,0x0707);
- Write_LDI_LTV350(0x15,0x0307);
- Write_LDI_LTV350(0x16,0x0707);
- Write_LDI_LTV350(0x17,0x0000);
- Write_LDI_LTV350(0x18,0x0004);
- Write_LDI_LTV350(0x19,0x0000);
- #endif
- // delay about 2 frames
- delayLoop(LCD_DELAY_1MS*50);
- ///////////////////////////////////////////////////////////////////
- // Display On Sequence
- ///////////////////////////////////////////////////////////////////
- #if LTV350
- Write_LDI_LTV350(0x09,0x4a55);
- Write_LDI_LTV350(0x0a,0x2000);
- #else
- Write_LDI_LTV350(0x09,0x4a55);
- Write_LDI_LTV350(0x05,0x5003);
- #endif
-
- }
复制代码 |
|