XilinxProcessorIPLib/drivers/v_hdmirxss/src/xv_hdmirxss.c
int XV_HdmiRxSs_SetCallback(XV_HdmiRxSs *InstancePtr,
		XV_HdmiRxSs_HandlerType HandlerType,
		void *CallbackFunc,
		void *CallbackRef)
{
    u32 Status;

    /* Verify arguments. */
    Xil_AssertNonvoid(InstancePtr != NULL);
    Xil_AssertNonvoid(HandlerType >= (XV_HDMIRXSS_HANDLER_CONNECT));
    Xil_AssertNonvoid(CallbackFunc != NULL);
    Xil_AssertNonvoid(CallbackRef != NULL);

    /* Check for handler type */
    switch (HandlerType) {

        case (XV_HDMIRXSS_HANDLER_CONNECT):
            InstancePtr->ConnectCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->ConnectRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        case (XV_HDMIRXSS_HANDLER_BRDGOVERFLOW):
            InstancePtr->BrdgOverflowCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->BrdgOverflowRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        case (XV_HDMIRXSS_HANDLER_AUX):
            InstancePtr->AuxCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->AuxRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        case (XV_HDMIRXSS_HANDLER_AUD):
            InstancePtr->AudCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->AudRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        case (XV_HDMIRXSS_HANDLER_LNKSTA):
            InstancePtr->LnkStaCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->LnkStaRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        // Ddc
        case (XV_HDMIRXSS_HANDLER_DDC):
            InstancePtr->DdcCallback =(XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->DdcRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        // Stream down
        case (XV_HDMIRXSS_HANDLER_STREAM_DOWN):
            InstancePtr->StreamDownCallback =(XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->StreamDownRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        // Stream Init
        case (XV_HDMIRXSS_HANDLER_STREAM_INIT):
            InstancePtr->StreamInitCallback =(XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->StreamInitRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        // Stream up
        case (XV_HDMIRXSS_HANDLER_STREAM_UP):
            InstancePtr->StreamUpCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->StreamUpRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        // TMDS_CLK_RATIO
        case (XV_HDMIRXSS_HANDLER_TMDS_CLK_RATIO):
            InstancePtr->TmdsClkRatioCallback =
                                  (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->TmdsClkRatioRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        // VIC_ERROR
        case (XV_HDMIRXSS_HANDLER_VIC_ERROR):
            InstancePtr->VicErrorCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->VicErrorRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        // HDCP
        case (XV_HDMIRXSS_HANDLER_HDCP):
            InstancePtr->HdcpCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->HdcpRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;

        // HDCP authenticated
        case (XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATED):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            // Register HDCP 1.4 callbacks
            if (InstancePtr->Hdcp14Ptr) {
              XHdcp1x_SetCallback(InstancePtr->Hdcp14Ptr,
                                  XHDCP1X_HANDLER_AUTHENTICATED,
                                  (void *)(XHdcp1x_Callback)CallbackFunc,
                                  (void *)CallbackRef);
            }
#endif

#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            // Register HDCP 2.2 callbacks
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_AUTHENTICATED,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;

        // HDCP authenticated
        case (XV_HDMIRXSS_HANDLER_HDCP_UNAUTHENTICATED):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            // Register HDCP 1.4 callbacks
            if (InstancePtr->Hdcp14Ptr) {
              XHdcp1x_SetCallback(InstancePtr->Hdcp14Ptr,
                                XHDCP1X_HANDLER_UNAUTHENTICATED,
                                (void *)(XHdcp1x_Callback)CallbackFunc,
                                (void *)CallbackRef);
            }
#endif

#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            // Register HDCP 2.2 callbacks
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_UNAUTHENTICATED,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;

        // HDCP authentication request
        case (XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATION_REQUEST):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            // Register HDCP 1.4 callbacks
            if (InstancePtr->Hdcp14Ptr) {
        //Register the hdcp trigger downstream authentication callback
               XHdcp1x_SetCallBack(InstancePtr->Hdcp14Ptr,
                                   (XHdcp1x_HandlerType) XHDCP1X_RPTR_HDLR_TRIG_DOWNSTREAM_AUTH,
                                   (void *) (XHdcp1x_Callback)CallbackFunc,
                                   (void *) CallbackRef);
            }
#endif

#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            // Register HDCP 2.2 callbacks
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_AUTHENTICATION_REQUEST,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;

        // HDCP stream management request
        case (XV_HDMIRXSS_HANDLER_HDCP_STREAM_MANAGE_REQUEST):
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            // Register HDCP 2.2 callbacks
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_STREAM_MANAGE_REQUEST,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;

        // HDCP topology update request
        case (XV_HDMIRXSS_HANDLER_HDCP_TOPOLOGY_UPDATE):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            // Register HDCP 1.4 callbacks
            if (InstancePtr->Hdcp14Ptr) {
              XHdcp1x_SetCallback(InstancePtr->Hdcp14Ptr,
                                  XHDCP1X_HANDLER_TOPOLOGY_UPDATE,
                                  (void *)(XHdcp1x_Callback)CallbackFunc,
                                  (void *)CallbackRef);
            }
#endif

#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            // Register HDCP 2.2 callbacks
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_TOPOLOGY_UPDATE,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;

        // HDCP encryption status update
        case (XV_HDMIRXSS_HANDLER_HDCP_ENCRYPTION_UPDATE):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            // Register HDCP 1.4 callbacks
            if (InstancePtr->Hdcp14Ptr) {
        XHdcp1x_SetCallback(InstancePtr->Hdcp14Ptr,
                                 XHDCP1X_HANDLER_ENCRYPTION_UPDATE,
                                 (void *)(XHdcp1x_Callback)CallbackFunc,
                                 (void *)CallbackRef);
            }
#endif

#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            // Register HDCP 2.2 callbacks
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_ENCRYPTION_UPDATE,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;

        default:
            Status = (XST_INVALID_PARAM);
            break;
    }

    return Status;
}
/*****************************************************************************/
/**
*
* This function installs an asynchronous callback function for the given
* HandlerType:
*
* <pre>
* HandlerType                     Callback Function Type
* -----------------------         --------------------------------------------------
* (XV_HDMIRXSS_HANDLER_CONNECT)             HpdCallback
* (XV_HDMIRXSS_HANDLER_VS)                  VsCallback
* (XV_HDMIRXSS_HANDLER_STREAM_DOWN)         StreamDownCallback
* (XV_HDMIRXSS_HANDLER_STREAM_UP)           StreamUpCallback
* (XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATED)
* (XV_HDMIRXSS_HANDLER_HDCP_UNAUTHENTICATED)
* (XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATION_REQUEST)
* (XV_HDMIRXSS_HANDLER_HDCP_STREAM_MANAGE_REQUEST)
* (XV_HDMIRXSS_HANDLER_HDCP_TOPOLOGY_UPDATE)
* </pre>
*
* @param    InstancePtr is a pointer to the HDMI RX Subsystem instance.
* @param    HandlerType specifies the type of handler.
* @param    CallbackFunc is the address of the callback function.
* @param    CallbackRef is a user data item that will be passed to the
*       callback function when it is invoked.
*
* @return
*       - XST_SUCCESS if callback function installed successfully.
*       - XST_INVALID_PARAM when HandlerType is invalid.
*
* @note     Invoking this function for a handler that already has been
*       installed replaces it with the new handler.
*
******************************************************************************/
This function installs an asynchronous callback function for the given
HandlerType.


HandlerType                     Callback Function Type


This function installs an asynchronous callback function for the given HandlerType . HandlerType Callback Function Type
int XV_HdmiRxSs_SetCallback(XV_HdmiRxSs *InstancePtr,
		XV_HdmiRxSs_HandlerType HandlerType,
		void *CallbackFunc,
		void *CallbackRef)
{
    u32 Status;
    Xil_AssertNonvoid(InstancePtr != NULL);
    Xil_AssertNonvoid(HandlerType >= (XV_HDMIRXSS_HANDLER_CONNECT));
    Xil_AssertNonvoid(CallbackFunc != NULL);
    Xil_AssertNonvoid(CallbackRef != NULL);
    switch (HandlerType) {
        case (XV_HDMIRXSS_HANDLER_CONNECT):
            InstancePtr->ConnectCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->ConnectRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_BRDGOVERFLOW):
            InstancePtr->BrdgOverflowCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->BrdgOverflowRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_AUX):
            InstancePtr->AuxCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->AuxRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_AUD):
            InstancePtr->AudCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->AudRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_LNKSTA):
            InstancePtr->LnkStaCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->LnkStaRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_DDC):
            InstancePtr->DdcCallback =(XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->DdcRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_STREAM_DOWN):
            InstancePtr->StreamDownCallback =(XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->StreamDownRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_STREAM_INIT):
            InstancePtr->StreamInitCallback =(XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->StreamInitRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_STREAM_UP):
            InstancePtr->StreamUpCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->StreamUpRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_TMDS_CLK_RATIO):
            InstancePtr->TmdsClkRatioCallback =
                                  (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->TmdsClkRatioRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_VIC_ERROR):
            InstancePtr->VicErrorCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->VicErrorRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
        case (XV_HDMIRXSS_HANDLER_HDCP):
            InstancePtr->HdcpCallback = (XV_HdmiRxSs_Callback)CallbackFunc;
            InstancePtr->HdcpRef = CallbackRef;
            Status = (XST_SUCCESS);
            break;
         authenticated
        case (XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATED):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            if (InstancePtr->Hdcp14Ptr) {
              XHdcp1x_SetCallback(InstancePtr->Hdcp14Ptr,
                                  XHDCP1X_HANDLER_AUTHENTICATED,
                                  (void *)(XHdcp1x_Callback)CallbackFunc,
                                  (void *)CallbackRef);
            }
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_AUTHENTICATED,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;
         authenticated
        case (XV_HDMIRXSS_HANDLER_HDCP_UNAUTHENTICATED):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            if (InstancePtr->Hdcp14Ptr) {
              XHdcp1x_SetCallback(InstancePtr->Hdcp14Ptr,
                                XHDCP1X_HANDLER_UNAUTHENTICATED,
                                (void *)(XHdcp1x_Callback)CallbackFunc,
                                (void *)CallbackRef);
            }
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_UNAUTHENTICATED,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;
         authentication request
        case (XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATION_REQUEST):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            if (InstancePtr->Hdcp14Ptr) {
               XHdcp1x_SetCallBack(InstancePtr->Hdcp14Ptr,
                                   (XHdcp1x_HandlerType) XHDCP1X_RPTR_HDLR_TRIG_DOWNSTREAM_AUTH,
                                   (void *) (XHdcp1x_Callback)CallbackFunc,
                                   (void *) CallbackRef);
            }
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_AUTHENTICATION_REQUEST,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;
         stream management request
        case (XV_HDMIRXSS_HANDLER_HDCP_STREAM_MANAGE_REQUEST):
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_STREAM_MANAGE_REQUEST,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;
         topology update request
        case (XV_HDMIRXSS_HANDLER_HDCP_TOPOLOGY_UPDATE):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            if (InstancePtr->Hdcp14Ptr) {
              XHdcp1x_SetCallback(InstancePtr->Hdcp14Ptr,
                                  XHDCP1X_HANDLER_TOPOLOGY_UPDATE,
                                  (void *)(XHdcp1x_Callback)CallbackFunc,
                                  (void *)CallbackRef);
            }
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_TOPOLOGY_UPDATE,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;
         encryption status update
        case (XV_HDMIRXSS_HANDLER_HDCP_ENCRYPTION_UPDATE):
