XilinxProcessorIPLib/drivers/dp14/src/xdp_intr.c
static void XDp_TxInterruptHandler(XDp *InstancePtr)
{
	u32 IntrStatus;
	u8 HpdEventDetected;
	u8 HpdPulseDetected;
	u32 HpdDuration;

	/* Determine what kind of interrupt occurred.
	 * Note: XDP_TX_INTERRUPT_STATUS is an RC (read-clear) register. */
	IntrStatus = XDp_ReadReg(InstancePtr->Config.BaseAddr,
						XDP_TX_INTERRUPT_STATUS);
	IntrStatus &= ~XDp_ReadReg(InstancePtr->Config.BaseAddr,
						XDP_TX_INTERRUPT_MASK);

	HpdEventDetected = IntrStatus & XDP_TX_INTERRUPT_STATUS_HPD_EVENT_MASK;
	HpdPulseDetected = IntrStatus &
				XDP_TX_INTERRUPT_STATUS_HPD_PULSE_DETECTED_MASK;

	if (HpdEventDetected) {
		if (InstancePtr->TxInstance.DrvHpdEventHandler)
			InstancePtr->TxInstance.DrvHpdEventHandler(
				InstancePtr->TxInstance.DrvHpdEventCallbackRef);
		if (InstancePtr->TxInstance.HpdEventHandler)
			InstancePtr->TxInstance.HpdEventHandler(
				InstancePtr->TxInstance.HpdEventCallbackRef);
	}
	else if (HpdPulseDetected && XDp_TxIsConnected(InstancePtr)) {
		/* The source device must debounce the incoming HPD signal by
		 * sampling the value at an interval greater than 0.500 ms. An
		 * HPD pulse should be of width 0.5 ms - 1.0 ms. */
		HpdDuration = XDp_ReadReg(InstancePtr->Config.BaseAddr,
							XDP_TX_HPD_DURATION);
		if (HpdDuration >= 500) {
			if (InstancePtr->TxInstance.DrvHpdPulseHandler)
				InstancePtr->TxInstance.DrvHpdPulseHandler(
				InstancePtr->TxInstance.DrvHpdPulseCallbackRef);
			if (InstancePtr->TxInstance.HpdPulseHandler)
				InstancePtr->TxInstance.HpdPulseHandler(
				InstancePtr->TxInstance.HpdPulseCallbackRef);
		}
	}

	if(IntrStatus & XDP_TX_INTERRUPT_STATUS_EXT_PKT_TXD_MASK){
		if (InstancePtr->TxInstance.ExtPktCallbackHandler)
			InstancePtr->TxInstance.ExtPktCallbackHandler(
				InstancePtr->TxInstance.ExtPktCallbackHandlerRef);
		if (InstancePtr->TxInstance.DrvExtPktCallbackHandler)
			InstancePtr->TxInstance.DrvExtPktCallbackHandler(
				InstancePtr->TxInstance.DrvExtPktCallbackHandlerRef);
	}

	if(IntrStatus & XDP_TX_INTERRUPT_STATUS_VBLANK_STREAM1_MASK){
		if (InstancePtr->TxInstance.VsyncCallbackHandler)
			InstancePtr->TxInstance.VsyncCallbackHandler(
				InstancePtr->TxInstance.VsyncCallbackHandlerRef);
	}
}
/******************************************************************************/
/**
 * This function is the interrupt handler for the XDp driver operating in TX
 * mode.
 *
 * When an interrupt happens, it first detects what kind of interrupt happened,
 * then decides which callback function to invoke.
 *
 * @param	InstancePtr is a pointer to the XDp instance.
 *
 * @return	None.
 *
 * @note	None.
 *
*******************************************************************************/
This function is the interrupt handler for the XDp driver operating in TX
mode.

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

@param       InstancePtr is a pointer to the XDp instance.

@return      None.

