dp: rx: Added callback for power state change interrupts.
Signed-off-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
This commit is contained in:
parent
bdc15ffdfe
commit
c5b9fdac16
2 changed files with 36 additions and 0 deletions
|
@ -99,6 +99,13 @@ typedef struct {
|
|||
passed to the video mode
|
||||
change callback
|
||||
function. */
|
||||
XDptx_IntrHandler IntrPowerStateHandler; /**< Callback function for
|
||||
power state change
|
||||
interrupts. */
|
||||
void *IntrPowerStateCallbackRef; /**< A pointer to the user data
|
||||
passed to the power
|
||||
state change callback
|
||||
function. */
|
||||
} XDprx;
|
||||
|
||||
/**************************** Function Prototypes *****************************/
|
||||
|
@ -122,5 +129,7 @@ void XDprx_WaitUs(XDprx *InstancePtr, u32 MicroSeconds);
|
|||
/* xdprx_intr.c: Interrupt handling functions. */
|
||||
void XDptx_SetIntrVmChangeHandler(XDptx *InstancePtr,
|
||||
XDprx_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDptx_SetIntrPowerStateHandler(XDptx *InstancePtr,
|
||||
XDprx_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
|
||||
#endif /* XDPRX_H_ */
|
||||
|
|
|
@ -79,3 +79,30 @@ void XDptx_SetIntrVmChangeHandler(XDptx *InstancePtr,
|
|||
InstancePtr->IntrVmChangeHandler = CallbackFunc;
|
||||
InstancePtr->IntrVmChangeCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when the power state 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_SetIntrPowerStateHandler(XDptx *InstancePtr,
|
||||
XDprx_IntrHandler CallbackFunc, void *CallbackRef)
|
||||
{
|
||||
/* Verify arguments. */
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(CallbackFunc != NULL);
|
||||
Xil_AssertVoid(CallbackRef != NULL);
|
||||
|
||||
InstancePtr->IntrPowerStateHandler = CallbackFunc;
|
||||
InstancePtr->IntrPowerStateCallbackRef = CallbackRef;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue