XilinxProcessorIPLib/drivers/vprocss/examples/src/periph.c
void XPeriph_ConfigTpg(XPeriph *InstancePtr)
{
  XV_tpg *pTpg = InstancePtr->TpgPtr;

  //Stop TPG
  XV_tpg_DisableAutoRestart(pTpg);

  if (InstancePtr->TpgConfig.IsInterlaced)
    XV_tpg_Set_height(pTpg, InstancePtr->TpgConfig.Height*2);
  else
    XV_tpg_Set_height(pTpg, InstancePtr->TpgConfig.Height);

  XV_tpg_Set_width(pTpg,  InstancePtr->TpgConfig.Width);
  XV_tpg_Set_colorFormat(pTpg, InstancePtr->TpgConfig.ColorFmt);
  XV_tpg_Set_bckgndId(pTpg, InstancePtr->TpgConfig.Pattern);
  XV_tpg_Set_ovrlayId(pTpg, 0);

  if (InstancePtr->TpgConfig.IsInterlaced)
  {
    XV_tpg_Set_Interlaced(pTpg, 1);
  } else
    XV_tpg_Set_Interlaced(pTpg, 0);


  //Start TPG
  XV_tpg_EnableAutoRestart(pTpg);
  XV_tpg_Start(pTpg);
}
/*****************************************************************************/
/**
 * This function configures TPG to user defined parameters
 *
 * @param  InstancePtr is a pointer to the peripheral instance
 *
 *****************************************************************************/
This function configures TPG to user defined parameters
@param  InstancePtr is a pointer to the peripheral instance
This function configures TPG to user defined parameters @param InstancePtr is a pointer to the peripheral instance
void XPeriph_ConfigTpg(XPeriph *InstancePtr)
{
  XV_tpg *pTpg = InstancePtr->TpgPtr;
  XV_tpg_DisableAutoRestart(pTpg);
  if (InstancePtr->TpgConfig.IsInterlaced)
    XV_tpg_Set_height(pTpg, InstancePtr->TpgConfig.Height*2);
  else
    XV_tpg_Set_height(pTpg, InstancePtr->TpgConfig.Height);
  XV_tpg_Set_width(pTpg,  InstancePtr->TpgConfig.Width);
  XV_tpg_Set_colorFormat(pTpg, InstancePtr->TpgConfig.ColorFmt);
  XV_tpg_Set_bckgndId(pTpg, InstancePtr->TpgConfig.Pattern);
  XV_tpg_Set_ovrlayId(pTpg, 0);
  if (InstancePtr->TpgConfig.IsInterlaced)
  {
    XV_tpg_Set_Interlaced(pTpg, 1);
  } else
    XV_tpg_Set_Interlaced(pTpg, 0);
  XV_tpg_EnableAutoRestart(pTpg);
  XV_tpg_Start(pTpg);
}
void XPeriph_ConfigTpg ( XPeriph * InstancePtr ) { XV_tpg * pTpg = InstancePtr -> TpgPtr ; XV_tpg_DisableAutoRestart ( pTpg ) ; if ( InstancePtr -> TpgConfig . IsInterlaced ) XV_tpg_Set_height ( pTpg , InstancePtr -> TpgConfig . Height * 2 ) ; else XV_tpg_Set_height ( pTpg , InstancePtr -> TpgConfig . Height ) ; XV_tpg_Set_width ( pTpg , InstancePtr -> TpgConfig . Width ) ; XV_tpg_Set_colorFormat ( pTpg , InstancePtr -> TpgConfig . ColorFmt ) ; XV_tpg_Set_bckgndId ( pTpg , InstancePtr -> TpgConfig . Pattern ) ; XV_tpg_Set_ovrlayId ( pTpg , 0 ) ; if ( InstancePtr -> TpgConfig . IsInterlaced ) { XV_tpg_Set_Interlaced ( pTpg , 1 ) ; } else XV_tpg_Set_Interlaced ( pTpg , 0 ) ; XV_tpg_EnableAutoRestart ( pTpg ) ; XV_tpg_Start ( pTpg ) ; }
This function configures TPG to user defined parameters
 @param  InstancePtr is a pointer to the peripheral instance
This function configures TPG to user defined parameters @param InstancePtr is a pointer to the peripheral instance
//Stop TPG //Start TPG