主要注意几个地方: #define LCD_WIDTH 800 #define LCD_HEIGHT 480 #define LCD_BPP 24 // The VBPD, VFPD, VSPW, HBPD, HFPD, HSPW will be internal subtract 1. LDI_INF((_T("[LDI:INF] Output Devce Type [%d] = LDI_(SMRP)LTE480WV_RGB/n/r"), g_ModuleType)); pDeviceInfo->RGBOutMode = DISP_24BIT_RGB888_P; pDeviceInfo->uiWidth = 800; pDeviceInfo->uiHeight = 480; pDeviceInfo->VBPD_Value = 4; // Brian Liu, 2010/02/09, 3 for 7 inch, 4 for 10.2 inch pDeviceInfo->VFPD_Value = 38; // Brian Liu, 2010/02/09, 5 for 7 inch, 38 for 10.2 inch pDeviceInfo->VSPW_Value = 3; // Brian Liu, 2010/02/09, 5 for 7 inch, 3 for 10.2 inch pDeviceInfo->HBPD_Value = 45; // Brian Liu, 2010/02/09, 13 for 7 inch, 45 for 10.2 inch pDeviceInfo->HFPD_Value = 151; // Brian Liu, 2010/02/09, 8 for 7 inch, 151 for 10.2 inch pDeviceInfo->HSPW_Value = 3; // Brian Liu, 2010/02/09, 3 for 7 inch, 3 for 10.2 inch pDeviceInfo->VCLK_Polarity = IVCLK_FALL_EDGE; // Brian Liu, 2010/02/09, IVCLK_FALL_EDGE for 7 inch, IVCLK_FALL_EDGE for 10.2 inch pDeviceInfo->HSYNC_Polarity = IHSYNC_LOW_ACTIVE; pDeviceInfo->VSYNC_Polarity = IVSYNC_LOW_ACTIVE; // Brian Liu, 2010/02/09, IVSYNC_LOW_ACTIVE for 7 inch, IVSYNC_LOW_ACTIVE for 10.2 inch pDeviceInfo->VDEN_Polarity = IVDEN_HIGH_ACTIVE; pDeviceInfo->PNR_Mode = PNRMODE_RGB_P; pDeviceInfo->VCLK_Source = CLKSEL_F_LCDCLK; pDeviceInfo->VCLK_Direction = CLKDIR_DIVIDED; pDeviceInfo->Frame_Rate = 60; // VCLK > 24.5 MHz (Max 35.7 MHz) static DISP_ERROR Disp_initialize_RGBIF(void) { DISP_ERROR error = DISP_SUCCESS; unsigned int VCLKDivider; DISP_MSG((_T("[DISP]++Disp_initialize_RGBIF()/n/r"))); if (Disp_get_vclk_direction_divider(g_DevInfoRGB.VCLK_Source, &g_DevInfoRGB.VCLK_Direction, &VCLKDivider)) { / V I D C O N 0 /// #if ITU601OUTPUT // Here, we use FALSE g_pDispConReg->VIDCON0 = INTERLACE | VIDOUT_TVENC | g_DevInfoRGB.PNR_Mode | CLKVALUP_ALWAYS | CLKVAL_F(VCLKDivider) | VCLK_NORMAL | g_DevInfoRGB.VCLK_Direction | g_DevInfoRGB.VCLK_Source | ENVID_DISABLE | ENVID_F_DISABLE; #else g_pDispConReg->VIDCON0 = PROGRESSIVE | VIDOUT_RGBIF | g_DevInfoRGB.PNR_Mode | CLKVALUP_ALWAYS | CLKVAL_F(VCLKDivider) | VCLK_NORMAL | g_DevInfoRGB.VCLK_Direction | g_DevInfoRGB.VCLK_Source | ENVID_DISABLE | ENVID_F_DISABLE; #endif DISP_DBG((_T("[DISP] VIDCON0(0xEE00_0000) : 0x%08x/n/r"), g_pDispConReg->VIDCON0)); / V I D C O N 1 /// g_pDispConReg->VIDCON1 = g_DevInfoRGB.VCLK_Polarity | g_DevInfoRGB.HSYNC_Polarity | g_DevInfoRGB.VSYNC_Polarity | g_DevInfoRGB.VDEN_Polarity; DISP_DBG((_T("[DISP] VIDCON1(0xEE00_0004) : 0x%08x/n/r"), g_pDispConReg->VIDCON1)); / V I D C O N 2 /// #if ITU601OUTPUT // Here, we use FALSE g_pDispConReg->VIDCON2 = EN601 | TVIF_FMT_YUV422; // Default Field Mode, polarity all normal(HREF, VSYNC, HSYNC, FIELD[Even=High], CLK) // User can adjust the VSYNC delay clock with changing DLYVSYNC[23:16], SELVSYNC[24] g_pDispConReg->ITUIFCON0 = 0; g_pGPIOReg->SPCON = (g_pGPIOReg->SPCON & ~(0x3<<0))|(2<<0); // rechange to ITU601/656 style #else g_pDispConReg->VIDCON2 = TVIF_FMT_YUV444; // Should be this value #endif DISP_DBG((_T("[DISP] VIDCON2(0xEE00_0008) : 0x%08x/n/r"), g_pDispConReg->VIDCON2)); / V I D T C O N 0 /// // Brian Liu, 2010/02/09, VBPDE(1) for 7 inch, VBPDE(6) for 10.2 inch g_pDispConReg->VIDTCON0 = VBPDE(6) | VBPD(g_DevInfoRGB.VBPD_Value) | VFPD(g_DevInfoRGB.VFPD_Value) | VSPW(g_DevInfoRGB.VSPW_Value); DISP_DBG((_T("[DISP] VIDTCON0(0xEE00_0010) : 0x%08x/n/r"), g_pDispConReg->VIDTCON0)); / V I D T C O N 1 /// // Brian Liu, 2010/02/09, VFPDE(1) for 7 inch, VFPDE(38) for 10.2 inch g_pDispConReg->VIDTCON1 = VFPDE(38) | HBPD(g_DevInfoRGB.HBPD_Value) | HFPD(g_DevInfoRGB.HFPD_Value) | HSPW(g_DevInfoRGB.HSPW_Value); DISP_DBG((_T("[DISP] VIDTCON1(0xEE00_0014) : 0x%08x/n/r"), g_pDispConReg->VIDTCON1)); / V I D T C O N 2 /// g_pDispConReg->VIDTCON2 = LINEVAL(g_DevInfoRGB.uiHeight) | HOZVAL(g_DevInfoRGB.uiWidth); DISP_DBG((_T("[DISP] VIDTCON2(0xEE00_0018) : 0x%08x/n/r"), g_pDispConReg->VIDTCON2)); / D I T H M O D E /// DISP_DBG((_T("[DISP] DITHMODE(0xEE00_0170) : 0x%08x/n/r"), g_pDispConReg->DITHMODE)); } else { DISP_ERR((_T("[DISP:ERR] Disp_initialize_RGBIF() : Clock Source Decision Failed/n/r"))); error = DISP_ERROR_ILLEGAL_PARAMETER; } DISP_MSG((_T("[DISP]--Disp_initialize_RGBIF() : %d/n/r"), error)); return error; }