diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdprx.h b/XilinxProcessorIPLib/drivers/dp/src/xdprx.h index 793069a4..c752b9f1 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdprx.h +++ b/XilinxProcessorIPLib/drivers/dp/src/xdprx.h @@ -61,6 +61,17 @@ typedef struct { link. */ } XDprx_LinkConfig; +/******************************************************************************/ +/** + * Callback type which represents the handler for interrupts. + * + * @param InstancePtr is a pointer to the XDprx instance. + * + * @note None. + * +*******************************************************************************/ +typedef void (*XDprx_IntrHandler)(void *InstancePtr); + /** * The XDprx driver instance data. The user is required to allocate a variable * of this type for every XDprx device in the system. A pointer to a variable of @@ -81,6 +92,13 @@ typedef struct { void *UserTimerPtr; /**< Pointer to a timer instance used by the custom user delay/sleep function. */ + XDptx_IntrHandler IntrVmChangeHandler; /**< Callback function for video + mode change + interrupts. */ + void *IntrVmChangeCallbackRef; /**< A pointer to the user data + passed to the video mode + change callback + function. */ } XDprx; /**************************** Function Prototypes *****************************/ @@ -101,4 +119,8 @@ void XDprx_SetUserTimerHandler(XDprx *InstancePtr, XDp_TimerHandler CallbackFunc, void *CallbackRef); void XDprx_WaitUs(XDprx *InstancePtr, u32 MicroSeconds); +/* xdprx_intr.c: Interrupt handling functions. */ +void XDptx_SetIntrVmChangeHandler(XDptx *InstancePtr, + XDprx_IntrHandler CallbackFunc, void *CallbackRef); + #endif /* XDPRX_H_ */ diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdprx_intr.c b/XilinxProcessorIPLib/drivers/dp/src/xdprx_intr.c new file mode 100644 index 00000000..b7b1b257 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/dp/src/xdprx_intr.c @@ -0,0 +1,81 @@ +/******************************************************************************* + * + * Copyright (C) 2015 Xilinx, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * Use of the Software is limited solely to applications: + * (a) running on a Xilinx device, or + * (b) that interact with a Xilinx device through a bus or interconnect. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of the Xilinx shall not be used + * in advertising or otherwise to promote the sale, use or other dealings in + * this Software without prior written authorization from Xilinx. + * +*******************************************************************************/ +/******************************************************************************/ +/** + * + * @file xdprx_intr.c + * + * This file contains functions related to XDprx interrupt handling. + * + * @note None. + * + *
+ * MODIFICATION HISTORY:
+ *
+ * Ver   Who  Date     Changes
+ * ----- ---- -------- -----------------------------------------------
+ * 
+ * +*******************************************************************************/ + +/******************************* Include Files ********************************/ + +#include "xdprx.h" + +/**************************** Function Definitions ****************************/ + +/******************************************************************************/ +/** + * This function installs a callback function for when a video mode change + * interrupt occurs. + * + * @param InstancePtr is a pointer to the XDprx instance. + * @param CallbackFunc is the address to the callback function. + * @param CallbackRef is the user data item that will be passed to the + * callback function when it is invoked. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ +void XDptx_SetIntrVmChangeHandler(XDptx *InstancePtr, + XDprx_IntrHandler CallbackFunc, void *CallbackRef) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(CallbackFunc != NULL); + Xil_AssertVoid(CallbackRef != NULL); + + InstancePtr->IntrVmChangeHandler = CallbackFunc; + InstancePtr->IntrVmChangeCallbackRef = CallbackRef; +}