XilinxProcessorIPLib/drivers/v_sditxss/examples/xuhdsdi_pixco_example/xsdi_example.c
void RxStreamUpCallback(void *CallbackRef)
{
	XSdiVid_TransMode RxTransMode;
	u8 IsFractional;

	IsFractional = XV_SdiRxSs_GetTransportBitRate(&SdiRxSs);
	RxTransMode =  XV_SdiRxSs_GetTransportMode(&SdiRxSs);

	if (IsFractional) {
		Si570_SetClock(XPAR_IIC_0_BASEADDR, I2C_CLK_ADDR_570,
			       FREQ_SI570_148_35_MHz);
	} else {
		if (RxTransMode != XSDIVID_MODE_SD) {
			Si570_SetClock(XPAR_IIC_0_BASEADDR, I2C_CLK_ADDR_570,
				       FREQ_SI570_148_5_MHz);
		}
		if (RxTransMode == XSDIVID_MODE_SD) {
			printf ("Error: Please check the generated resolution\r\n");
		}
	}

	xil_printf("INFO>> SDI Rx: Input Locked\r\n");

	XGpio_DiscreteWrite(&Gpio_Rx_resetn, RX_GPIO_OFFSET, DISABLE_GPIO);
	usleep(ONE_US);
	XGpio_DiscreteWrite(&Gpio_Rx_resetn, RX_GPIO_OFFSET, ENABLE_GPIO);

#ifdef XPAR_XSDIAUD_NUM_INSTANCES
	XSdiAud_ResetCoreEn(&SdiExtract, DISABLE);
	XSdiAud_ResetCoreEn(&SdiEmbed, DISABLE);

	XSdiAud_Enable(&SdiEmbed, ENABLE);
	XSdiAud_Enable(&SdiExtract, ENABLE);
#endif

	usleep(HUNDERED_MS);

	XGpio_DiscreteWrite(&Gpio_Picxo_resetn, PICXO_GPIO_OFFSET, ENABLE_GPIO);
	usleep(TEN_US);
	XGpio_DiscreteWrite(&Gpio_Picxo_resetn, PICXO_GPIO_OFFSET,
			    DISABLE_GPIO);

	StartTxAfterRxFlag = (TRUE);
	XV_SdiRxSs_StreamFlowEnable(&SdiRxSs);
}
/*****************************************************************************/
/**
 *
 * This function is called when the RX Lock occurs, it calculates the frequency
 * wrt RxTransMode, programs SI570 with the calculated frequency and then
 * enables Rx stream flow IPs.
 *
 * @param	CallbackRef is a callback function reference.
 *
 * @return	None.
 *
 * @note	None.
 *
 ******************************************************************************/
This function is called when the RX Lock occurs, it calculates the frequency
wrt RxTransMode, programs SI570 with the calculated frequency and then
enables Rx stream flow IPs.

@param       CallbackRef is a callback function reference.

@return      None.

