| dp14rxss Vitis Drivers API Documentation

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

Functions
xdprxss_dp14_rx.c File Reference

## Overview

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

    MODIFICATION HISTORY:

    Ver  Who Date     Changes

    1.00 nd 2/14/19  Common rx only application for zcu102 and vcu118
    1.1  ku 8/14/20  CRC Calculator configured for 4 PPC
    1.2  nd 1/12/21  Added Support for VSC
    1.3  ND 04/02/21 Moved all global variables declaration from .h to .c
                                       files due to gcc compiler compilation error.
    1.4  ND 07/21/22 Updated LMK03318 address.
    1.5  ND 08/26/22 Added DELAY macro to increase delay in IDT_8T49N24x_SetClock()
                                            if encountering iic race condition.

## Functions
u32 | DpRxSs_Main (u16 DeviceId)
| This function is the main entry point for the design example using the XDpRxSs driver. More...
u32 | DpRxSs_PlatformInit (void)
| This function initialize required platform specific peripherals. More...
u32 | DpRxSs_VideoPhyInit (u16 DeviceId)
| This function configures Video Phy. More...
u32 | DpRxSs_Setup (void)
| This function configures DisplayPort RX Subsystem. More...
void | PHY_Two_byte_set (XVphy *InstancePtr, u8 Rx_to_two_byte)
| This function sets GT in 16-bits (2-Byte) or 32-bits (4-Byte) mode. More...
void | PLLRefClkSel (XVphy *InstancePtr, u8 link_rate)
| This function sets proper ref clk frequency and line rate. More...
void | AppHelp ()
| This function prints Menu. More...
void | ReportVideoCRC ()
| This function reports CRC values of Video components. More...
void | CalculateCRC (void)
| This function Calculates CRC values of Video components. More...
void | LoadEDID (void)
| This function load EDID content into EDID Memory. More...
char | XUartPs_RecvByte_NonBlocking ()
| This function is a non-blocking UART return byte. More...
void | CustomWaitUs (void *InstancePtr, u32 MicroSeconds)
| This function is called when DisplayPort Subsystem core requires delay or sleep. More...
char | xil_getc (u32 timeout_ms)
| This function to get uart input from user. 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_PowerChangeHandler (void *InstancePtr)
| This function is the callback function for when the power state 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_VideoHandler (void *InstancePtr)
| This function is the callback function for when a valid video interrupt occurs. More...
void | DpRxSs_InfoPacketHandler (void *InstancePtr)
| This function is the callback function for Info Packet Handling. More...
void | DpRxSs_ExtPacketHandler (void *InstancePtr)
| This function is the callback function for Generic Packet Handling of 32-Bytes payload. More...
void | DpRxSs_TrainingDoneHandler (void *InstancePtr)
| This function is the callback function for when the training done 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...
void | DpRxSs_BWChangeHandler (void *InstancePtr)
| This function is the callback function for PLL reset request. More...
void | DpRxSs_AccessLaneSetHandler (void *InstancePtr)
| This function is the callback function for Access lane set request. More...
void | DpRxSs_AccessLinkQualHandler (void *InstancePtr)
| This function is the callback function for Access link qual request. More...
void | DpRxSs_AccessErrorCounterHandler (void *InstancePtr)
| This function is the callback function for Access prbs error count. More...
void | DpRxSs_CRCTestEventHandler (void *InstancePtr)
| This function is the callback function for Test CRC Event request. More...
int | VideoFMC_Init (void)
| This function initializes VFMC. More...
void | Print_InfoPkt ()
| This function is the callback function for Info Packet Handling. More...
void | Print_ExtPkt ()
| This function is the callback function for Ext Packet Handling. More...
int | main ()
| This is the main function for XDpRxSs interrupt example. More...
void | I2C_Scan (u32 BaseAddress)
| This function scans VFMC- IIC. More...
u8 | i2c_read_dp141 (u32 I2CBaseAddress, u8 I2CSlaveAddress, u16 RegisterAddress)
| This function reads DP141 VFMC- IIC. More...

## Function Documentation

void AppHelp | ( |  | ) |

This function prints Menu.

Parameters

  None. |

Returns
  None.

Note
  None.

Referenced by DpRxSs_Main().

void CalculateCRC | ( | void |  | ) |

This function Calculates CRC values of Video components.

Parameters

  None. |

Returns
  None.

Note
  None.

References CustomWaitUs(), XDpRxSs::DpPtr, XDpRxSs_UsrOpt::LaneCount, and XDpRxSs::UsrOpt.

