XilinxProcessorIPLib/drivers/v_hdmitxss/examples/xhdmi_example/PassThroughVersal/xhdmi_menu.c
static XHdmi_MenuType XHdmi_ColorSpaceMenu(XHdmi_Menu *InstancePtr, u8 Input) {
	// Variables
	XHdmi_MenuType 	Menu;
	XVidC_ColorFormat ColorFormat;

	// Default
	ColorFormat = XVIDC_CSF_UNKNOWN;
	Menu = XHDMI_COLORSPACE_MENU;

	switch (Input) {
			// RGB
		case 1 :
			ColorFormat = XVIDC_CSF_RGB;
			break;

			// YUV444
		case 2 :
			ColorFormat = XVIDC_CSF_YCRCB_444;
			break;

			// YUV422
		case 3 :
			ColorFormat = XVIDC_CSF_YCRCB_422;
			break;
#if (XPAR_XV_HDMITXSS_0_INCLUDE_YUV420_SUP == 1)
			// YUV420
		case 4 :
			ColorFormat = XVIDC_CSF_YCRCB_420;
			break;
#endif
			// Exit
		case 99 :
			xil_printf("Returning to main menu.\r\n");
			Menu = XHDMI_MAIN_MENU;
			break;

		default :
			xil_printf("Unknown option\r\n");
			XHdmi_DisplayColorSpaceMenu();
			break;
	}

	if (ColorFormat != XVIDC_CSF_UNKNOWN) {
		UpdateColorFormat(&Hdmiphy1, &HdmiTxSs, ColorFormat);
		InstancePtr->WaitForColorbar = (TRUE);
	}

	return Menu;
}
/*****************************************************************************/
/**
*
* This function implements the HDMI color space menu state.
*
* @param input is the value used for the next menu state decoder.
*
* @return The next menu state.
*
******************************************************************************/
This function implements the HDMI color space menu state.
This function implements the HDMI color space menu state .
static XHdmi_MenuType XHdmi_ColorSpaceMenu(XHdmi_Menu *InstancePtr, u8 Input) {
	XHdmi_MenuType 	Menu;
	XVidC_ColorFormat ColorFormat;
	ColorFormat = XVIDC_CSF_UNKNOWN;
	Menu = XHDMI_COLORSPACE_MENU;
	switch (Input) {
		case 1 :
			ColorFormat = XVIDC_CSF_RGB;
			break;
		case 2 :
			ColorFormat = XVIDC_CSF_YCRCB_444;
			break;
		case 3 :
			ColorFormat = XVIDC_CSF_YCRCB_422;
			break;
#if (XPAR_XV_HDMITXSS_0_INCLUDE_YUV420_SUP == 1)
		case 4 :
			ColorFormat = XVIDC_CSF_YCRCB_420;
			break;
#endif
		case 99 :
			xil_printf("Returning to main menu.\r\n");
			Menu = XHDMI_MAIN_MENU;
			break;
		default :
			xil_printf("Unknown option\r\n");
			XHdmi_DisplayColorSpaceMenu();
			break;
	}
	if (ColorFormat != XVIDC_CSF_UNKNOWN) {
		UpdateColorFormat(&Hdmiphy1, &HdmiTxSs, ColorFormat);
		InstancePtr->WaitForColorbar = (TRUE);
	}
	return Menu;
}
static XHdmi_MenuType XHdmi_ColorSpaceMenu ( XHdmi_Menu * InstancePtr , u8 Input ) { XHdmi_MenuType Menu ; XVidC_ColorFormat ColorFormat ; ColorFormat = XVIDC_CSF_UNKNOWN ; Menu = XHDMI_COLORSPACE_MENU ; switch ( Input ) { case 1 : ColorFormat = XVIDC_CSF_RGB ; break ; case 2 : ColorFormat = XVIDC_CSF_YCRCB_444 ; break ; case 3 : ColorFormat = XVIDC_CSF_YCRCB_422 ; break ; #if ( XPAR_XV_HDMITXSS_0_INCLUDE_YUV420_SUP == 1 ) case 4 : ColorFormat = XVIDC_CSF_YCRCB_420 ; break ; #endif case 99 : xil_printf ( " \r \n " ) ; Menu = XHDMI_MAIN_MENU ; break ; default : xil_printf ( " \r \n " ) ; XHdmi_DisplayColorSpaceMenu ( ) ; break ; } if ( ColorFormat != XVIDC_CSF_UNKNOWN ) { UpdateColorFormat ( & Hdmiphy1 , & HdmiTxSs , ColorFormat ) ; InstancePtr -> WaitForColorbar = ( TRUE ) ; } return Menu ; }
This function implements the HDMI color space menu state.
This function implements the HDMI color space menu state .
// Variables // Default // RGB // YUV444 // YUV422 // YUV420 // Exit