dp: rx: Added audio info and extension packet received interrupt handlers.
XDp_RxSetIntrInfoPktHandler and XDp_RxSetIntrExtPktHandler. Signed-off-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
This commit is contained in:
parent
74cef5fbbb
commit
b45d77cbe5
2 changed files with 99 additions and 5 deletions
|
@ -222,8 +222,14 @@
|
|||
*
|
||||
* <b>Audio</b>
|
||||
*
|
||||
* The driver does not handle audio. For an example as to how to configure and
|
||||
* transmit audio, examples/xdptx_audio_example.c illustrates the required
|
||||
* The driver in RX mode of operation may received audio info and extension
|
||||
* packets. When this happens, if interrupts are enabled, the appropriate
|
||||
* handlers will be invoked.
|
||||
* Control functions are available for enabling, disabling, and resetting audio
|
||||
* in the DisplayPort RX core.
|
||||
*
|
||||
* The TX driver does not handle audio. For an example as to how to configure
|
||||
* and transmit audio, examples/xdptx_audio_example.c illustrates the required
|
||||
* sequence in the TX mode of operation. The user will need to configure the
|
||||
* audio source connected to the Displayport TX instance and set up the audio
|
||||
* info frame as per user requirements.
|
||||
|
@ -704,7 +710,21 @@ typedef struct {
|
|||
passed to the valid
|
||||
video callback
|
||||
function. */
|
||||
XDp_IntrHandler IntrTrainingDoneHandler;/**< Callback function for
|
||||
XDp_IntrHandler IntrInfoPktHandler; /**< Callback function for audio
|
||||
info packet received
|
||||
interrupts. */
|
||||
void *IntrInfoPktCallbackRef; /**< A pointer to the user data
|
||||
passed to the audio info
|
||||
packet callback
|
||||
function. */
|
||||
XDp_IntrHandler IntrExtPktHandler; /**< Callback function for audio
|
||||
extension packet
|
||||
received interrupts. */
|
||||
void *IntrExtPktCallbackRef; /**< A pointer to the user data
|
||||
passed to the audio
|
||||
extension packet
|
||||
callback function. */
|
||||
XDp_IntrHandler IntrTrainingDoneHandler; /**< Callback function for
|
||||
training done
|
||||
interrupts. */
|
||||
void *IntrTrainingDoneCallbackRef; /**< A pointer to the user data
|
||||
|
@ -857,6 +877,10 @@ void XDp_RxSetIntrTrainingLostHandler(XDp *InstancePtr,
|
|||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrVideoHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrInfoPktHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrExtPktHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrTrainingDoneHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrBwChangeHandler(XDp *InstancePtr,
|
||||
|
|
|
@ -396,6 +396,62 @@ void XDp_RxSetIntrVideoHandler(XDp *InstancePtr,
|
|||
InstancePtr->RxInstance.IntrVideoCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when an audio info packet
|
||||
* interrupt occurs.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the XDp 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 XDp_RxSetIntrInfoPktHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef)
|
||||
{
|
||||
/* Verify arguments. */
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX);
|
||||
Xil_AssertVoid(CallbackFunc != NULL);
|
||||
Xil_AssertVoid(CallbackRef != NULL);
|
||||
|
||||
InstancePtr->RxInstance.IntrInfoPktHandler = CallbackFunc;
|
||||
InstancePtr->RxInstance.IntrInfoPktCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when an audio extension packet
|
||||
* interrupt occurs.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the XDp 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 XDp_RxSetIntrExtPktHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef)
|
||||
{
|
||||
/* Verify arguments. */
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX);
|
||||
Xil_AssertVoid(CallbackFunc != NULL);
|
||||
Xil_AssertVoid(CallbackRef != NULL);
|
||||
|
||||
InstancePtr->RxInstance.IntrExtPktHandler = CallbackFunc;
|
||||
InstancePtr->RxInstance.IntrExtPktCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when a training done interrupt
|
||||
|
@ -623,8 +679,8 @@ static void XDp_RxInterruptHandler(XDp *InstancePtr)
|
|||
{
|
||||
u32 IntrStatus;
|
||||
u8 IntrVmChange, IntrPowerState, IntrNoVideo, IntrVBlank,
|
||||
IntrTrainingLost, IntrVideo, IntrTrainingDone, IntrBwChange,
|
||||
IntrTp1, IntrTp2, IntrTp3;
|
||||
IntrTrainingLost, IntrVideo, IntrInfoPkt, IntrExtPkt,
|
||||
IntrTrainingDone, IntrBwChange, IntrTp1, IntrTp2, IntrTp3;
|
||||
|
||||
/* Determine what kind of interrupt(s) occurred.
|
||||
* Note: XDP_RX_INTERRUPT_CAUSE is an RC (read-clear) register. */
|
||||
|
@ -637,6 +693,9 @@ static void XDp_RxInterruptHandler(XDp *InstancePtr)
|
|||
IntrTrainingLost = (IntrStatus &
|
||||
XDP_RX_INTERRUPT_CAUSE_TRAINING_LOST_MASK);
|
||||
IntrVideo = (IntrStatus & XDP_RX_INTERRUPT_CAUSE_VIDEO_MASK);
|
||||
|
||||
IntrInfoPkt = (IntrStatus & XDP_RX_INTERRUPT_CAUSE_INFO_PKT_MASK);
|
||||
IntrExtPkt = (IntrStatus & XDP_RX_INTERRUPT_CAUSE_EXT_PKT_MASK);
|
||||
IntrTrainingDone = (IntrStatus &
|
||||
XDP_RX_INTERRUPT_CAUSE_TRAINING_DONE_MASK);
|
||||
IntrBwChange = (IntrStatus & XDP_RX_INTERRUPT_CAUSE_BW_CHANGE_MASK);
|
||||
|
@ -707,4 +766,15 @@ static void XDp_RxInterruptHandler(XDp *InstancePtr)
|
|||
InstancePtr->RxInstance.IntrBwChangeHandler(
|
||||
InstancePtr->RxInstance.IntrBwChangeCallbackRef);
|
||||
}
|
||||
|
||||
/* An audio info packet has been received. */
|
||||
if (IntrInfoPkt) {
|
||||
InstancePtr->RxInstance.IntrInfoPktHandler(
|
||||
InstancePtr->RxInstance.IntrInfoPktCallbackRef);
|
||||
}
|
||||
/* An audio extension packet has been received. */
|
||||
if (IntrExtPkt) {
|
||||
InstancePtr->RxInstance.IntrExtPktHandler(
|
||||
InstancePtr->RxInstance.IntrExtPktCallbackRef);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue