XilinxProcessorIPLib/drivers/v_sditxss/examples/xuhdsdi_pixco_example/xsdi_example.c
static void SdiAudGrpChangeDetHandler(void *CallBackRef)
{

	XSdiAud *InstancePtr = (XSdiAud *)CallBackRef;
	XSdiVid_TransMode RxTransModeAud;

	RxTransModeAud =  XV_SdiRxSs_GetTransportMode(&SdiRxSs);
	/* Set the interrupt received flag. */
	XSdiAud_IntrClr(&SdiExtract,XSDIAUD_INT_EN_GRP_CHG_MASK);

	/*Audio Embed Module Reset Assertion*/
	XSdiAud_ResetCoreEn(&SdiEmbed, ENABLE);
	/*Audio Extract Module Reset Assertion*/
	XSdiAud_ResetCoreEn(&SdiExtract, ENABLE);

	xil_printf("------------\n\r");
	xil_printf("SDI Audio Info\n\r");
	xil_printf("------------\n\r");

	/*Interrupt Mask Enable for Extract*/
	DetAudioGrps = XSdiAud_DetAudGrp(&SdiExtract);

	AudNumOfCh = XSdiAud_Ext_DetActCh(&SdiExtract);
	xil_printf("Number of Audio Channels = %d\r\n",AudNumOfCh);

	/* Audio Extract Function to set the Clock Phase in HD Mode */
	XSdiAud_Ext_SetClkPhase(&SdiExtract, 1);


	switch (DetAudioGrps)
	{
		case XSDIAUD_GROUP_0:
		case XSDIAUD_GROUP_1:
		case XSDIAUD_GROUP_1_2:
		case XSDIAUD_GROUP_1_2_3:
		case XSDIAUD_GROUP_ALL:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP1, AudNumOfCh);
			XSdiAud_SetCh(&SdiEmbed, XSDIAUD_GROUP1, AudNumOfCh);
			break;

		case XSDIAUD_GROUP_2:
		case XSDIAUD_GROUP_2_3:
		case XSDIAUD_GROUP_2_3_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP2, AudNumOfCh);
			XSdiAud_SetCh(&SdiEmbed, XSDIAUD_GROUP2, AudNumOfCh);
			break;

		case XSDIAUD_GROUP_3:
		case XSDIAUD_GROUP_3_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP3, AudNumOfCh);
			XSdiAud_SetCh(&SdiEmbed, XSDIAUD_GROUP3, AudNumOfCh);
			break;

		case XSDIAUD_GROUP_1_3:
		case XSDIAUD_GROUP_1_4:
		case XSDIAUD_GROUP_1_2_4:
		case XSDIAUD_GROUP_1_3_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP1,
				      XSDIAUD_QUAD_GROUP);
			xil_printf("Only Group 1 is configured\r\n");
			xil_printf("Non-Sequential Groups are not Supported\r\n");
			break;

		case XSDIAUD_GROUP_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP4, AudNumOfCh);
			XSdiAud_SetCh(&SdiEmbed, XSDIAUD_GROUP4, AudNumOfCh);
			break;

		case XSDIAUD_GROUP_2_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP2,
				      XSDIAUD_QUAD_GROUP);
			xil_printf("Only Group 2 is configured\r\n");
			xil_printf("Non-Sequential Groups are not Supported\r\n");
			break;

		default:
			xil_printf("Invalid case: Groups are not configured\r\n");
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP3,
				      XSDIAUD_QUAD_GROUP);
			break;
	}

	/* Embed Module is Configured here*/
	/* Video Embed Function to set enable external line */
	XSdiAud_Emb_EnExtrnLine(&SdiEmbed, ENABLE);

	/*Audio Embed Function to set the sampling rate */
	XSdiAud_Emb_SetSmpRate(&SdiEmbed, XSDIAUD_SAMPRATE0);

	if(RxTransModeAud == XSDIVID_MODE_SD) {
		XSdiAud_Emb_SetSmpSize(&SdiEmbed, XSDIAUD_SAMPSIZE1);
		XSdiAud_Emb_SetLineStd(&SdiEmbed, XSDIAUD_NTSC);
	}
	else {
		XSdiAud_Emb_SetSmpSize(&SdiEmbed, XSDIAUD_SAMPSIZE0);
		XSdiAud_Emb_SetLineStd(&SdiEmbed,
				       XSDIAUD_SMPTE_274M_1080p_30Hz);
	}

	XSdiAud_ResetCoreEn(&SdiExtract, DISABLE);
	XSdiAud_ResetCoreEn(&SdiEmbed, DISABLE);

	XSdiAud_Enable(&SdiExtract, ENABLE);
	XSdiAud_Enable(&SdiEmbed, ENABLE);
}
/*****************************************************************************/
/**
 * This function is the handler which performs processing for the SDI extract
 * IP. It is called from an interrupt context when the SDI Extract IP receives
 * a interrupt for change in the presence of audio groups in the incoming
 * SDI stream.
 *
 * This handler provides an example of what needs to be done when gorup change
 * interrupt is detected in the received SDI audio stream by the SDI extract IP
 * block, but is application specific.
 *
 * @param	CallBackRef is a pointer to the callback function
 *
 * @return	None.
 *
 * @note	None.
 *
 ******************************************************************************/
