示例#1
0
/**
 * The main entry point for the interrupt with timer example using the XDp
 * driver. This function will set up the system, interrupt controller and
 * interrupt handlers, and the custom sleep handler.
 *
 * @param	InstancePtr is a pointer to the XDp instance.
 * @param	DeviceId is the unique device ID of the DisplayPort RX core
 *		instance.
 * @param	IntcPtr is a pointer to the interrupt instance.
 * @param	IntrId is the unique device ID of the interrupt controller.
 * @param	DpIntrId is the interrupt ID of the DisplayPort RX connection to
 *		the interrupt controller.
 * @param	TimerCounterPtr is a pointer to the timer instance.
 * @param	TimerId is the ID of the timer controller to use for delays.
 *
 * @return
 *		- XST_SUCCESS if the system was set up correctly and link
 *		  training was successful.
 *		- XST_FAILURE otherwise.
 *
 * @note	None.
 *
*******************************************************************************/
u32 Dprx_SstExample(XDp *InstancePtr, u16 DeviceId, INTC *IntcPtr, u16 IntrId,
                    u16 DpIntrId, XTmrCtr *TimerCounterPtr, u16 TimerId)
{
    u32 Status;

    /* Do platform initialization here. This is hardware system specific -
     * it is up to the user to implement this function. */
    Dprx_PlatformInit(InstancePtr);
    /*******************/

    Status = Dprx_SetupExample(InstancePtr, DeviceId);
    if (Status != XST_SUCCESS) {
        return XST_FAILURE;
    }

    /* Set up a timer. */
    Dprx_SetupTimerHandler(InstancePtr, TimerCounterPtr, TimerId);

#ifdef USE_DP159
    /* Initialize and configure the DP159 retimer. */
    Status = Dprx_Dp159Setup(&IicInst, IIC_DEVICE_ID);
    if (Status != XST_SUCCESS) {
        return XST_FAILURE;
    }
#endif /* USE_DP159 */

    /* Set up interrupt handling in the system. */
    Status = Dprx_SetupInterruptHandler(InstancePtr, IntcPtr, IntrId,
                                        DpIntrId);
    if (Status != XST_SUCCESS) {
        return XST_FAILURE;
    }

    /* Do not return in order to allow interrupt handling to run. */
    while (1);

    return XST_SUCCESS;
}
/**
 * The main entry point for the interrupt with timer example using the XDp
 * driver. This function will set up the system, interrupt controller and
 * interrupt handlers, and the custom sleep handler.
 *
 * @param	InstancePtr is a pointer to the XDp instance.
 * @param	DeviceId is the unique device ID of the DisplayPort RX core
 *		instance.
 * @param	IntcPtr is a pointer to the interrupt instance.
 * @param	IntrId is the unique device ID of the interrupt controller.
 * @param	DpIntrId is the interrupt ID of the DisplayPort RX connection to
 *		the interrupt controller.
 * @param	TimerCounterPtr is a pointer to the timer instance.
 *
 * @return
 *		- XST_SUCCESS if the system was set up correctly and link
 *		  training was successful.
 *		- XST_FAILURE otherwise.
 *
 * @note	None.
 *
*******************************************************************************/
u32 Dprx_IntrTimerExample(XDp *InstancePtr, u16 DeviceId, INTC *IntcPtr,
			u16 IntrId, u16 DpIntrId, XTmrCtr *TimerCounterPtr)
{
	u32 Status;

	/* Do platform initialization here. This is hardware system specific -
	 * it is up to the user to implement this function. */
	Dprx_PlatformInit(InstancePtr);
	/*******************/

	Status = Dprx_SetupExample(InstancePtr, DeviceId);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Set a custom timer handler for improved delay accuracy on MicroBlaze
	 * systems since the driver does not assume/have a dependency on the
	 * system having a timer in the FPGA.
	 * Note: This only has an affect for MicroBlaze systems since the Zynq
	 * ARM SoC contains a timer, which is used when the driver calls the
	 * delay function. */
	XDp_SetUserTimerHandler(InstancePtr, &Dprx_CustomWaitUs,
							TimerCounterPtr);

	/* Setup interrupt handling in the system. */
	Status = Dprx_SetupInterruptHandler(InstancePtr, IntcPtr, IntrId,
								DpIntrId);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Do not return in order to allow interrupt handling to run. */
	while (1);

	return XST_SUCCESS;
}