#ifdef XPAR_XHDCP_NUM_INSTANCES
            if (InstancePtr->Hdcp14Ptr) {
        XHdcp1x_SetCallback(InstancePtr->Hdcp14Ptr,
                                 XHDCP1X_HANDLER_ENCRYPTION_UPDATE,
                                 (void *)(XHdcp1x_Callback)CallbackFunc,
                                 (void *)CallbackRef);
            }
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
            if (InstancePtr->Hdcp22Ptr) {
              XHdcp22Rx_SetCallback(InstancePtr->Hdcp22Ptr,
                                    XHDCP22_RX_HANDLER_ENCRYPTION_UPDATE,
                                    (void *)(XHdcp22_Rx_RunHandler)CallbackFunc,
                                    (void *)CallbackRef);
            }
#endif
            Status = (XST_SUCCESS);
            break;
        default:
            Status = (XST_INVALID_PARAM);
            break;
    }
    return Status;
}
int XV_HdmiRxSs_SetCallback ( XV_HdmiRxSs * InstancePtr , XV_HdmiRxSs_HandlerType HandlerType , void * CallbackFunc , void * CallbackRef ) { u32 Status ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( HandlerType >= ( XV_HDMIRXSS_HANDLER_CONNECT ) ) ; Xil_AssertNonvoid ( CallbackFunc != NULL ) ; Xil_AssertNonvoid ( CallbackRef != NULL ) ; switch ( HandlerType ) { case ( XV_HDMIRXSS_HANDLER_CONNECT ) : InstancePtr -> ConnectCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> ConnectRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_BRDGOVERFLOW ) : InstancePtr -> BrdgOverflowCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> BrdgOverflowRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_AUX ) : InstancePtr -> AuxCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> AuxRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_AUD ) : InstancePtr -> AudCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> AudRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_LNKSTA ) : InstancePtr -> LnkStaCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> LnkStaRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_DDC ) : InstancePtr -> DdcCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> DdcRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_STREAM_DOWN ) : InstancePtr -> StreamDownCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> StreamDownRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_STREAM_INIT ) : InstancePtr -> StreamInitCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> StreamInitRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_STREAM_UP ) : InstancePtr -> StreamUpCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> StreamUpRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_TMDS_CLK_RATIO ) : InstancePtr -> TmdsClkRatioCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> TmdsClkRatioRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_VIC_ERROR ) : InstancePtr -> VicErrorCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> VicErrorRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_HDCP ) : InstancePtr -> HdcpCallback = ( XV_HdmiRxSs_Callback ) CallbackFunc ; InstancePtr -> HdcpRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATED ) : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { XHdcp1x_SetCallback ( InstancePtr -> Hdcp14Ptr , XHDCP1X_HANDLER_AUTHENTICATED , ( void * ) ( XHdcp1x_Callback ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif #ifdef XPAR_XHDCP22_RX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { XHdcp22Rx_SetCallback ( InstancePtr -> Hdcp22Ptr , XHDCP22_RX_HANDLER_AUTHENTICATED , ( void * ) ( XHdcp22_Rx_RunHandler ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_HDCP_UNAUTHENTICATED ) : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { XHdcp1x_SetCallback ( InstancePtr -> Hdcp14Ptr , XHDCP1X_HANDLER_UNAUTHENTICATED , ( void * ) ( XHdcp1x_Callback ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif #ifdef XPAR_XHDCP22_RX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { XHdcp22Rx_SetCallback ( InstancePtr -> Hdcp22Ptr , XHDCP22_RX_HANDLER_UNAUTHENTICATED , ( void * ) ( XHdcp22_Rx_RunHandler ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATION_REQUEST ) : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { XHdcp1x_SetCallBack ( InstancePtr -> Hdcp14Ptr , ( XHdcp1x_HandlerType ) XHDCP1X_RPTR_HDLR_TRIG_DOWNSTREAM_AUTH , ( void * ) ( XHdcp1x_Callback ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif #ifdef XPAR_XHDCP22_RX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { XHdcp22Rx_SetCallback ( InstancePtr -> Hdcp22Ptr , XHDCP22_RX_HANDLER_AUTHENTICATION_REQUEST , ( void * ) ( XHdcp22_Rx_RunHandler ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_HDCP_STREAM_MANAGE_REQUEST ) : #ifdef XPAR_XHDCP22_RX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { XHdcp22Rx_SetCallback ( InstancePtr -> Hdcp22Ptr , XHDCP22_RX_HANDLER_STREAM_MANAGE_REQUEST , ( void * ) ( XHdcp22_Rx_RunHandler ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_HDCP_TOPOLOGY_UPDATE ) : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { XHdcp1x_SetCallback ( InstancePtr -> Hdcp14Ptr , XHDCP1X_HANDLER_TOPOLOGY_UPDATE , ( void * ) ( XHdcp1x_Callback ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif #ifdef XPAR_XHDCP22_RX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { XHdcp22Rx_SetCallback ( InstancePtr -> Hdcp22Ptr , XHDCP22_RX_HANDLER_TOPOLOGY_UPDATE , ( void * ) ( XHdcp22_Rx_RunHandler ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif Status = ( XST_SUCCESS ) ; break ; case ( XV_HDMIRXSS_HANDLER_HDCP_ENCRYPTION_UPDATE ) : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { XHdcp1x_SetCallback ( InstancePtr -> Hdcp14Ptr , XHDCP1X_HANDLER_ENCRYPTION_UPDATE , ( void * ) ( XHdcp1x_Callback ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif #ifdef XPAR_XHDCP22_RX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { XHdcp22Rx_SetCallback ( InstancePtr -> Hdcp22Ptr , XHDCP22_RX_HANDLER_ENCRYPTION_UPDATE , ( void * ) ( XHdcp22_Rx_RunHandler ) CallbackFunc , ( void * ) CallbackRef ) ; } #endif Status = ( XST_SUCCESS ) ; break ; default : Status = ( XST_INVALID_PARAM ) ; break ; } return Status ; }
This function installs an asynchronous callback function for the given
HandlerType:
This function installs an asynchronous callback function for the given HandlerType :
/* Verify arguments. */ /* Check for handler type */ // Ddc // Stream down // Stream Init // Stream up // TMDS_CLK_RATIO // VIC_ERROR // HDCP // HDCP authenticated // Register HDCP 1.4 callbacks // Register HDCP 2.2 callbacks // HDCP authenticated // Register HDCP 1.4 callbacks // Register HDCP 2.2 callbacks // HDCP authentication request // Register HDCP 1.4 callbacks //Register the hdcp trigger downstream authentication callback // Register HDCP 2.2 callbacks // HDCP stream management request // Register HDCP 2.2 callbacks // HDCP topology update request // Register HDCP 1.4 callbacks // Register HDCP 2.2 callbacks // HDCP encryption status update // Register HDCP 1.4 callbacks // Register HDCP 2.2 callbacks