XilinxProcessorIPLib/drivers/v_hdmirx/src/xv_hdmirx_intr.c
static void HdmiRx_VtdIntrHandler(XV_HdmiRx *InstancePtr)
{
    u32 Status;
    XVidC_VideoMode DecodedVmId = 0;

    /* Read Video timing detector Status register */
    Status = XV_HdmiRx_ReadReg(InstancePtr->Config.BaseAddress,
		    (XV_HDMIRX_VTD_STA_OFFSET));

    /* Check for time base event */
    if ((Status) & (XV_HDMIRX_VTD_STA_TIMEBASE_EVT_MASK)) {

        // Clear event flag
        XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress,
			(XV_HDMIRX_VTD_STA_OFFSET),
			(XV_HDMIRX_VTD_STA_TIMEBASE_EVT_MASK));

        // Check if we are in lock state
        if (InstancePtr->Stream.State == XV_HDMIRX_STATE_STREAM_LOCK) {

            // Read video timing
            Status = XV_HdmiRx_GetVideoTiming(InstancePtr);

            if (Status == XST_SUCCESS) {
                if (InstancePtr->Stream.Vic != 0) {
                    DecodedVmId = XV_HdmiRx_LookupVmId(InstancePtr->Stream.Vic);

                    if (DecodedVmId != InstancePtr->Stream.Video.VmId &&
				    !(DecodedVmId == XVIDC_VM_NOT_SUPPORTED &&
						    InstancePtr->Stream.Video.VmId ==
								    XVIDC_VM_CUSTOM)) {
                        /* Call VIC error callback */
                        if (InstancePtr->VicErrorCallback) {
				InstancePtr->VicErrorCallback(
						InstancePtr->VicErrorRef);
                        }
                    }
                }

                // Enable AXI Stream output
                XV_HdmiRx_AxisEnable(InstancePtr, (TRUE));

                // Set stream status to up
                InstancePtr->Stream.State = XV_HDMIRX_STATE_STREAM_UP;

                // Set stream sync status to est
                InstancePtr->Stream.SyncStatus = XV_HDMIRX_SYNCSTAT_SYNC_EST;

                // Enable sync loss
                //XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress,
                //  (XV_HDMIRX_VTD_CTRL_SET_OFFSET), (XV_HDMIRX_VTD_CTRL_SYNC_LOSS_MASK));

                // Call stream up callback
                if (InstancePtr->IsStreamUpCallbackSet) {
                    InstancePtr->StreamUpCallback(InstancePtr->StreamUpRef);
                }
            }
        }

        // Check if we are in stream up state
        else if (InstancePtr->Stream.State == XV_HDMIRX_STATE_STREAM_UP) {

            // Read video timing
            Status = XV_HdmiRx_GetVideoTiming(InstancePtr);

            if (Status != XST_SUCCESS) {
                // Disable sync loss
                //XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress,
                //  (XV_HDMIRX_VTD_CTRL_CLR_OFFSET), (XV_HDMIRX_VTD_CTRL_SYNC_LOSS_MASK));

                // Set stream status to up
                InstancePtr->Stream.State = XV_HDMIRX_STATE_STREAM_LOCK;

            } else if (InstancePtr->Stream.SyncStatus == XV_HDMIRX_SYNCSTAT_SYNC_LOSS) {
            	// Sync Est/Recover Flag
            	InstancePtr->Stream.SyncStatus = XV_HDMIRX_SYNCSTAT_SYNC_EST;

				// Call sync lost callback
				if (InstancePtr->IsSyncLossCallbackSet) {
					InstancePtr->SyncLossCallback(InstancePtr->SyncLossRef);
				}
            }
        }

    }

    /* Check for sync loss event */
    else if ((Status) & (XV_HDMIRX_VTD_STA_SYNC_LOSS_EVT_MASK)) {

        // Clear event flag
        XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress, (XV_HDMIRX_VTD_STA_OFFSET), (XV_HDMIRX_VTD_STA_SYNC_LOSS_EVT_MASK));

        if (InstancePtr->Stream.State == XV_HDMIRX_STATE_STREAM_UP) {
        	// Enable the Stream Up + Sync Loss Flag
        	InstancePtr->Stream.SyncStatus = XV_HDMIRX_SYNCSTAT_SYNC_LOSS;

			// Call sync lost callback
			if (InstancePtr->IsSyncLossCallbackSet) {
				InstancePtr->SyncLossCallback(InstancePtr->SyncLossRef);
			}
        }
    }
}
/*****************************************************************************/
/**
*
* This function is the interrupt handler for the HDMI RX Timing Detector
* (TIMDET) peripheral.
*
* @param    InstancePtr is a pointer to the XV_HdmiRx core instance.
*
* @return   None.
*
* @note     None.
*
******************************************************************************/
This function is the interrupt handler for the HDMI RX Timing Detector
(TIMDET) peripheral.
This function is the interrupt handler for the HDMI RX Timing Detector ( TIMDET ) peripheral .
static void HdmiRx_VtdIntrHandler(XV_HdmiRx *InstancePtr)
{
    u32 Status;
    XVidC_VideoMode DecodedVmId = 0;
    Status = XV_HdmiRx_ReadReg(InstancePtr->Config.BaseAddress,
		    (XV_HDMIRX_VTD_STA_OFFSET));
    if ((Status) & (XV_HDMIRX_VTD_STA_TIMEBASE_EVT_MASK)) {
        XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress,
			(XV_HDMIRX_VTD_STA_OFFSET),
			(XV_HDMIRX_VTD_STA_TIMEBASE_EVT_MASK));
        if (InstancePtr->Stream.State == XV_HDMIRX_STATE_STREAM_LOCK) {
            Status = XV_HdmiRx_GetVideoTiming(InstancePtr);
            if (Status == XST_SUCCESS) {
                if (InstancePtr->Stream.Vic != 0) {
                    DecodedVmId = XV_HdmiRx_LookupVmId(InstancePtr->Stream.Vic);
                    if (DecodedVmId != InstancePtr->Stream.Video.VmId &&
				    !(DecodedVmId == XVIDC_VM_NOT_SUPPORTED &&
						    InstancePtr->Stream.Video.VmId ==
								    XVIDC_VM_CUSTOM)) {
                        if (InstancePtr->VicErrorCallback) {
				InstancePtr->VicErrorCallback(
						InstancePtr->VicErrorRef);
                        }
                    }
                }
                XV_HdmiRx_AxisEnable(InstancePtr, (TRUE));
                InstancePtr->Stream.State = XV_HDMIRX_STATE_STREAM_UP;
                InstancePtr->Stream.SyncStatus = XV_HDMIRX_SYNCSTAT_SYNC_EST;
                if (InstancePtr->IsStreamUpCallbackSet) {
                    InstancePtr->StreamUpCallback(InstancePtr->StreamUpRef);
                }
            }
        }
        else if (InstancePtr->Stream.State == XV_HDMIRX_STATE_STREAM_UP) {
            Status = XV_HdmiRx_GetVideoTiming(InstancePtr);
            if (Status != XST_SUCCESS) {
                InstancePtr->Stream.State = XV_HDMIRX_STATE_STREAM_LOCK;
            } else if (InstancePtr->Stream.SyncStatus == XV_HDMIRX_SYNCSTAT_SYNC_LOSS) {
            	InstancePtr->Stream.SyncStatus = XV_HDMIRX_SYNCSTAT_SYNC_EST;
				if (InstancePtr->IsSyncLossCallbackSet) {
					InstancePtr->SyncLossCallback(InstancePtr->SyncLossRef);
				}
            }
        }
    }
    else if ((Status) & (XV_HDMIRX_VTD_STA_SYNC_LOSS_EVT_MASK)) {
        XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress, (XV_HDMIRX_VTD_STA_OFFSET), (XV_HDMIRX_VTD_STA_SYNC_LOSS_EVT_MASK));
        if (InstancePtr->Stream.State == XV_HDMIRX_STATE_STREAM_UP) {
        	InstancePtr->Stream.SyncStatus = XV_HDMIRX_SYNCSTAT_SYNC_LOSS;
			if (InstancePtr->IsSyncLossCallbackSet) {
				InstancePtr->SyncLossCallback(InstancePtr->SyncLossRef);
			}
        }
    }
}
static void HdmiRx_VtdIntrHandler ( XV_HdmiRx * InstancePtr ) { u32 Status ; XVidC_VideoMode DecodedVmId = 0 ; Status = XV_HdmiRx_ReadReg ( InstancePtr -> Config . BaseAddress , ( XV_HDMIRX_VTD_STA_OFFSET ) ) ; if ( ( Status ) & ( XV_HDMIRX_VTD_STA_TIMEBASE_EVT_MASK ) ) { XV_HdmiRx_WriteReg ( InstancePtr -> Config . BaseAddress , ( XV_HDMIRX_VTD_STA_OFFSET ) , ( XV_HDMIRX_VTD_STA_TIMEBASE_EVT_MASK ) ) ; if ( InstancePtr -> Stream . State == XV_HDMIRX_STATE_STREAM_LOCK ) { Status = XV_HdmiRx_GetVideoTiming ( InstancePtr ) ; if ( Status == XST_SUCCESS ) { if ( InstancePtr -> Stream . Vic != 0 ) { DecodedVmId = XV_HdmiRx_LookupVmId ( InstancePtr -> Stream . Vic ) ; if ( DecodedVmId != InstancePtr -> Stream . Video . VmId && ! ( DecodedVmId == XVIDC_VM_NOT_SUPPORTED && InstancePtr -> Stream . Video . VmId == XVIDC_VM_CUSTOM ) ) { if ( InstancePtr -> VicErrorCallback ) { InstancePtr -> VicErrorCallback ( InstancePtr -> VicErrorRef ) ; } } } XV_HdmiRx_AxisEnable ( InstancePtr , ( TRUE ) ) ; InstancePtr -> Stream . State = XV_HDMIRX_STATE_STREAM_UP ; InstancePtr -> Stream . SyncStatus = XV_HDMIRX_SYNCSTAT_SYNC_EST ; if ( InstancePtr -> IsStreamUpCallbackSet ) { InstancePtr -> StreamUpCallback ( InstancePtr -> StreamUpRef ) ; } } } else if ( InstancePtr -> Stream . State == XV_HDMIRX_STATE_STREAM_UP ) { Status = XV_HdmiRx_GetVideoTiming ( InstancePtr ) ; if ( Status != XST_SUCCESS ) { InstancePtr -> Stream . State = XV_HDMIRX_STATE_STREAM_LOCK ; } else if ( InstancePtr -> Stream . SyncStatus == XV_HDMIRX_SYNCSTAT_SYNC_LOSS ) { InstancePtr -> Stream . SyncStatus = XV_HDMIRX_SYNCSTAT_SYNC_EST ; if ( InstancePtr -> IsSyncLossCallbackSet ) { InstancePtr -> SyncLossCallback ( InstancePtr -> SyncLossRef ) ; } } } } else if ( ( Status ) & ( XV_HDMIRX_VTD_STA_SYNC_LOSS_EVT_MASK ) ) { XV_HdmiRx_WriteReg ( InstancePtr -> Config . BaseAddress , ( XV_HDMIRX_VTD_STA_OFFSET ) , ( XV_HDMIRX_VTD_STA_SYNC_LOSS_EVT_MASK ) ) ; if ( InstancePtr -> Stream . State == XV_HDMIRX_STATE_STREAM_UP ) { InstancePtr -> Stream . SyncStatus = XV_HDMIRX_SYNCSTAT_SYNC_LOSS ; if ( InstancePtr -> IsSyncLossCallbackSet ) { InstancePtr -> SyncLossCallback ( InstancePtr -> SyncLossRef ) ; } } } }
This function is the interrupt handler for the HDMI RX Timing Detector
(TIMDET) peripheral.
This function is the interrupt handler for the HDMI RX Timing Detector ( TIMDET ) peripheral .
/* Read Video timing detector Status register */ /* Check for time base event */ // Clear event flag // Check if we are in lock state // Read video timing /* Call VIC error callback */ // Enable AXI Stream output // Set stream status to up // Set stream sync status to est // Enable sync loss //XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress, //  (XV_HDMIRX_VTD_CTRL_SET_OFFSET), (XV_HDMIRX_VTD_CTRL_SYNC_LOSS_MASK)); // Call stream up callback // Check if we are in stream up state // Read video timing // Disable sync loss //XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress, //  (XV_HDMIRX_VTD_CTRL_CLR_OFFSET), (XV_HDMIRX_VTD_CTRL_SYNC_LOSS_MASK)); // Set stream status to up // Sync Est/Recover Flag // Call sync lost callback /* Check for sync loss event */ // Clear event flag // Enable the Stream Up + Sync Loss Flag // Call sync lost callback