Software Drivers

xdprx.h File Reference


Detailed Description

The Xilinx DisplayPort receiver (DPRX) driver. This driver supports the Xilinx DisplayPort soft IP core in receive (RX) mode.

Driver description

The device driver enables higher-level software (e.g., an application) to configure and control a DisplayPort RX soft IP.

This driver gives applications the ability to configure the RX using various settings, handle and issue interrupts, and modify a subset of its DisplayPort Configuration Data (DPCD) fields.

Interrupt processing

The DisplayPort RX driver may generate a pulse on the hot-plug-detect (HPD) signal line using the XDprx_GenerateHpdInterrupt function. This allows the RX to send an interrupt to the upstream TX device, useful for signaling the TX that it needs to do some checks for changes in downstream devices or a loss of link training.

For RX interrupt handling of HPD events or events that happen internal to the RX, the user hardware design must contain an interrupt controller which the DisplayPort RX instance's interrupt signal is connected to. The user application must enable interrupts in the system and set up the interrupt controller such that the XDprx_InterruptHandler handler will service interrupts. When the XDprx_InterruptHandler function is invoked, the handler will identify what type of interrupt has occurred, and will call the appropriate interrupt handler.

The DisplayPort RX's XDPRX_INTERRUPT_CAUSE register indicates the type of interrupt that has occured, and the XDprx_InterruptHandler will use this information to decide which handler to call.

The handlers are set up using the XDprx_SetIntr* functions.

Specific interrupts may be enabled or disabled using the XDprx_InterruptEnable and XDprx_InterruptDisable functions.

Multi-stream transport (MST) mode

The DisplayPort RX driver does not support MST functionality in 2015.1.

Audio

The driver does not handle audio.

Note:
None.
 MODIFICATION HISTORY:

 Ver   Who  Date     Changes
 ----- ---- -------- -----------------------------------------------
 1.0   als  01/20/14 Initial release.
 

#include "xdp.h"
#include "xdprx_hw.h"

Classes

struct  XDprx_LinkConfig
struct  XDprx

Typedefs

typedef void(*) XDprx_IntrHandler (void *InstancePtr)

Functions

void XDprx_CfgInitialize (XDprx *InstancePtr, XDp_Config *ConfigPtr, u32 EffectiveAddr)
u32 XDprx_InitializeRx (XDprx *InstancePtr)
u32 XDprx_CheckLinkStatus (XDprx *InstancePtr)
void XDprx_DtgEn (XDprx *InstancePtr)
void XDprx_DtgDis (XDprx *InstancePtr)
void XDprx_SetLinkRate (XDprx *InstancePtr, u8 LinkRate)
void XDprx_SetLaneCount (XDprx *InstancePtr, u8 LaneCount)
void XDprx_SetUserPixelWidth (XDprx *InstancePtr, u8 UserPixelWidth)
void XDprx_SetUserTimerHandler (XDprx *InstancePtr, XDp_TimerHandler CallbackFunc, void *CallbackRef)
void XDprx_WaitUs (XDprx *InstancePtr, u32 MicroSeconds)
void XDprx_InterruptHandler (XDprx *InstancePtr)
void XDprx_GenerateHpdInterrupt (XDprx *InstancePtr, u16 DurationUs)
void XDprx_InterruptEnable (XDprx *InstancePtr, u32 Mask)
void XDprx_InterruptDisable (XDprx *InstancePtr, u32 Mask)
void XDprx_SetIntrVmChangeHandler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrPowerStateHandler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrNoVideoHandler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrVBlankHandler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrTrainingLostHandler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrVideoHandler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrTrainingDoneHandler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrBwChangeHandler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrTp1Handler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrTp2Handler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
void XDprx_SetIntrTp3Handler (XDprx *InstancePtr, XDprx_IntrHandler CallbackFunc, void *CallbackRef)
u32 XDprx_SelfTest (XDprx *InstancePtr)


Typedef Documentation

typedef void(*) XDprx_IntrHandler(void *InstancePtr)

Callback type which represents the handler for interrupts.

Parameters:
InstancePtr is a pointer to the XDprx instance.
Note:
None.


Function Documentation

void XDprx_CfgInitialize ( XDprx InstancePtr,
XDp_Config ConfigPtr,
u32  EffectiveAddr 
)

This function retrieves the configuration for this DisplayPort RX instance and fills in the InstancePtr->Config structure.

Parameters:
InstancePtr is a pointer to the XDprx instance.
ConfigPtr is a pointer to the configuration structure that will be used to copy the settings from.
EffectiveAddr is the device base address in the virtual memory space. If the address translation is not used, then the physical address is passed.
Returns:
None.
Note:
Unexpected errors may occur if the address mapping is changed after this function is invoked.

u32 XDprx_CheckLinkStatus ( XDprx InstancePtr  ) 

This function checks if the reciever's internal registers indicate that link training has complete. That is, training has achieved channel equalization, symbol lock, and interlane alignment for all lanes currently in use.

Parameters:
InstancePtr is a pointer to the XDprx instance.
Returns:
  • XST_SUCCESS if the RX device has achieved clock recovery, channel equalization, symbol lock, and interlane alignment.
  • XST_FAILURE otherwise.
Note:
None.

void XDprx_DtgDis ( XDprx InstancePtr  ) 

This function disables the display timing generator (DTG).

Parameters:
InstancePtr is a pointer to the XDprx instance.
Returns:
None.
Note:
None.

void XDprx_DtgEn ( XDprx InstancePtr  ) 

