hi3516DV300 CV500 LCD开机动画

因为DV300 与 CV500 并没有 LCD 开机动画的的文档,在做LCD 开机动画时走了不少弯路,现总结一下,总体思路,是要把LCD 初始化的配置打通,需要加的东西有点多,记录如下:
一、硬件连接
hi3516DV300 CV500 LCD开机动画_第1张图片

二、配置

  sync =	VO_INTF_LCD_18BIT	

int start_vo(unsigned int dev, unsigned int type, unsigned int sync)
//====================================================================
if (VO_INTF_LCD           & type
        || VO_INTF_LCD_6BIT   & type
        || VO_INTF_LCD_8BIT   & type
        || VO_INTF_LCD_16BIT  & type
        || VO_INTF_LCD_18BIT  & type
        || VO_INTF_LCD_24BIT  & type
        || VO_INTF_MIPI       & type
        || VO_INTF_MIPI_SLAVE & type
 )
    {
        VOU_DRV_SetDevBkGrd(dev, g_au32BgColor);		
    }
    else
    {
        VOU_DRV_SetDevBkGrd(dev, Rgb2Yuv(g_au32BgColor));
    }
//====================================================================
HAL_DISP_SYNCINFO_S g_stSyncTiming[VO_OUTPUT_BUTT] = 
{
//在typedef enum hiVO_INTF_SYNC_E 增加  VO_OUTPUT_800x480_60,			 /* 800*480 */
 {  1,    1,   0,   480,   23,    22,   800,    46,   210,     0,   0,    0,  0,   20, 10,   0,  0,  0},  /*800x480*/
}
//====================================================================

配置 CLK

VOU_DRV_SetDevClk(VO_DEV VoDev)
   	case VO_OUTPUT_800x480_60:
		{
			printf("enOutSync VO_OUTPUT_800x480_60\n");

			u32Fbdiv	   = 99;
			u32Frac 	   = 0;
			u32Refdiv	   = 2;
			u32Postdiv1    = 1;
			u32Postdiv2    = 1;

			u32HdmiclkDiv  = 0xf;
			break;
    	}
    SYS_HAL_VouHdClkSel(u32PPCSel);
    SYS_HAL_VouHdClkSel(u32ClkDiv);
    SYS_HAL_VouHdHdmiClkDiv(u32HdmiclkDiv);
    SYS_HAL_VouOutClkSel(u32VdpOutClkSel);
    SYS_HAL_SetVoPllFbdiv(u32Fbdiv);
    SYS_HAL_SetVoPllFrac(u32Frac);
    SYS_HAL_SetVoPllRefdiv(u32Refdiv);
    SYS_HAL_SetVoPllPostdiv2(u32Postdiv2);
    SYS_HAL_SetVoPllPostdiv1(u32Postdiv1);

打开设备

VOU_DRV_Open(HI_S32 VoDev)

if (VO_INTF_LCD           & enIntfType
        || VO_INTF_LCD_6BIT   & enIntfType
        || VO_INTF_LCD_8BIT   & enIntfType
        || VO_INTF_LCD_16BIT  & enIntfType
        || VO_INTF_LCD_18BIT  & enIntfType
        || VO_INTF_LCD_24BIT  & enIntfType
        || VO_INTF_MIPI       & enIntfTy
        || VO_INTF_MIPI_SLAVE & enIntfType
       )
    {
        stBkg.u16Bkg_y  = RGB_R(pstHalDevCfg->u32BkGrd);
        stBkg.u16Bkg_cb = RGB_G(pstHalDevCfg->u32BkGrd);
        stBkg.u16Bkg_cr = RGB_B(pstHalDevCfg->u32BkGrd);
    }

if (VO_INTF_LCD_18BIT & pstHalDevCfg->enIntfType)
    {
        SYS_HAL_VouBtClkEn(HI_TRUE);

        HAL_DISP_SetIntfMuxSel(VoDev,VO_INTF_LCD_18BIT);
      
		u32DataMode = 1;
		 SYS_HAL_LcdDataMode(u32DataMode);
		if(pstHalDevCfg->enOutSync == VO_OUTPUT_800x480_60)
		{
			u32DataRev = 1;
				SYS_HAL_VdpDataReverse(u32DataRev);
		}		
		 SYS_HAL_VouHdOutPctrl(HI_FALSE);
		 
		if((pstHalDevCfg->enOutSync == VO_OUTPUT_1024x600_60) )
		{
			SYS_HAL_VouHdOutPctrl(HI_TRUE);	
		}
		LCD_CTRL.bits.lcd_parallel_mode = 1;	
		LCD_CTRL.bits.lcd_parallel_order = 1;	
		if(pstHalDevCfg->enOutSync == VO_OUTPUT_800x480_60)
		{
			LCD_CTRL.bits.lcd_parallel_order = 0;
			LCD_CTRL.bits.lcd_serial_perd = 0;
		}
		LCD_CTRL.bits.lcd_data_inv = 0;		
		LCD_CTRL.bits.dfir_en = 0;
		LCD_CTRL.bits.hdmi_mode = 1;
        HAL_DISP_SetIntfCtrl(pstHalDevCfg->enIntfType, &(LCD_CTRL.u32));   
    }

HI_BOOL HAL_DISP_SetIntfCtrl(HAL_DISP_INTF_E enIntf, HI_U32* pu32CtrlInfo)
if(VO_INTF_LCD       == enIntf ||
            VO_INTF_LCD_6BIT  == enIntf ||
            VO_INTF_LCD_8BIT  == enIntf ||
            VO_INTF_LCD_16BIT == enIntf ||
            VO_INTF_LCD_18BIT == enIntf ||
            VO_INTF_LCD_24BIT == enIntf)
    {
        pstLCDCtrl = (U_INTF_LCD_CTRL*)pu32CtrlInfo;
        addr_REG   = Vou_GetIntfAbsAddr(enIntf, (HI_UL) & (pVoReg->INTF_HDMI_CTRL.u32));
        INTF_LCD_CTRL.u32 = HAL_ReadReg((HI_U32*)addr_REG);
		INTF_LCD_CTRL.bits.hdmi_mode          = pstLCDCtrl->bits.hdmi_mode;
        INTF_LCD_CTRL.bits.lcd_serial_mode    = pstLCDCtrl->bits.lcd_serial_mode;
        INTF_LCD_CTRL.bits.lcd_serial_perd    = pstLCDCtrl->bits.lcd_serial_perd;
        INTF_LCD_CTRL.bits.lcd_parallel_order = pstLCDCtrl->bits.lcd_parallel_order;
        INTF_LCD_CTRL.bits.lcd_data_inv       = pstLCDCtrl->bits.lcd_data_inv;
        INTF_LCD_CTRL.bits.lcd_parallel_mode  = pstLCDCtrl->bits.lcd_parallel_mode;
        HAL_WriteReg((HI_U32*)addr_REG, INTF_LCD_CTRL.u32);
    }
 start_videolayer()
 
	(VO_INTF_MIPI == enVoIntfType ||
		     VO_INTF_LCD_18BIT == enVoIntfType)
    {
        enCscMatrix  = VO_CSC_MATRIX_BT709_TO_RGB_PC;
	//enCscMatrix  = VO_CSC_MATRIX_BT601_TO_RGB_PC;

     VOU_DRV_VideoSetCscCoef(enLayer,enCscMatrix);
	 HAL_LAYER_SetCscEn(enLayer, HI_TRUE);
    }

另:CV500 因为没有解码器,所以要显示开机动画,读入的数据必须是解码后的图像数据,

你可能感兴趣的:(hi3516DV300)