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.
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 void(*) XDprx_IntrHandler(void *InstancePtr) |
Callback type which represents the handler for interrupts.
InstancePtr | is a pointer to the XDprx instance. |
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.
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. |
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.
InstancePtr | is a pointer to the XDprx instance. |
void XDprx_DtgDis | ( | XDprx * | InstancePtr | ) |
This function disables the display timing generator (DTG).
InstancePtr | is a pointer to the XDprx instance. |
void XDprx_DtgEn | ( | XDprx * | InstancePtr | ) |
This function enables the display timing generator (DTG).
InstancePtr | is a pointer to the XDprx instance. |
void XDprx_GenerateHpdInterrupt | ( | XDprx * | InstancePtr, | |
u16 | DurationUs | |||
) |
This function generates a pulse on the hot-plug-detect (HPD) line of the specified duration.
InstancePtr | is a pointer to the XDprx instance. | |
DurationUs | is the duration of the HPD pulse, in microseconds. |
u32 XDprx_InitializeRx | ( | XDprx * | InstancePtr | ) |
This function prepares the DisplayPort RX core for use.
InstancePtr | is a pointer to the XDprx instance. |
void XDprx_InterruptDisable | ( | XDprx * | InstancePtr, | |
u32 | Mask | |||
) |
This function disables interrupts associated with the specified mask.
InstancePtr | is a pointer to the XDprx instance. | |
Mask | specifies which interrupts should be disabled. Bits set to 1 will disable the corresponding interrupts. |
void XDprx_InterruptEnable | ( | XDprx * | InstancePtr, | |
u32 | Mask | |||
) |
This function enables interrupts associated with the specified mask.
InstancePtr | is a pointer to the XDprx instance. | |
Mask | specifies which interrupts should be enabled. Bits set to 1 will enable the corresponding interrupts. |
void XDprx_InterruptHandler | ( | XDprx * | InstancePtr | ) |
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.
InstancePtr | is a pointer to the XDprx instance. |
void XDprx_SetIntrBwChangeHandler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a bandwidth change interrupt occurs.
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. |
void XDprx_SetIntrNoVideoHandler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a no video interrupt occurs.
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. |
void XDprx_SetIntrPowerStateHandler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when the power state interrupt occurs.
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. |
void XDprx_SetIntrTp1Handler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a training pattern 1 interrupt occurs.
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. |
void XDprx_SetIntrTp2Handler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a training pattern 2 interrupt occurs.
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. |
void XDprx_SetIntrTp3Handler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a training pattern 3 interrupt occurs.
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. |
void XDprx_SetIntrTrainingDoneHandler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a training done interrupt occurs.
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. |
void XDprx_SetIntrTrainingLostHandler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a training lost interrupt occurs.
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. |
void XDprx_SetIntrVBlankHandler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a vertical blanking interrupt occurs.
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. |
void XDprx_SetIntrVideoHandler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a valid video interrupt occurs.
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. |
void XDprx_SetIntrVmChangeHandler | ( | XDprx * | InstancePtr, | |
XDprx_IntrHandler | CallbackFunc, | |||
void * | CallbackRef | |||
) |
This function installs a callback function for when a video mode change interrupt occurs.
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. |
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.
InstancePtr | is a pointer to the XDprx instance. | |
LaneCount | is the number of lanes to be used over the main link. |
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.
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:
|
void XDprx_SetUserPixelWidth | ( | XDprx * | InstancePtr, | |
u8 | UserPixelWidth | |||
) |
This function configures the number of pixels output through the user data interface.
InstancePtr | is a pointer to the XDprx instance. | |
UserPixelWidth | is the user pixel width to be configured. |
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.
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. |
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.
InstancePtr | is a pointer to the XDprx instance. | |
MicroSeconds | is the number of microseconds to delay/sleep for. |
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.