dp14rxss: xdprxss_mst_example.c File Reference

| dp14rxss Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xdprxss_mst_example.c File Reference

## Overview

This file contains a design example using the XDpRxSs driver in single stream (SST) transport or multi-stream transport (MST) mode.

Note
  For this example to display output, the user need to implement initialization of the system (DpRxSs_PlatformInit), Video Phy (DpRxSs_VideoPhyInit), start DisplayPort RX subsystem (XDpRxSs_Start) and DisplayPort RX Subsystem setup (DpRxSs_Setup). The input to the Subsystem is from RX (GT). This example requires an interrupt controller in the system. The functions DpRxSs_PlatformInit, DpRxSs_VideoPhyInit and DpRxSs_Setup are declared and are left up to the user to implement.

    MODIFICATION HISTORY:

    Ver  Who Date     Changes

    1.00 sha 07/29/15 Initial release.
    2.00 sha 10/05/15 Changed DpTxSs_Setup –> DpRxSs_Setup.
    4.00 ms  01/23/17 Modified xil_printf statement in main function to
                      ensure that "Successfully ran" and "Failed" strings
                      are available in all examples. This is a fix for
                      CR-965028.

## Functions
u32 | DpRxSs_MstExample (u16 DeviceId)
| This function is the main entry point for the MST/SST example using the XDpRxSs driver. More...
u32 | DpRxSs_PlatformInit (void)
| This function initialize required platform specific peripherals. More...
u32 | DpRxSs_VideoPhyInit (void)
| This function configures Video Phy. More...
u32 | DpRxSs_Setup (void)
| This function configures DisplayPort RX Subsystem. More...
u32 | DpRxSs_SetupIntrSystem (void)
| This function sets up the interrupt system so interrupts can occur for the DisplayPort RX Subsystem core. More...
void | DpRxSs_VideoModeHandler (void *InstancePtr)
| This function is the callback function for when a video mode change interrupt occurs. More...
void | DpRxSs_NoVideoHandler (void *InstancePtr)
| This function is the callback function for when a no video interrupt occurs. More...
void | DpRxSs_VerticalBlankHandler (void *InstancePtr)
| This function is the callback function for when a vertical blank interrupt occurs. More...
void | DpRxSs_TrainingLostHandler (void *InstancePtr)
| This function is the callback function for when a training lost interrupt occurs. More...
void | DpRxSs_TrainingDoneHandler (void *InstancePtr)
| This function is the callback function for when the training done interrupt occurs. More...
void | DpRxSs_DownReqestHandler (void *InstancePtr)
| This function is the callback function for when a down request interrupt occurs. More...
void | DpRxSs_DownReplyHandler (void *InstancePtr)
| This function is the callback function for when a down reply interrupt occurs. More...
void | DpRxSs_UnplugHandler (void *InstancePtr)
| This function is the callback function for when the unplug event occurs. More...
void | DpRxSs_LinkBandwidthHandler (void *InstancePtr)
| This function is the callback function for when the link bandwidth change occurs. More...
void | DpRxSs_PllResetHandler (void *InstancePtr)
| This function is the callback function for PLL reset request. More...
u32 | DpRxSs_SetupTimerHandler (void)
| This function sets up a custom timer which the driver will use for MicroBlaze systems. More...
void | DpRxSs_CustomWaitUs (void *InstancePtr, u32 MicroSeconds)
| This function is used to override the driver's default sleep functionality. More...
void | DpRxSs_DetectResolution (XDpRxSs *InstancePtr)
| This function will present the resolution of the incoming video stream. More...
int | main ()
| This is the main function for XDpRxSs SST/MST example. More...

## Function Documentation

void DpRxSs_CustomWaitUs | ( | void * | InstancePtr,
|  | u32 | MicroSeconds
| ) |  |

This function is used to override the driver's default sleep functionality.

For MicroBlaze systems, the XDpRxSs_WaitUs driver function's default behavior is to use the MB_Sleep function from microblaze_sleep.h, which is implemented in software and only has millisecond accuracy. For this reason, using a hardware timer is preferable. For ARM/Zynq SoC systems, the SoC's timer is used - XDpRxSs_WaitUs will ignore this custom timer handler.

