XilinxProcessorIPLib/drivers/dpdma/examples/xdppsu_interrupt.c
void DpPsu_IsrHpdPulse(void *ref)
{
	u32 Status;
	XDpPsu *DpPsuPtr = ((Run_Config *)ref)->DpPsuPtr;
	xil_printf("HPD pulse ..........\n\r");

	Status = XDpPsu_CheckLinkStatus(DpPsuPtr, DpPsuPtr->LinkConfig.LaneCount);
	if (Status == XST_DEVICE_NOT_FOUND) {
		xil_printf("Lost connection .......... HPD pulse\n\r");
		return;
	}

	xil_printf("\t! Re-training required.\n\r");

	XDpPsu_EnableMainLink(DpPsuPtr, 0);

	u8 Count = 0;
	do {
		Count++;

		Status = DpPsu_Hpd_Train((Run_Config *)ref);
		if (Status == XST_DEVICE_NOT_FOUND) {
			xil_printf("Lost connection .......... HPD pulse\n\r");
			return;
		}
		else if (Status != XST_SUCCESS) {
			continue;
		}

		DpPsu_SetupVideoStream((Run_Config *)ref);
		XDpPsu_EnableMainLink(DpPsuPtr, 1);

		Status = XDpPsu_CheckLinkStatus(DpPsuPtr, DpPsuPtr->LinkConfig.LaneCount);
		if (Status == XST_DEVICE_NOT_FOUND) {
			xil_printf("Lost connection .......... HPD pulse\n\r");
			return;
		}
	} while ((Status != XST_SUCCESS) && (Count < 2));

	xil_printf(".......... HPD pulse\n\r");
}
/******************************************************************************/
/**
 * This function is called when a Hot-Plug-Detect (HPD) pulse is received by the
 * DisplayPort TX core. The XDPPSU_INTERRUPT_STATUS_HPD_PULSE_DETECTED_MASK bit
 * of the core's XDPPSU_INTERRUPT_STATUS register indicates that an HPD event has
 * occurred.
 *
 * @param	InstancePtr is a pointer to the XDpPsu instance.
 *
 * @return	None.
 *
 * @note	Use the XDpPsu_SetHpdPulseHandler driver function to set this
 *		function as the handler for HPD pulses.
 *
*******************************************************************************/
This function is called when a Hot-Plug-Detect (HPD) pulse is received by the
DisplayPort TX core. The XDPPSU_INTERRUPT_STATUS_HPD_PULSE_DETECTED_MASK bit
of the core's XDPPSU_INTERRUPT_STATUS register indicates that an HPD event has
occurred.

@param       InstancePtr is a pointer to the XDpPsu instance.

@return      None.

@note        Use the XDpPsu_SetHpdPulseHandler driver function to set this
function as the handler for HPD pulses.
This function is called when a Hot - Plug - Detect ( HPD ) pulse is received by the DisplayPort TX core . The XDPPSU_INTERRUPT_STATUS_HPD_PULSE_DETECTED_MASK bit of the core ' s XDPPSU_INTERRUPT_STATUS register indicates that an HPD event has occurred . @param InstancePtr is a pointer to the XDpPsu instance . @return None . @note Use the XDpPsu_SetHpdPulseHandler driver function to set this function as the handler for HPD pulses .
void DpPsu_IsrHpdPulse(void *ref)
{
	u32 Status;
	XDpPsu *DpPsuPtr = ((Run_Config *)ref)->DpPsuPtr;
	xil_printf("HPD pulse ..........\n\r");
	Status = XDpPsu_CheckLinkStatus(DpPsuPtr, DpPsuPtr->LinkConfig.LaneCount);
	if (Status == XST_DEVICE_NOT_FOUND) {
		xil_printf("Lost connection .......... HPD pulse\n\r");
		return;
	}
	xil_printf("\t! Re-training required.\n\r");
	XDpPsu_EnableMainLink(DpPsuPtr, 0);
	u8 Count = 0;
	do {
		Count++;
		Status = DpPsu_Hpd_Train((Run_Config *)ref);
		if (Status == XST_DEVICE_NOT_FOUND) {
			xil_printf("Lost connection .......... HPD pulse\n\r");
			return;
		}
		else if (Status != XST_SUCCESS) {
			continue;
		}
		DpPsu_SetupVideoStream((Run_Config *)ref);
		XDpPsu_EnableMainLink(DpPsuPtr, 1);
		Status = XDpPsu_CheckLinkStatus(DpPsuPtr, DpPsuPtr->LinkConfig.LaneCount);
		if (Status == XST_DEVICE_NOT_FOUND) {
			xil_printf("Lost connection .......... HPD pulse\n\r");
			return;
		}
	} while ((Status != XST_SUCCESS) && (Count < 2));
	xil_printf(".......... HPD pulse\n\r");
}
void DpPsu_IsrHpdPulse ( void * ref ) { u32 Status ; XDpPsu * DpPsuPtr = ( ( Run_Config * ) ref ) -> DpPsuPtr ; xil_printf ( " \n \r " ) ; Status = XDpPsu_CheckLinkStatus ( DpPsuPtr , DpPsuPtr -> LinkConfig . LaneCount ) ; if ( Status == XST_DEVICE_NOT_FOUND ) { xil_printf ( " \n \r " ) ; return ; } xil_printf ( " \t \n \r " ) ; XDpPsu_EnableMainLink ( DpPsuPtr , 0 ) ; u8 Count = 0 ; do { Count ++ ; Status = DpPsu_Hpd_Train ( ( Run_Config * ) ref ) ; if ( Status == XST_DEVICE_NOT_FOUND ) { xil_printf ( " \n \r " ) ; return ; } else if ( Status != XST_SUCCESS ) { continue ; } DpPsu_SetupVideoStream ( ( Run_Config * ) ref ) ; XDpPsu_EnableMainLink ( DpPsuPtr , 1 ) ; Status = XDpPsu_CheckLinkStatus ( DpPsuPtr , DpPsuPtr -> LinkConfig . LaneCount ) ; if ( Status == XST_DEVICE_NOT_FOUND ) { xil_printf ( " \n \r " ) ; return ; } } while ( ( Status != XST_SUCCESS ) && ( Count < 2 ) ) ; xil_printf ( " \n \r " ) ; }
This function is called when a Hot-Plug-Detect (HPD) pulse is received by the
 DisplayPort TX core.
This function is called when a Hot - Plug - Detect ( HPD ) pulse is received by the DisplayPort TX core .