Exemplo n.º 1
0
DPI_STATUS DPI_ConfigHsync(DPI_POLARITY polarity, UINT32 pulseWidth, UINT32 backPorch,
                           UINT32 frontPorch)
{
    DPI_REG_TGEN_HPORCH hporch = DPI_REG->TGEN_HPORCH;
    DPI_REG_TGEN_POL pol = DPI_REG->TGEN_POL;
    
	pol.HSYNC_POL = (DPI_POLARITY_FALLING == polarity) ? 1 : 0;
    //DPI_REG->TGEN_HWIDTH = pulseWidth;
    OUTREG32(&DPI_REG->TGEN_HWIDTH,pulseWidth);
    hporch.HBP = backPorch;
    hporch.HFP = frontPorch;

    DPI_OUTREG32_R(PDPI_REG_TGEN_POL,&DPI_REG->TGEN_POL, &pol);
    DPI_OUTREG32_R(PDPI_REG_TGEN_HPORCH,&DPI_REG->TGEN_HPORCH, &hporch);

    return DPI_STATUS_OK;
}
Exemplo n.º 2
0
DPI_STATUS DPI_DisableClk()
{
    DPI_REG_EN en = DPI_REG->DPI_EN;
    en.EN = 0;
    DPI_OUTREG32_R(PDPI_REG_EN,&DPI_REG->DPI_EN,&en);

    return DPI_STATUS_OK;
}
Exemplo n.º 3
0
DPI_STATUS DPI_ConfigVsync(DPI_POLARITY polarity, UINT32 pulseWidth, UINT32 backPorch,
                           UINT32 frontPorch)
{
    DPI_REG_TGEN_VWIDTH_LODD vwidth_lodd  = DPI_REG->TGEN_VWIDTH_LODD;
	DPI_REG_TGEN_VPORCH_LODD vporch_lodd  = DPI_REG->TGEN_VPORCH_LODD;
    DPI_REG_TGEN_POL pol = DPI_REG->TGEN_POL;
    
	pol.VSYNC_POL = (DPI_POLARITY_FALLING == polarity) ? 1 : 0;
    vwidth_lodd.VPW_LODD = pulseWidth;
    vporch_lodd.VBP_LODD= backPorch;
    vporch_lodd.VFP_LODD= frontPorch;

    DPI_OUTREG32_R(PDPI_REG_TGEN_POL,&DPI_REG->TGEN_POL, &pol);
    DPI_OUTREG32_R(PDPI_REG_TGEN_VWIDTH_LODD,&DPI_REG->TGEN_VWIDTH_LODD, &vwidth_lodd);
	DPI_OUTREG32_R(PDPI_REG_TGEN_VPORCH_LODD,&DPI_REG->TGEN_VPORCH_LODD, &vporch_lodd);
    
    return DPI_STATUS_OK;
}
Exemplo n.º 4
0
DPI_STATUS DPI_ConfigDataEnable(DPI_POLARITY polarity)
{

    DPI_REG_TGEN_POL pol = DPI_REG->TGEN_POL;
    pol.DE_POL = (DPI_POLARITY_FALLING == polarity) ? 1 : 0;
    DPI_OUTREG32_R(PDPI_REG_TGEN_POL,&DPI_REG->TGEN_POL, &pol);
 
    return DPI_STATUS_OK;
}
Exemplo n.º 5
0
DPI_STATUS DPI_FBSetSize(UINT32 width, UINT32 height)
{
    DPI_REG_SIZE size;
    size.WIDTH = width;
    size.HEIGHT = height;
    
    DPI_OUTREG32_R(PDPI_REG_SIZE,&DPI_REG->SIZE, &size);

    return DPI_STATUS_OK;
}
Exemplo n.º 6
0
DPI_STATUS DPI_ConfigLVDS(LCM_PARAMS *lcm_params)
{
	DPI_REG_CNTL ctrl = DPI_REG->CNTL;
//	DPI_REG_EMBSYNC_SETTING embsync;
	ctrl.EMBSYNC_EN = lcm_params->dpi.embsync;
	MASKREG32(DISPSYS_BASE + 0x60, 0x7, (lcm_params->dpi.i2x_en << 1)|(lcm_params->dpi.i2x_edge << 2) | 1);
    DPI_OUTREG32_R(PDPI_REG_CNTL,&DPI_REG->CNTL, &ctrl);

    return DPI_STATUS_OK;
}
Exemplo n.º 7
0
DPI_STATUS DPI_EnableClk()
{
	DPI_REG_EN en = DPI_REG->DPI_EN;
    en.EN = 1;
    DPI_OUTREG32_R(PDPI_REG_EN,&DPI_REG->DPI_EN, &en);
   //release mutex0
//#ifndef BUILD_UBOOT
#if 0
    OUTREG32(DISP_MUTEX_BASE + 0x24, 0);
    while((INREG32(DISP_MUTEX_BASE + 0x24)&0x02)!=0){} // polling until mutex lock complete
#endif
    return DPI_STATUS_OK;
}
Exemplo n.º 8
0
DPI_STATUS DPI_ConfigHsync(DPI_POLARITY polarity, UINT32 pulseWidth, UINT32 backPorch,
                           UINT32 frontPorch)
{
   DPI_REG_TGEN_HPORCH hporch = DPI_REG->TGEN_HPORCH;
   
   hporch.HBP = backPorch;
   hporch.HFP = frontPorch;
   
   OUTREG32(&DPI_REG->TGEN_HWIDTH, AS_UINT32(&pulseWidth));
   DPI_OUTREG32_R(PDPI_REG_TGEN_HPORCH, &DPI_REG->TGEN_HPORCH, &hporch);
   
   return DPI_STATUS_OK;
}
Exemplo n.º 9
0
DPI_STATUS DPI_ConfigVsync(DPI_POLARITY polarity, UINT32 pulseWidth, UINT32 backPorch,
                           UINT32 frontPorch)
{
   DPI_REG_TGEN_VPORCH vporch = DPI_REG->TGEN_VPORCH;
   
   vporch.VBP = backPorch;
   vporch.VFP = frontPorch;
   
   OUTREG32(&DPI_REG->TGEN_VWIDTH, AS_UINT32(&pulseWidth));
   DPI_OUTREG32_R(PDPI_REG_TGEN_VPORCH, &DPI_REG->TGEN_VPORCH, &vporch);
   
   return DPI_STATUS_OK;
}
Exemplo n.º 10
0
DPI_STATUS DPI_ConfigPixelClk(DPI_POLARITY polarity, UINT32 divisor, UINT32 duty)
{
    DPI_REG_CLKCNTL ctrl;

    ASSERT(divisor >= 2);
    ASSERT(duty > 0 && duty < divisor);
    
    ctrl.POLARITY = (DPI_POLARITY_FALLING == polarity) ? 1 : 0;
    ctrl.DIVISOR = divisor - 1;
    ctrl.DUTY = duty;

    DPI_OUTREG32_R(PDPI_REG_CLKCNTL,&DPI_REG->CLK_CNTL, &ctrl);

    return DPI_STATUS_OK;
}
Exemplo n.º 11
0
DPI_STATUS DPI_OutputSetting(LCM_DPI_PARAMS *pConfig)
{
   DPI_REG_OUTPUT_SETTING output_setting = DPI_REG->OUTPUT_SETTING;

   if (pConfig->rgb_order == LCM_COLOR_ORDER_BGR)
      output_setting.OUT_CH_SWAP = 0x5;
   else
      output_setting.OUT_CH_SWAP = 0x0;
   output_setting.OUT_BIT_SWAP = 0;
   output_setting.B_MASK = 0;
   output_setting.G_MASK = 0;
   output_setting.R_MASK = 0;
   output_setting.DE_MASK = 0;
   output_setting.HS_MASK = 0;
   output_setting.VS_MASK = 0;
   if (pConfig->de_pol == LCM_POLARITY_FALLING)
      output_setting.DE_POL = 1;
   else
      output_setting.DE_POL = 0;
   if (pConfig->hsync_pol == LCM_POLARITY_FALLING)
      output_setting.HSYNC_POL = 1;
   else
      output_setting.HSYNC_POL = 0;
   if (pConfig->vsync_pol == LCM_POLARITY_FALLING)
      output_setting.VSYNC_POL = 1;
   else
      output_setting.VSYNC_POL = 0;
   if (pConfig->clk_pol == LCM_POLARITY_FALLING)
      output_setting.DPI_CK_POL = 1;
   else
      output_setting.DPI_CK_POL = 0;
   output_setting.DPI_OEN_OFF = 0;
   output_setting.DUAL_EDGE_SEL = 0;

   DPI_OUTREG32_R(PDPI_REG_OUTPUT_SETTING, &DPI_REG->OUTPUT_SETTING,&output_setting);

   return DPI_STATUS_OK;
}