Parameters

  InstancePtr | is a pointer to the XDpRxSs core instance.
  MicroSeconds | is the number of microseconds to delay/sleep for.

Returns
  None.

Note
  Use the XDpRxSs_SetUserTimerHandler driver function to set this function as the handler for when the XDpRxSs_WaitUs driver function is called.

References XDpRxSs::DpPtr.

Referenced by DpRxSs_SetupTimerHandler().

void DpRxSs_DetectResolution | ( | XDpRxSs * | InstancePtr | ) |

This function will present the resolution of the incoming video stream.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  The resolution will be rounded up to the nearest resolution present in the XVidC_VideoTimingModes table.

References XDpRxSs::DpPtr, XDPRXSS_MSA_HRES, XDPRXSS_MSA_VRES, XDpRxSs_ReadReg, and XDpRxSs_WaitUs.

void DpRxSs_DownReplyHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when a down reply interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

void DpRxSs_DownReqestHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when a down request interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

void DpRxSs_LinkBandwidthHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when the link bandwidth change occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs_UsrOpt::LinkRate, PLLRefClkSel(), and XDpRxSs::UsrOpt.

Referenced by Dp_SetupIntrSystem(), and DpRxSs_SetupIntrSystem().

u32 DpRxSs_MstExample | ( | u16 | DeviceId | ) |

This function is the main entry point for the MST/SST example using the XDpRxSs driver.

Parameters

  DeviceId | is the unique device ID of the DisplayPort RX Subsystem core.

Returns
  - XST_SUCCESS if DisplayPort RX Subsystem configured in SST/MST successfully.
  - XST_FAILURE, if DisplayPort RX Subsystem failed to configure in SST/MST.

Note
  None.

References XDpRxSs_Config::BaseAddress, DpRxSs_PlatformInit(), DpRxSs_Setup(), DpRxSs_SetupIntrSystem(), DpRxSs_SetupTimerHandler(), DpRxSs_VideoPhyInit(), XDpRxSs_UsrOpt::MstSupport, XDpRxSs::UsrOpt, XDpRxSs_CfgInitialize(), XDpRxSs_LookupConfig(), XDpRxSs_SetLaneCount(), XDpRxSs_SetLinkRate(), and XDpRxSs_Start().

Referenced by main().

void DpRxSs_NoVideoHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when a no video interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs::DpPtr, and XDpRxSs::VBlankCount.

Referenced by Dp_SetupIntrSystem(), and DpRxSs_SetupIntrSystem().

u32 DpRxSs_PlatformInit | ( | void |  | ) |

This function initialize required platform specific peripherals.

Parameters

  None. |

Returns
  - XST_SUCCESS if required peripherals are initialized and configured successfully.
  - XST_FAILURE, otherwise.

Note
  None.

void DpRxSs_PllResetHandler | ( | void * | InstancePtr | ) |

This function is the callback function for PLL reset request.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs::DpPtr.

Referenced by Dp_SetupIntrSystem(), and DpRxSs_SetupIntrSystem().

u32 DpRxSs_Setup | ( | void |  | ) |

This function configures DisplayPort RX Subsystem.

Parameters

  None. |

Returns
  - XST_SUCCESS if DPRX Subsystem configured successfully.
  - XST_FAILURE, otherwise.

Note
  None.

References XDpRxSs::DpPtr.

Referenced by DpRxSs_DebugExample(), DpRxSs_HdcpExample(), DpRxSs_IntrExample(), and DpRxSs_MstExample().

u32 DpRxSs_SetupIntrSystem | ( | void |  | ) |

This function sets up the interrupt system so interrupts can occur for the DisplayPort RX Subsystem core.

The function is application-specific since the actual system may or may not have an interrupt controller. The DPRX Subsystem core could be directly connected to a processor without an interrupt controller. The user should modify this function to fit the application.

Parameters

  None |

