XilinxProcessorIPLib/drivers/v_hdmitxss/examples/xhdmi_example/I2S/xhdmi_example.c
void TxConnectCallback(void *CallbackRef) {
	XV_HdmiTxSs *HdmiTxSsPtr = (XV_HdmiTxSs *)CallbackRef;
	if(HdmiTxSsPtr->IsStreamConnected == (FALSE)) {
		/* TX Cable is disconnected */
		TxCableConnect = (FALSE);

		if (IsPassThrough) {
			/* If the system in the Pass-through
			 * reset the AUX FIFO
			 */
			ResetAuxFifo();
			/* Clearing the Restarting the TX after RX up flag */
			StartTxAfterRxFlag = (FALSE);
#ifdef XPAR_XV_HDMIRXSS_NUM_INSTANCES
			/* Mute/Stop the HDMI RX SS Output
			 * Enable only when the downstream is ready
			 * (TPG & HDMI TX)
			 */
			XV_HdmiRxSs_VRST(&HdmiRxSs,TRUE);
#endif
		}

		/* Cable is disconnected, don't restart colorbar */
		TxRestartColorbar = (FALSE);
		/* Cable is disconnected, don't allow any TX operation */
		TxBusy = (TRUE);

		XVphy_IBufDsEnable(&Vphy, 0, XVPHY_DIR_TX, (FALSE));

#ifdef USE_HDCP
		/* Call HDCP disconnect callback */
		XHdcp_StreamDisconnectCallback(&HdcpRepeater);
#endif
	} else {
		/* Set TX Cable Connect Flag to (TRUE) as the cable is
		 * connected
		 */
		TxCableConnect = (TRUE);

		/* Set Flag when the cable is connected
		 * this call back take in to account two scneario
		 * cable connect and cable disconnect
		 * Stable RX stream is available
		 */
		if (IsPassThrough) {
			/* Restart Stream */
			StartTxAfterRxFlag = (TRUE);
		}
		else { /* Operate in TX Only Colorbar mode when the
				* the system is in loopback mode or when RX
				* is not connected during PassThrough mode
				*/
			TxRestartColorbar = (TRUE);
			TxBusy = (FALSE);
		}

		XVphy_IBufDsEnable(&Vphy, 0, XVPHY_DIR_TX, (TRUE));

		/* Initialize EDID App during cable connect */
		EDIDConnectInit(&EdidHdmi20_t);
		/* Read the EDID and the SCDC */
		EdidScdcCheck(HdmiTxSsPtr, &EdidHdmi20_t);

#if (XPAR_VPHY_0_TRANSCEIVER == XVPHY_GTXE2)
		/* When the GT TX and RX are coupled, then start the TXPLL */
		if (XVphy_IsBonded(&Vphy, 0, XVPHY_CHANNEL_ID_CH1)) {
			/* Start TX MMCM */
			XVphy_MmcmStart(&Vphy, 0, XVPHY_DIR_TX);
			usleep(10000);
			/* GT TX reset. */
			XVphy_ResetGtTxRx(&Vphy, 0, XVPHY_CHANNEL_ID_CHA,
							  XVPHY_DIR_TX, FALSE);
		}
#endif

#ifdef USE_HDCP
		/* Call HDCP connect callback */
		XHdcp_StreamConnectCallback(&HdcpRepeater);
#endif
	}
}
/*****************************************************************************/
/**
*
* This function is called when a TX connect event has occurred.
*
* @param  None.
*
* @return None.
*
* @note   None.
*
******************************************************************************/
This function is called when a TX connect event has occurred.
This function is called when a TX connect event has occurred .
void TxConnectCallback(void *CallbackRef) {
	XV_HdmiTxSs *HdmiTxSsPtr = (XV_HdmiTxSs *)CallbackRef;
	if(HdmiTxSsPtr->IsStreamConnected == (FALSE)) {
		TxCableConnect = (FALSE);
		if (IsPassThrough) {
			ResetAuxFifo();
			StartTxAfterRxFlag = (FALSE);
#ifdef XPAR_XV_HDMIRXSS_NUM_INSTANCES
			XV_HdmiRxSs_VRST(&HdmiRxSs,TRUE);
#endif
		}
		TxRestartColorbar = (FALSE);
		TxBusy = (TRUE);
		XVphy_IBufDsEnable(&Vphy, 0, XVPHY_DIR_TX, (FALSE));
#ifdef USE_HDCP
		XHdcp_StreamDisconnectCallback(&HdcpRepeater);
#endif
	} else {
		TxCableConnect = (TRUE);
		if (IsPassThrough) {
			StartTxAfterRxFlag = (TRUE);
		}
		else { 
			TxRestartColorbar = (TRUE);
			TxBusy = (FALSE);
		}
		XVphy_IBufDsEnable(&Vphy, 0, XVPHY_DIR_TX, (TRUE));
		EDIDConnectInit(&EdidHdmi20_t);
		EdidScdcCheck(HdmiTxSsPtr, &EdidHdmi20_t);
#if (XPAR_VPHY_0_TRANSCEIVER == XVPHY_GTXE2)
		if (XVphy_IsBonded(&Vphy, 0, XVPHY_CHANNEL_ID_CH1)) {
			XVphy_MmcmStart(&Vphy, 0, XVPHY_DIR_TX);
			usleep(10000);
			XVphy_ResetGtTxRx(&Vphy, 0, XVPHY_CHANNEL_ID_CHA,
							  XVPHY_DIR_TX, FALSE);
		}
#endif
#ifdef USE_HDCP
		XHdcp_StreamConnectCallback(&HdcpRepeater);
#endif
	}
}
void TxConnectCallback ( void * CallbackRef ) { XV_HdmiTxSs * HdmiTxSsPtr = ( XV_HdmiTxSs * ) CallbackRef ; if ( HdmiTxSsPtr -> IsStreamConnected == ( FALSE ) ) { TxCableConnect = ( FALSE ) ; if ( IsPassThrough ) { ResetAuxFifo ( ) ; StartTxAfterRxFlag = ( FALSE ) ; #ifdef XPAR_XV_HDMIRXSS_NUM_INSTANCES XV_HdmiRxSs_VRST ( & HdmiRxSs , TRUE ) ; #endif } TxRestartColorbar = ( FALSE ) ; TxBusy = ( TRUE ) ; XVphy_IBufDsEnable ( & Vphy , 0 , XVPHY_DIR_TX , ( FALSE ) ) ; #ifdef USE_HDCP XHdcp_StreamDisconnectCallback ( & HdcpRepeater ) ; #endif } else { TxCableConnect = ( TRUE ) ; if ( IsPassThrough ) { StartTxAfterRxFlag = ( TRUE ) ; } else { TxRestartColorbar = ( TRUE ) ; TxBusy = ( FALSE ) ; } XVphy_IBufDsEnable ( & Vphy , 0 , XVPHY_DIR_TX , ( TRUE ) ) ; EDIDConnectInit ( & EdidHdmi20_t ) ; EdidScdcCheck ( HdmiTxSsPtr , & EdidHdmi20_t ) ; #if ( XPAR_VPHY_0_TRANSCEIVER == XVPHY_GTXE2 ) if ( XVphy_IsBonded ( & Vphy , 0 , XVPHY_CHANNEL_ID_CH1 ) ) { XVphy_MmcmStart ( & Vphy , 0 , XVPHY_DIR_TX ) ; usleep ( 10000 ) ; XVphy_ResetGtTxRx ( & Vphy , 0 , XVPHY_CHANNEL_ID_CHA , XVPHY_DIR_TX , FALSE ) ; } #endif #ifdef USE_HDCP XHdcp_StreamConnectCallback ( & HdcpRepeater ) ; #endif } }
This function is called when a TX connect event has occurred.
This function is called when a TX connect event has occurred .
/* TX Cable is disconnected */ /* If the system in the Pass-through
			 * reset the AUX FIFO
			 */ /* Clearing the Restarting the TX after RX up flag */ /* Mute/Stop the HDMI RX SS Output
			 * Enable only when the downstream is ready
			 * (TPG & HDMI TX)
			 */ /* Cable is disconnected, don't restart colorbar */ /* Cable is disconnected, don't allow any TX operation */ /* Call HDCP disconnect callback */ /* Set TX Cable Connect Flag to (TRUE) as the cable is
		 * connected
		 */ /* Set Flag when the cable is connected
		 * this call back take in to account two scneario
		 * cable connect and cable disconnect
		 * Stable RX stream is available
		 */ /* Restart Stream */ /* Operate in TX Only Colorbar mode when the
				* the system is in loopback mode or when RX
				* is not connected during PassThrough mode
				*/ /* Initialize EDID App during cable connect */ /* Read the EDID and the SCDC */ /* When the GT TX and RX are coupled, then start the TXPLL */ /* Start TX MMCM */ /* GT TX reset. */ /* Call HDCP connect callback */