dp: rx: Added callback for training pattern interrupts.

Signed-off-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
This commit is contained in:
Andrei-Liviu Simion 2015-01-16 14:39:33 -08:00 committed by Nava kishore Manne
parent 1b613594e3
commit de3fbb4466
2 changed files with 108 additions and 0 deletions

View file

@ -145,6 +145,27 @@ typedef struct {
passed to the bandwidth
change callback
function. */
XDptx_IntrHandler IntrTp1Handler; /**< Callback function for
training pattern 1
interrupts. */
void *IntrTp1CallbackRef; /**< A pointer to the user data
passed to the training
pattern 1 callback
function. */
XDptx_IntrHandler IntrTp2Handler; /**< Callback function for
training pattern 2
interrupts. */
void *IntrTp2CallbackRef; /**< A pointer to the user data
passed to the training
pattern 2 callback
function. */
XDptx_IntrHandler IntrTp3Handler; /**< Callback function for
training pattern 3
interrupts. */
void *IntrTp3CallbackRef; /**< A pointer to the user data
passed to the training
pattern 3 callback
function. */
} XDprx;
/**************************** Function Prototypes *****************************/
@ -182,5 +203,11 @@ void XDptx_SetIntrTrainingDoneHandler(XDptx *InstancePtr,
XDprx_IntrHandler CallbackFunc, void *CallbackRef);
void XDptx_SetIntrBwChangeHandler(XDptx *InstancePtr,
XDprx_IntrHandler CallbackFunc, void *CallbackRef);
void XDptx_SetIntrTp1Handler(XDptx *InstancePtr,
XDprx_IntrHandler CallbackFunc, void *CallbackRef);
void XDptx_SetIntrTp2Handler(XDptx *InstancePtr,
XDprx_IntrHandler CallbackFunc, void *CallbackRef);
void XDptx_SetIntrTp3Handler(XDptx *InstancePtr,
XDprx_IntrHandler CallbackFunc, void *CallbackRef);
#endif /* XDPRX_H_ */

View file

@ -268,3 +268,84 @@ void XDptx_SetIntrBwChangeHandler(XDptx *InstancePtr,
InstancePtr->IntrBwChangeHandler = CallbackFunc;
InstancePtr->IntrBwChangeCallbackRef = CallbackRef;
}
/******************************************************************************/
/**
* This function installs a callback function for when a training pattern 1
* 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_SetIntrTp1Handler(XDptx *InstancePtr,
XDprx_IntrHandler CallbackFunc, void *CallbackRef)
{
/* Verify arguments. */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(CallbackFunc != NULL);
Xil_AssertVoid(CallbackRef != NULL);
InstancePtr->IntrTp1Handler = CallbackFunc;
InstancePtr->IntrTp1CallbackRef = CallbackRef;
}
/******************************************************************************/
/**
* This function installs a callback function for when a training pattern 2
* 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_SetIntrTp2Handler(XDptx *InstancePtr,
XDprx_IntrHandler CallbackFunc, void *CallbackRef)
{
/* Verify arguments. */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(CallbackFunc != NULL);
Xil_AssertVoid(CallbackRef != NULL);
InstancePtr->IntrTp2Handler = CallbackFunc;
InstancePtr->IntrTp2CallbackRef = CallbackRef;
}
/******************************************************************************/
/**
* This function installs a callback function for when a training pattern 3
* 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_SetIntrTp3Handler(XDptx *InstancePtr,
XDprx_IntrHandler CallbackFunc, void *CallbackRef)
{
/* Verify arguments. */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(CallbackFunc != NULL);
Xil_AssertVoid(CallbackRef != NULL);
InstancePtr->IntrTp3Handler = CallbackFunc;
InstancePtr->IntrTp3CallbackRef = CallbackRef;
}