This function is the handler which performs processing for the SDI extract
IP. It is called from an interrupt context when the SDI Extract IP receives
a interrupt for change in the presence of audio groups in the incoming
SDI stream.

This handler provides an example of what needs to be done when gorup change
interrupt is detected in the received SDI audio stream by the SDI extract IP
block, but is application specific.

@param       CallBackRef is a pointer to the callback function

@return      None.

@note        None.
This function is the handler which performs processing for the SDI extract IP . It is called from an interrupt context when the SDI Extract IP receives a interrupt for change in the presence of audio groups in the incoming SDI stream . This handler provides an example of what needs to be done when gorup change interrupt is detected in the received SDI audio stream by the SDI extract IP block but is application specific . @param CallBackRef is a pointer to the callback function @return None . @note None .
static void SdiAudGrpChangeDetHandler(void *CallBackRef)
{
	XSdiAud *InstancePtr = (XSdiAud *)CallBackRef;
	XSdiVid_TransMode RxTransModeAud;
	RxTransModeAud =  XV_SdiRxSs_GetTransportMode(&SdiRxSs);
	XSdiAud_IntrClr(&SdiExtract,XSDIAUD_INT_EN_GRP_CHG_MASK);
	XSdiAud_ResetCoreEn(&SdiEmbed, ENABLE);
	XSdiAud_ResetCoreEn(&SdiExtract, ENABLE);
	xil_printf("------------\n\r");
	xil_printf("SDI Audio Info\n\r");
	xil_printf("------------\n\r");
	DetAudioGrps = XSdiAud_DetAudGrp(&SdiExtract);
	AudNumOfCh = XSdiAud_Ext_DetActCh(&SdiExtract);
	xil_printf("Number of Audio Channels = %d\r\n",AudNumOfCh);
	XSdiAud_Ext_SetClkPhase(&SdiExtract, 1);
	switch (DetAudioGrps)
	{
		case XSDIAUD_GROUP_0:
		case XSDIAUD_GROUP_1:
		case XSDIAUD_GROUP_1_2:
		case XSDIAUD_GROUP_1_2_3:
		case XSDIAUD_GROUP_ALL:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP1, AudNumOfCh);
			XSdiAud_SetCh(&SdiEmbed, XSDIAUD_GROUP1, AudNumOfCh);
			break;
		case XSDIAUD_GROUP_2:
		case XSDIAUD_GROUP_2_3:
		case XSDIAUD_GROUP_2_3_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP2, AudNumOfCh);
			XSdiAud_SetCh(&SdiEmbed, XSDIAUD_GROUP2, AudNumOfCh);
			break;
		case XSDIAUD_GROUP_3:
		case XSDIAUD_GROUP_3_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP3, AudNumOfCh);
			XSdiAud_SetCh(&SdiEmbed, XSDIAUD_GROUP3, AudNumOfCh);
			break;
		case XSDIAUD_GROUP_1_3:
		case XSDIAUD_GROUP_1_4:
		case XSDIAUD_GROUP_1_2_4:
		case XSDIAUD_GROUP_1_3_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP1,
				      XSDIAUD_QUAD_GROUP);
			xil_printf("Only Group 1 is configured\r\n");
			xil_printf("Non-Sequential Groups are not Supported\r\n");
			break;
		case XSDIAUD_GROUP_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP4, AudNumOfCh);
			XSdiAud_SetCh(&SdiEmbed, XSDIAUD_GROUP4, AudNumOfCh);
			break;
		case XSDIAUD_GROUP_2_4:
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP2,
				      XSDIAUD_QUAD_GROUP);
			xil_printf("Only Group 2 is configured\r\n");
			xil_printf("Non-Sequential Groups are not Supported\r\n");
			break;
		default:
			xil_printf("Invalid case: Groups are not configured\r\n");
			XSdiAud_SetCh(&SdiExtract, XSDIAUD_GROUP3,
				      XSDIAUD_QUAD_GROUP);
			break;
	}
	XSdiAud_Emb_EnExtrnLine(&SdiEmbed, ENABLE);
	XSdiAud_Emb_SetSmpRate(&SdiEmbed, XSDIAUD_SAMPRATE0);
	if(RxTransModeAud == XSDIVID_MODE_SD) {
		XSdiAud_Emb_SetSmpSize(&SdiEmbed, XSDIAUD_SAMPSIZE1);
		XSdiAud_Emb_SetLineStd(&SdiEmbed, XSDIAUD_NTSC);
	}
	else {
		XSdiAud_Emb_SetSmpSize(&SdiEmbed, XSDIAUD_SAMPSIZE0);
		XSdiAud_Emb_SetLineStd(&SdiEmbed,
				       XSDIAUD_SMPTE_274M_1080p_30Hz);
	}
	XSdiAud_ResetCoreEn(&SdiExtract, DISABLE);
	XSdiAud_ResetCoreEn(&SdiEmbed, DISABLE);
	XSdiAud_Enable(&SdiExtract, ENABLE);
	XSdiAud_Enable(&SdiEmbed, ENABLE);
}
static void SdiAudGrpChangeDetHandler ( void * CallBackRef ) { XSdiAud * InstancePtr = ( XSdiAud * ) CallBackRef ; XSdiVid_TransMode RxTransModeAud ; RxTransModeAud = XV_SdiRxSs_GetTransportMode ( & SdiRxSs ) ; XSdiAud_IntrClr ( & SdiExtract , XSDIAUD_INT_EN_GRP_CHG_MASK ) ; XSdiAud_ResetCoreEn ( & SdiEmbed , ENABLE ) ; XSdiAud_ResetCoreEn ( & SdiExtract , ENABLE ) ; xil_printf ( " \n \r " ) ; xil_printf ( " \n \r " ) ; xil_printf ( " \n \r " ) ; DetAudioGrps = XSdiAud_DetAudGrp ( & SdiExtract ) ; AudNumOfCh = XSdiAud_Ext_DetActCh ( & SdiExtract ) ; xil_printf ( " \r \n " , AudNumOfCh ) ; XSdiAud_Ext_SetClkPhase ( & SdiExtract , 1 ) ; switch ( DetAudioGrps ) { case XSDIAUD_GROUP_0 : case XSDIAUD_GROUP_1 : case XSDIAUD_GROUP_1_2 : case XSDIAUD_GROUP_1_2_3 : case XSDIAUD_GROUP_ALL : XSdiAud_SetCh ( & SdiExtract , XSDIAUD_GROUP1 , AudNumOfCh ) ; XSdiAud_SetCh ( & SdiEmbed , XSDIAUD_GROUP1 , AudNumOfCh ) ; break ; case XSDIAUD_GROUP_2 : case XSDIAUD_GROUP_2_3 : case XSDIAUD_GROUP_2_3_4 : XSdiAud_SetCh ( & SdiExtract , XSDIAUD_GROUP2 , AudNumOfCh ) ; XSdiAud_SetCh ( & SdiEmbed , XSDIAUD_GROUP2 , AudNumOfCh ) ; break ; case XSDIAUD_GROUP_3 : case XSDIAUD_GROUP_3_4 : XSdiAud_SetCh ( & SdiExtract , XSDIAUD_GROUP3 , AudNumOfCh ) ; XSdiAud_SetCh ( & SdiEmbed , XSDIAUD_GROUP3 , AudNumOfCh ) ; break ; case XSDIAUD_GROUP_1_3 : case XSDIAUD_GROUP_1_4 : case XSDIAUD_GROUP_1_2_4 : case XSDIAUD_GROUP_1_3_4 : XSdiAud_SetCh ( & SdiExtract , XSDIAUD_GROUP1 , XSDIAUD_QUAD_GROUP ) ; xil_printf ( " \r \n " ) ; xil_printf ( " \r \n " ) ; break ; case XSDIAUD_GROUP_4 : XSdiAud_SetCh ( & SdiExtract , XSDIAUD_GROUP4 , AudNumOfCh ) ; XSdiAud_SetCh ( & SdiEmbed , XSDIAUD_GROUP4 , AudNumOfCh ) ; break ; case XSDIAUD_GROUP_2_4 : XSdiAud_SetCh ( & SdiExtract , XSDIAUD_GROUP2 , XSDIAUD_QUAD_GROUP ) ; xil_printf ( " \r \n " ) ; xil_printf ( " \r \n " ) ; break ; default : xil_printf ( " \r \n " ) ; XSdiAud_SetCh ( & SdiExtract , XSDIAUD_GROUP3 , XSDIAUD_QUAD_GROUP ) ; break ; } XSdiAud_Emb_EnExtrnLine ( & SdiEmbed , ENABLE ) ; XSdiAud_Emb_SetSmpRate ( & SdiEmbed , XSDIAUD_SAMPRATE0 ) ; if ( RxTransModeAud == XSDIVID_MODE_SD ) { XSdiAud_Emb_SetSmpSize ( & SdiEmbed , XSDIAUD_SAMPSIZE1 ) ; XSdiAud_Emb_SetLineStd ( & SdiEmbed , XSDIAUD_NTSC ) ; } else { XSdiAud_Emb_SetSmpSize ( & SdiEmbed , XSDIAUD_SAMPSIZE0 ) ; XSdiAud_Emb_SetLineStd ( & SdiEmbed , XSDIAUD_SMPTE_274M_1080p_30Hz ) ; } XSdiAud_ResetCoreEn ( & SdiExtract , DISABLE ) ; XSdiAud_ResetCoreEn ( & SdiEmbed , DISABLE ) ; XSdiAud_Enable ( & SdiExtract , ENABLE ) ; XSdiAud_Enable ( & SdiEmbed , ENABLE ) ; }
This function is the handler which performs processing for the SDI extract
 IP.
This function is the handler which performs processing for the SDI extract IP .
/* Set the interrupt received flag. */ /*Audio Embed Module Reset Assertion*/ /*Audio Extract Module Reset Assertion*/ /*Interrupt Mask Enable for Extract*/ /* Audio Extract Function to set the Clock Phase in HD Mode */ /* Embed Module is Configured here*/ /* Video Embed Function to set enable external line */ /*Audio Embed Function to set the sampling rate */