Returns
  - XST_SUCCESS if interrupt setup was successful.
  - A specific error code defined in "xstatus.h" if an error occurs.

Note
  None.

References CustomWaitUs(), DpRxSs_AccessErrorCounterHandler(), DpRxSs_AccessLinkQualHandler(), DpRxSs_BWChangeHandler(), DpRxSs_CRCTestEventHandler(), DpRxSs_ExtPacketHandler(), DpRxSs_InfoPacketHandler(), DpRxSs_LinkBandwidthHandler(), DpRxSs_NoVideoHandler(), DpRxSs_PllResetHandler(), DpRxSs_PowerChangeHandler(), DpRxSs_TrainingDoneHandler(), DpRxSs_TrainingLostHandler(), DpRxSs_UnplugHandler(), DpRxSs_VerticalBlankHandler(), DpRxSs_VideoHandler(), XDpRxSs_DpIntrHandler(), XDPRXSS_HANDLER_ACCESS_ERROR_COUNTER_EVENT, XDPRXSS_HANDLER_ACCESS_LINK_QUAL_EVENT, XDPRXSS_HANDLER_DP_BW_CHG_EVENT, XDPRXSS_HANDLER_DP_CRC_TEST_EVENT, XDPRXSS_HANDLER_DP_EXT_PKT_EVENT, XDPRXSS_HANDLER_DP_INFO_PKT_EVENT, XDPRXSS_HANDLER_DP_NO_VID_EVENT, XDPRXSS_HANDLER_DP_PWR_CHG_EVENT, XDPRXSS_HANDLER_DP_TDONE_EVENT, XDPRXSS_HANDLER_DP_TLOST_EVENT, XDPRXSS_HANDLER_DP_VBLANK_EVENT, XDPRXSS_HANDLER_DP_VID_EVENT, XDPRXSS_HANDLER_LINKBW_EVENT, XDPRXSS_HANDLER_PLL_RESET_EVENT, XDPRXSS_HANDLER_UNPLUG_EVENT, XDpRxSs_SetCallBack(), and XDpRxSs_SetUserTimerHandler().

u32 DpRxSs_SetupTimerHandler | ( | void |  | ) |

This function sets up a custom timer which the driver will use for MicroBlaze systems.

Parameters

  None. |

Returns
  - XST_SUCCESS if a timer controller exists for use.
  - XST_FAILURE otherwise.

Note
  A timer controller must be present in the system.

References XDpRxSs::DpPtr, DpRxSs_CustomWaitUs(), and XDpRxSs_SetUserTimerHandler().

Referenced by DpRxSs_MstExample().

void DpRxSs_TrainingDoneHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when the training done interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

Referenced by Dp_SetupIntrSystem(), and DpRxSs_SetupIntrSystem().

void DpRxSs_TrainingLostHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when a training lost interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs::DpPtr, XDpRxSs::VBlankCount, and XDpRxSs_AudioDisable.

Referenced by Dp_SetupIntrSystem(), and DpRxSs_SetupIntrSystem().

void DpRxSs_UnplugHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when the unplug event occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs::DpPtr, XDpRxSs::VBlankCount, and XDpRxSs_AudioDisable.

Referenced by Dp_SetupIntrSystem(), and DpRxSs_SetupIntrSystem().

void DpRxSs_VerticalBlankHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when a vertical blank interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs::VBlankCount.

Referenced by Dp_SetupIntrSystem(), and DpRxSs_SetupIntrSystem().

void DpRxSs_VideoModeHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when a video mode change interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

u32 DpRxSs_VideoPhyInit | ( | void |  | ) |

This function configures Video Phy.

Parameters

  None. |

Returns
  - XST_SUCCESS if Video Phy configured successfully.
  - XST_FAILURE, otherwise.

Note
  None.

int main | ( | void |  | ) |

This is the main function for XDpRxSs SST/MST example.

Parameters

  None. |

Returns
  - XST_SUCCESS if the MST/SST example passed.
  - XST_FAILURE if the MST/SST example was unsuccessful.

Note
  None.

References DpRxSs_MstExample().