Referenced by DpRxSs_Main().

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

This function is called when DisplayPort Subsystem core requires delay or sleep.

It provides timer with predefined amount of loop iterations.

Parameters

  InstancePtr | is a pointer to the XDp instance.

Returns
  None.

Referenced by CalculateCRC(), and DpRxSs_SetupIntrSystem().

void DpRxSs_AccessErrorCounterHandler | ( | void * | InstancePtr | ) |

This function is the callback function for Access prbs error count.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs::DpPtr, I2C_MCDP6000_ADDR, XDpRxSs_MCDP6000_GetRegister(), and XDpRxSs_MCDP6000_Read_ErrorCounters().

Referenced by DpRxSs_SetupIntrSystem().

void DpRxSs_AccessLaneSetHandler | ( | void * | InstancePtr | ) |

This function is the callback function for Access lane set request.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

void DpRxSs_AccessLinkQualHandler | ( | void * | InstancePtr | ) |

This function is the callback function for Access link qual request.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs::DpPtr, I2C_MCDP6000_ADDR, XDpRxSs_MCDP6000_ClearCounter(), XDpRxSs_MCDP6000_DisablePrbs7_Rx(), and XDpRxSs_MCDP6000_EnablePrbs7_Rx().

Referenced by DpRxSs_SetupIntrSystem().