@note        None.
This function is called when the RX Lock occurs it calculates the frequency wrt RxTransMode programs SI570 with the calculated frequency and then enables Rx stream flow IPs . @param CallbackRef is a callback function reference . @return None . @note None .
void RxStreamUpCallback(void *CallbackRef)
{
	XSdiVid_TransMode RxTransMode;
	u8 IsFractional;
	IsFractional = XV_SdiRxSs_GetTransportBitRate(&SdiRxSs);
	RxTransMode =  XV_SdiRxSs_GetTransportMode(&SdiRxSs);
	if (IsFractional) {
		Si570_SetClock(XPAR_IIC_0_BASEADDR, I2C_CLK_ADDR_570,
			       FREQ_SI570_148_35_MHz);
	} else {
		if (RxTransMode != XSDIVID_MODE_SD) {
			Si570_SetClock(XPAR_IIC_0_BASEADDR, I2C_CLK_ADDR_570,
				       FREQ_SI570_148_5_MHz);
		}
		if (RxTransMode == XSDIVID_MODE_SD) {
			printf ("Error: Please check the generated resolution\r\n");
		}
	}
	xil_printf("INFO>> SDI Rx: Input Locked\r\n");
	XGpio_DiscreteWrite(&Gpio_Rx_resetn, RX_GPIO_OFFSET, DISABLE_GPIO);
	usleep(ONE_US);
	XGpio_DiscreteWrite(&Gpio_Rx_resetn, RX_GPIO_OFFSET, ENABLE_GPIO);
#ifdef XPAR_XSDIAUD_NUM_INSTANCES
	XSdiAud_ResetCoreEn(&SdiExtract, DISABLE);
	XSdiAud_ResetCoreEn(&SdiEmbed, DISABLE);
	XSdiAud_Enable(&SdiEmbed, ENABLE);
	XSdiAud_Enable(&SdiExtract, ENABLE);
#endif
	usleep(HUNDERED_MS);
	XGpio_DiscreteWrite(&Gpio_Picxo_resetn, PICXO_GPIO_OFFSET, ENABLE_GPIO);
	usleep(TEN_US);
	XGpio_DiscreteWrite(&Gpio_Picxo_resetn, PICXO_GPIO_OFFSET,
			    DISABLE_GPIO);
	StartTxAfterRxFlag = (TRUE);
	XV_SdiRxSs_StreamFlowEnable(&SdiRxSs);
}
void RxStreamUpCallback ( void * CallbackRef ) { XSdiVid_TransMode RxTransMode ; u8 IsFractional ; IsFractional = XV_SdiRxSs_GetTransportBitRate ( & SdiRxSs ) ; RxTransMode = XV_SdiRxSs_GetTransportMode ( & SdiRxSs ) ; if ( IsFractional ) { Si570_SetClock ( XPAR_IIC_0_BASEADDR , I2C_CLK_ADDR_570 , FREQ_SI570_148_35_MHz ) ; } else { if ( RxTransMode != XSDIVID_MODE_SD ) { Si570_SetClock ( XPAR_IIC_0_BASEADDR , I2C_CLK_ADDR_570 , FREQ_SI570_148_5_MHz ) ; } if ( RxTransMode == XSDIVID_MODE_SD ) { printf ( " \r \n " ) ; } } xil_printf ( " \r \n " ) ; XGpio_DiscreteWrite ( & Gpio_Rx_resetn , RX_GPIO_OFFSET , DISABLE_GPIO ) ; usleep ( ONE_US ) ; XGpio_DiscreteWrite ( & Gpio_Rx_resetn , RX_GPIO_OFFSET , ENABLE_GPIO ) ; #ifdef XPAR_XSDIAUD_NUM_INSTANCES XSdiAud_ResetCoreEn ( & SdiExtract , DISABLE ) ; XSdiAud_ResetCoreEn ( & SdiEmbed , DISABLE ) ; XSdiAud_Enable ( & SdiEmbed , ENABLE ) ; XSdiAud_Enable ( & SdiExtract , ENABLE ) ; #endif usleep ( HUNDERED_MS ) ; XGpio_DiscreteWrite ( & Gpio_Picxo_resetn , PICXO_GPIO_OFFSET , ENABLE_GPIO ) ; usleep ( TEN_US ) ; XGpio_DiscreteWrite ( & Gpio_Picxo_resetn , PICXO_GPIO_OFFSET , DISABLE_GPIO ) ; StartTxAfterRxFlag = ( TRUE ) ; XV_SdiRxSs_StreamFlowEnable ( & SdiRxSs ) ; }
This function is called when the RX Lock occurs, it calculates the frequency
 wrt RxTransMode, programs SI570 with the calculated frequency and then
 enables Rx stream flow IPs.
This function is called when the RX Lock occurs it calculates the frequency wrt RxTransMode programs SI570 with the calculated frequency and then enables Rx stream flow IPs .