@note        None.
This function is the interrupt handler for the XDp driver operating in TX mode . When an interrupt happens it first detects what kind of interrupt happened then decides which callback function to invoke . @param InstancePtr is a pointer to the XDp instance . @return None . @note None .
static void XDp_TxInterruptHandler(XDp *InstancePtr)
{
	u32 IntrStatus;
	u8 HpdEventDetected;
	u8 HpdPulseDetected;
	u32 HpdDuration;
	IntrStatus = XDp_ReadReg(InstancePtr->Config.BaseAddr,
						XDP_TX_INTERRUPT_STATUS);
	IntrStatus &= ~XDp_ReadReg(InstancePtr->Config.BaseAddr,
						XDP_TX_INTERRUPT_MASK);
	HpdEventDetected = IntrStatus & XDP_TX_INTERRUPT_STATUS_HPD_EVENT_MASK;
	HpdPulseDetected = IntrStatus &
				XDP_TX_INTERRUPT_STATUS_HPD_PULSE_DETECTED_MASK;
	if (HpdEventDetected) {
		if (InstancePtr->TxInstance.DrvHpdEventHandler)
			InstancePtr->TxInstance.DrvHpdEventHandler(
				InstancePtr->TxInstance.DrvHpdEventCallbackRef);
		if (InstancePtr->TxInstance.HpdEventHandler)
			InstancePtr->TxInstance.HpdEventHandler(
				InstancePtr->TxInstance.HpdEventCallbackRef);
	}
	else if (HpdPulseDetected && XDp_TxIsConnected(InstancePtr)) {
		HpdDuration = XDp_ReadReg(InstancePtr->Config.BaseAddr,
							XDP_TX_HPD_DURATION);
		if (HpdDuration >= 500) {
			if (InstancePtr->TxInstance.DrvHpdPulseHandler)
				InstancePtr->TxInstance.DrvHpdPulseHandler(
				InstancePtr->TxInstance.DrvHpdPulseCallbackRef);
			if (InstancePtr->TxInstance.HpdPulseHandler)
				InstancePtr->TxInstance.HpdPulseHandler(
				InstancePtr->TxInstance.HpdPulseCallbackRef);
		}
	}
	if(IntrStatus & XDP_TX_INTERRUPT_STATUS_EXT_PKT_TXD_MASK){
		if (InstancePtr->TxInstance.ExtPktCallbackHandler)
			InstancePtr->TxInstance.ExtPktCallbackHandler(
				InstancePtr->TxInstance.ExtPktCallbackHandlerRef);
		if (InstancePtr->TxInstance.DrvExtPktCallbackHandler)
			InstancePtr->TxInstance.DrvExtPktCallbackHandler(
				InstancePtr->TxInstance.DrvExtPktCallbackHandlerRef);
	}
	if(IntrStatus & XDP_TX_INTERRUPT_STATUS_VBLANK_STREAM1_MASK){
		if (InstancePtr->TxInstance.VsyncCallbackHandler)
			InstancePtr->TxInstance.VsyncCallbackHandler(
				InstancePtr->TxInstance.VsyncCallbackHandlerRef);
	}
}
static void XDp_TxInterruptHandler ( XDp * InstancePtr ) { u32 IntrStatus ; u8 HpdEventDetected ; u8 HpdPulseDetected ; u32 HpdDuration ; IntrStatus = XDp_ReadReg ( InstancePtr -> Config . BaseAddr , XDP_TX_INTERRUPT_STATUS ) ; IntrStatus &= ~ XDp_ReadReg ( InstancePtr -> Config . BaseAddr , XDP_TX_INTERRUPT_MASK ) ; HpdEventDetected = IntrStatus & XDP_TX_INTERRUPT_STATUS_HPD_EVENT_MASK ; HpdPulseDetected = IntrStatus & XDP_TX_INTERRUPT_STATUS_HPD_PULSE_DETECTED_MASK ; if ( HpdEventDetected ) { if ( InstancePtr -> TxInstance . DrvHpdEventHandler ) InstancePtr -> TxInstance . DrvHpdEventHandler ( InstancePtr -> TxInstance . DrvHpdEventCallbackRef ) ; if ( InstancePtr -> TxInstance . HpdEventHandler ) InstancePtr -> TxInstance . HpdEventHandler ( InstancePtr -> TxInstance . HpdEventCallbackRef ) ; } else if ( HpdPulseDetected && XDp_TxIsConnected ( InstancePtr ) ) { HpdDuration = XDp_ReadReg ( InstancePtr -> Config . BaseAddr , XDP_TX_HPD_DURATION ) ; if ( HpdDuration >= 500 ) { if ( InstancePtr -> TxInstance . DrvHpdPulseHandler ) InstancePtr -> TxInstance . DrvHpdPulseHandler ( InstancePtr -> TxInstance . DrvHpdPulseCallbackRef ) ; if ( InstancePtr -> TxInstance . HpdPulseHandler ) InstancePtr -> TxInstance . HpdPulseHandler ( InstancePtr -> TxInstance . HpdPulseCallbackRef ) ; } } if ( IntrStatus & XDP_TX_INTERRUPT_STATUS_EXT_PKT_TXD_MASK ) { if ( InstancePtr -> TxInstance . ExtPktCallbackHandler ) InstancePtr -> TxInstance . ExtPktCallbackHandler ( InstancePtr -> TxInstance . ExtPktCallbackHandlerRef ) ; if ( InstancePtr -> TxInstance . DrvExtPktCallbackHandler ) InstancePtr -> TxInstance . DrvExtPktCallbackHandler ( InstancePtr -> TxInstance . DrvExtPktCallbackHandlerRef ) ; } if ( IntrStatus & XDP_TX_INTERRUPT_STATUS_VBLANK_STREAM1_MASK ) { if ( InstancePtr -> TxInstance . VsyncCallbackHandler ) InstancePtr -> TxInstance . VsyncCallbackHandler ( InstancePtr -> TxInstance . VsyncCallbackHandlerRef ) ; } }
This function is the interrupt handler for the XDp driver operating in TX
 mode.
This function is the interrupt handler for the XDp driver operating in TX mode .
/* Determine what kind of interrupt occurred.
	 * Note: XDP_TX_INTERRUPT_STATUS is an RC (read-clear) register. */ /* The source device must debounce the incoming HPD signal by
		 * sampling the value at an interval greater than 0.500 ms. An
		 * HPD pulse should be of width 0.5 ms - 1.0 ms. */