This function enables the display timing generator (DTG).

Parameters:
InstancePtr is a pointer to the XDprx instance.
Returns:
None.
Note:
None.

void XDprx_GenerateHpdInterrupt ( XDprx InstancePtr,
u16  DurationUs 
)

This function generates a pulse on the hot-plug-detect (HPD) line of the specified duration.

Parameters:
InstancePtr is a pointer to the XDprx instance.
DurationUs is the duration of the HPD pulse, in microseconds.
Returns:
None.
Note:
None.

u32 XDprx_InitializeRx ( XDprx InstancePtr  ) 

This function prepares the DisplayPort RX core for use.

Parameters:
InstancePtr is a pointer to the XDprx instance.
Returns:
  • XST_SUCCESS if the DisplayPort RX core was successfully initialized.
  • XST_FAILURE otherwise.
Note:
None.

void XDprx_InterruptDisable ( XDprx InstancePtr,
u32  Mask 
)

This function disables interrupts associated with the specified mask.

Parameters:
InstancePtr is a pointer to the XDprx instance.
Mask specifies which interrupts should be disabled. Bits set to 1 will disable the corresponding interrupts.
Returns:
None.
Note:
None.

void XDprx_InterruptEnable ( XDprx InstancePtr,
u32  Mask 
)

This function enables interrupts associated with the specified mask.

Parameters:
InstancePtr is a pointer to the XDprx instance.
Mask specifies which interrupts should be enabled. Bits set to 1 will enable the corresponding interrupts.
Returns:
None.
Note:
None.

void XDprx_InterruptHandler ( XDprx InstancePtr  ) 

This function is the interrupt handler for the XDprx driver.

When an interrupt happens, it first detects what kind of interrupt happened, then decides which callback function to invoke.

Parameters:
InstancePtr is a pointer to the XDprx instance.
Returns:
None.
Note:
None.

u32 XDprx_SelfTest ( XDprx InstancePtr  ) 

This function runs a self-test on the XDprx driver/device. The sanity test checks whether or not all tested registers hold their default reset values.

Parameters:
InstancePtr is a pointer to the XDprx instance.
Returns:
  • XST_SUCCESS if the self-test passed - all tested registers hold their default reset values.
  • XST_FAILURE otherwise.
Note:
None.

void XDprx_SetIntrBwChangeHandler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when a bandwidth change interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrNoVideoHandler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when a no video interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrPowerStateHandler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when the power state interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrTp1Handler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when a training pattern 1 interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrTp2Handler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when a training pattern 2 interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrTp3Handler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when a training pattern 3 interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrTrainingDoneHandler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when a training done interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrTrainingLostHandler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when a training lost interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrVBlankHandler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when a vertical blanking interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrVideoHandler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a callback function for when a valid video interrupt occurs.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetIntrVmChangeHandler ( XDprx InstancePtr,
XDprx_IntrHandler  CallbackFunc,
void *  CallbackRef 
)

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

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item that will be passed to the callback function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_SetLaneCount ( XDprx InstancePtr,
u8  LaneCount 
)

This function sets the maximum lane count to be exposed in the RX device's DisplayPort Configuration Data (DPCD) registers.

Parameters:
InstancePtr is a pointer to the XDprx instance.
LaneCount is the number of lanes to be used over the main link.
Returns:
None.
Note:
None.

void XDprx_SetLinkRate ( XDprx InstancePtr,
u8  LinkRate 
)

This function sets the maximum data rate to be exposed in the RX device's DisplayPort Configuration Data (DPCD) registers.

Parameters:
InstancePtr is a pointer to the XDprx instance.
LinkRate is the link rate to be used over the main link based on one of the following selects:
  • XDPRX_LINK_BW_SET_162GBPS = 0x06 (for a 1.62 Gbps data rate)
  • XDPRX_LINK_BW_SET_270GBPS = 0x0A (for a 2.70 Gbps data rate)
  • XDPRX_LINK_BW_SET_540GBPS = 0x14 (for a 5.40 Gbps data rate)
Returns:
None.
Note:
None.

void XDprx_SetUserPixelWidth ( XDprx InstancePtr,
u8  UserPixelWidth 
)

This function configures the number of pixels output through the user data interface.

Parameters:
InstancePtr is a pointer to the XDprx instance.
UserPixelWidth is the user pixel width to be configured.
Returns:
None.
Note:
None.

void XDprx_SetUserTimerHandler ( XDprx InstancePtr,
XDp_TimerHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a custom delay/sleep function to be used by the XDprx driver.

Parameters:
InstancePtr is a pointer to the XDprx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item (microseconds to delay) that will be passed to the custom sleep/delay function when it is invoked.
Returns:
None.
Note:
None.

void XDprx_WaitUs ( XDprx InstancePtr,
u32  MicroSeconds 
)

This function is the delay/sleep function for the XDprx driver. For the Zynq family, there exists native sleep functionality. For MicroBlaze however, there does not exist such functionality. In the MicroBlaze case, the default method for delaying is to use a predetermined amount of loop iterations. This method is prone to inaccuracy and dependent on system configuration; for greater accuracy, the user may supply their own delay/sleep handler, pointed to by InstancePtr->UserTimerWaitUs, which may have better accuracy if a hardware timer is used.

Parameters:
InstancePtr is a pointer to the XDprx instance.
MicroSeconds is the number of microseconds to delay/sleep for.
Returns:
None.
Note:
None.

Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.