void DpRxSs_BWChangeHandler | ( | 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.

Referenced by DpRxSs_SetupIntrSystem().

void DpRxSs_CRCTestEventHandler | ( | void * | InstancePtr | ) |

This function is the callback function for Test CRC Event request.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs_Config::BaseAddress, XDpRxSs::Config, and XDpRxSs::DpPtr.

Referenced by DpRxSs_SetupIntrSystem().

void DpRxSs_ExtPacketHandler | ( | void * | InstancePtr | ) |

This function is the callback function for Generic Packet Handling of 32-Bytes payload.

This function is the callback function for when arrival of external (audio) packet interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs::DpPtr.

Referenced by DpRxSs_SetupIntrSystem().

void DpRxSs_InfoPacketHandler | ( | void * | InstancePtr | ) |

This function is the callback function for Info Packet Handling.

This function is the callback function for when an info packet interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

References XDpRxSs::DpPtr.

Referenced by DpRxSs_SetupIntrSystem().

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 DpRxSs_SetupIntrSystem().

u32 DpRxSs_Main | ( | u16 | DeviceId | ) |

This function is the main entry point for the design example using the XDpRxSs driver.

This function will setup the system with interrupts handlers.

Parameters

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

Returns
  - XST_FAILURE if the system setup failed.
  - XST_SUCCESS should never return since this function, if setup was successful, is blocking.

Note
  If system setup was successful, this function is blocking in order to illustrate interrupt handling taking place for different types interrupts. Refer xdprxss.h file for more info.

References AppHelp(), XDpRxSs_Config::BaseAddress, CalculateCRC(), XDpRxSs::DpPtr, DpRxSs_PlatformInit(), DpRxSs_Setup(), DpRxSs_SetupIntrSystem(), DpRxSs_VideoPhyInit(), I2C_MCDP6000_ADDR, XDpRxSs_UsrOpt::LaneCount, XDpRxSs_UsrOpt::LinkRate, XDpRxSs_UsrOpt::MstSupport, Print_ExtPkt(), Print_InfoPkt(), ReportVideoCRC(), XDpRxSs::UsrOpt, XDpRxSs::VBlankCount, XDpRxSs_AudioDisable, XDpRxSs_AudioEnable, XDpRxSs_CfgInitialize(), XDpRxSs_LookupConfig(), XDpRxSs_MCDP6000_GetRegister(), XDpRxSs_McDp6000_init(), XDpRxSs_MCDP6000_Read_ErrorCounters(), XDpRxSs_ReportCoreInfo(), XDpRxSs_ReportLinkInfo(), XDpRxSs_ReportMsaInfo(), XDpRxSs_SetLaneCount(), XDpRxSs_SetLinkRate(), XDpRxSs_Start(), and xil_getc().

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 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.

References I2C_IDT8N49_ADDR, IDT_8T49N24x_SetClock(), and VideoFMC_Init().

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

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 DpRxSs_SetupIntrSystem().

void DpRxSs_PowerChangeHandler | ( | void * | InstancePtr | ) |

This function is the callback function for when the power state interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

Referenced by DpRxSs_SetupIntrSystem().

u32 DpRxSs_Setup | ( | void |  | ) |

This function configures DisplayPort RX Subsystem.

Parameters

  None. |

Returns
  - XST_SUCCESS if DP RX Subsystem configured successfully.
  - XST_FAILURE, otherwise.

Note
  None.

Parameters

  None. |

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

Note
  None.

References XDpRxSs::DpPtr, and LoadEDID().

Referenced by DpRxSs_DebugExample(), DpRxSs_HdcpExample(), DpRxSs_IntrExample(), DpRxSs_Main(), 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().

Referenced by DpRxSs_IntrExample(), DpRxSs_Main(), and 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 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, and XDpRxSs_AudioDisable.

Referenced by 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, and XDpRxSs_AudioDisable.

Referenced by 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 DpRxSs_SetupIntrSystem().

void DpRxSs_VideoHandler | ( | void * | InstancePtr | ) |

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

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

Referenced by DpRxSs_SetupIntrSystem().

u32 DpRxSs_VideoPhyInit | ( | u16 | DeviceId | ) |

This function configures Video Phy.

Parameters

  None. |

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

Note
  None.

References PHY_Two_byte_set(), and PLLRefClkSel().

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

u8 i2c_read_dp141 | ( | u32 | I2CBaseAddress,
|  | u8 | I2CSlaveAddress,
|  | u16 | RegisterAddress
| ) |  |

This function reads DP141 VFMC- IIC.

Parameters

  None. |

Returns
  None.

Note
  None.

void I2C_Scan | ( | u32 | BaseAddress | ) |

This function scans VFMC- IIC.

Parameters

  None. |

Returns
  None.

Note
  None.

void LoadEDID | ( | void |  | ) |

This function load EDID content into EDID Memory.

User can change as per their requirement.

Parameters

  None. |

Returns
  None.

Note
  None.

Referenced by DpRxSs_Setup().

int main | ( |  | ) |

This is the main function for XDpRxSs interrupt example.

If the DpRxSs_Main function which setup the system succeeds, this function will wait for the interrupts.

Parameters

  None. |

Returns
  - XST_FAILURE if the interrupt example was unsuccessful.

Note
  Unless setup failed, main will never return since DpRxSs_Main is blocking (it is waiting on interrupts).

References DpRxSs_Main().

void PHY_Two_byte_set | ( | XVphy * | InstancePtr,
|  | u8 | Rx_to_two_byte
| ) |  |

This function sets GT in 16-bits (2-Byte) or 32-bits (4-Byte) mode.

Parameters

  InstancePtr | is a pointer to the Video PHY instance.

Returns
  None.

Note
  None.

Referenced by DpRxSs_VideoPhyInit().

void PLLRefClkSel | ( | XVphy * | InstancePtr,
|  | u8 | link_rate
| ) |  |

This function sets proper ref clk frequency and line rate.

Parameters

  InstancePtr | is a pointer to the Video PHY instance.

Returns
  None.

Note
  None.

Referenced by DpRxSs_LinkBandwidthHandler(), and DpRxSs_VideoPhyInit().

void Print_ExtPkt | ( |  | ) |

This function is the callback function for Ext Packet Handling.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

Referenced by DpRxSs_Main().

void Print_InfoPkt | ( |  | ) |

This function is the callback function for Info Packet Handling.

Parameters

  InstancePtr | is a pointer to the XDpRxSs instance.

Returns
  None.

Note
  None.

Referenced by DpRxSs_Main().

void ReportVideoCRC | ( | void |  | ) |

This function reports CRC values of Video components.

Parameters

  None. |

Returns
  None.

Note
  None.

Referenced by DpRxSs_Main().

int VideoFMC_Init | ( | void |  | ) |

This function initializes VFMC.

Parameters

  None. |

Returns
  None.

Note
  None.

References I2C_IDT8N49_ADDR, I2C_LMK03318_ADDR, I2C_MUX_ADDR, I2C_VFMCEXP_0_ADDR, I2C_VFMCEXP_1_ADDR, IDT_8T49N24x_Init(), and TI_LMK03318_PowerDown().

Referenced by DpRxSs_PlatformInit().

char xil_getc | ( | u32 | timeout_ms | ) |

This function to get uart input from user.

Parameters

  timeout_ms |

Returns
  - received charactor

Note
  None.

References XUartPs_RecvByte_NonBlocking().

Referenced by DpRxSs_Main().

char XUartPs_RecvByte_NonBlocking | ( |  | ) |

This function is a non-blocking UART return byte.

Parameters

  None. |

Returns
  None.

Note
  None.

Referenced by xil_getc().