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

	// Default
	Menu = XHDMI_RESOLUTION_MENU;
	VideoMode = XVIDC_VM_NO_INPUT;

	switch (Input) {
			// 720 x 480p
		case 1 :
			VideoMode = XVIDC_VM_720x480_60_P;
			break;

			// 720  x 576p
		case 2 :
			VideoMode = XVIDC_VM_720x576_50_P;
			break;

			// 1280 x 720p
		case 3 :
			VideoMode = XVIDC_VM_1280x720_60_P;
			break;

			// 1680 x 720p
		case 4 :
			VideoMode = XVIDC_VM_1680x720_60_P;
			break;

			// 1920 x 1080p
		case 5 :
			VideoMode = XVIDC_VM_1920x1080_60_P;
			break;

			// 2560 x 1080p
		case 6 :
			VideoMode = XVIDC_VM_2560x1080_60_P;
			break;

			// 3840 x 2160p
		case 7 :
#if (XPAR_HDMIPHY1_0_TRANSCEIVER != XVPHY_GTPE2)
			VideoMode = XVIDC_VM_3840x2160_60_P;
#else
			VideoMode = XVIDC_VM_3840x2160_30_P;
#endif
			break;

			// 4096 x 2160p
		case 8 :
#if (XPAR_HDMIPHY1_0_TRANSCEIVER != XVPHY_GTPE2)
			VideoMode = XVIDC_VM_4096x2160_60_P;
#else
			VideoMode = XVIDC_VM_4096x2160_30_P;
#endif
			break;

			// 1920 x 1080i
		case 9 :
			VideoMode = XVIDC_VM_1920x1080_60_I;
			break;

			// 640 x 480p (VGA)
		case 10 :
			VideoMode = XVIDC_VM_640x480_60_P;
			break;

			// 800 x 600p (SVGA)
		case 11 :
			VideoMode = XVIDC_VM_800x600_60_P;
			break;

			//  1024 x 768p (XGA)
		case 12 :
			VideoMode = XVIDC_VM_1024x768_60_P;
			break;

			// 1280 x 768p (WXGA)
		case 13 :
			VideoMode = XVIDC_VM_1280x768_60_P;
			break;

			// 1366 x 768p (WXGA+)
		case 14 :
			VideoMode = XVIDC_VM_1366x768_60_P;
			break;

			// 1280 x 1024p (SXGA)
		case 15 :
			VideoMode = XVIDC_VM_1280x1024_60_P;
			break;

			// 1680 x 1050p (WSXGA+)
		case 16 :
			VideoMode = XVIDC_VM_1680x1050_60_P;
			break;

			// 1600 x 1200p (UXGA)
		case 17 :
			VideoMode = XVIDC_VM_1600x1200_60_P;
			break;

			// 1920 x 1200p (WUXGA)
		case 18 :
			VideoMode = XVIDC_VM_1920x1200_60_P;
			break;
#if (XPAR_XV_HDMITXSS_0_INCLUDE_LOW_RESO_VID == 1)
			// 720 x 480i (NTSC)
		case 19 :
			VideoMode = XVIDC_VM_1440x480_60_I;
			break;

			// 720 x 576i (PAL)
		case 20 :
			VideoMode = XVIDC_VM_1440x576_50_I;
			break;

#if(CUSTOM_RESOLUTION_ENABLE == 1)
			//3840 x 2160p (SB) (Custom)
		case 21 :
			VideoMode = XVIDC_VM_1152x864_60_P;
			break;
#endif
#else
#if(CUSTOM_RESOLUTION_ENABLE == 1)
		case 19 :
			VideoMode = XVIDC_VM_1152x864_60_P;
			break;
#endif
#endif
		case 22 :
			EnableColorBar(&Hdmiphy1, &HdmiTxSs, XVIDC_VM_1920x1080_60_P, XVIDC_CSF_RGB, XVIDC_BPC_12);
			InstancePtr->WaitForColorbar = (TRUE);
			return Menu;

		case 23 :
			EnableColorBar(&Hdmiphy1, &HdmiTxSs, XVIDC_VM_3840x2160_30_P, XVIDC_CSF_RGB, XVIDC_BPC_10);
			InstancePtr->WaitForColorbar = (TRUE);
			return Menu;

			// Exit
		case 99 :
			xil_printf("Returning to main menu.\r\n");
			Menu = XHDMI_MAIN_MENU;
			break;

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

	if (VideoMode != XVIDC_VM_NO_INPUT) {
#ifdef XPAR_XV_HDMITXSS_NUM_INSTANCES
		EnableColorBar(&Hdmiphy1, &HdmiTxSs, VideoMode, XVIDC_CSF_RGB, XVIDC_BPC_8);
#endif
		InstancePtr->WaitForColorbar = (TRUE);
	}

	return Menu;
}
/*****************************************************************************/
/**
*
* This function implements the HDMI resolution menu state.
*
* @param input is the value used for the next menu state decoder.
*
* @return The next menu state.
*
******************************************************************************/
This function implements the HDMI resolution menu state.
This function implements the HDMI resolution menu state .
static XHdmi_MenuType XHdmi_ResolutionMenu(XHdmi_Menu *InstancePtr, u8 Input) {
	XHdmi_MenuType 	Menu;
	XVidC_VideoMode	VideoMode;
	Menu = XHDMI_RESOLUTION_MENU;
	VideoMode = XVIDC_VM_NO_INPUT;
	switch (Input) {
		case 1 :
			VideoMode = XVIDC_VM_720x480_60_P;
			break;
		case 2 :
			VideoMode = XVIDC_VM_720x576_50_P;
			break;
		case 3 :
			VideoMode = XVIDC_VM_1280x720_60_P;
			break;
		case 4 :
			VideoMode = XVIDC_VM_1680x720_60_P;
			break;
		case 5 :
			VideoMode = XVIDC_VM_1920x1080_60_P;
			break;
		case 6 :
			VideoMode = XVIDC_VM_2560x1080_60_P;
			break;
		case 7 :
#if (XPAR_HDMIPHY1_0_TRANSCEIVER != XVPHY_GTPE2)
			VideoMode = XVIDC_VM_3840x2160_60_P;
#else
			VideoMode = XVIDC_VM_3840x2160_30_P;
#endif
			break;
		case 8 :
#if (XPAR_HDMIPHY1_0_TRANSCEIVER != XVPHY_GTPE2)
			VideoMode = XVIDC_VM_4096x2160_60_P;
#else
			VideoMode = XVIDC_VM_4096x2160_30_P;
#endif
			break;
		case 9 :
			VideoMode = XVIDC_VM_1920x1080_60_I;
			break;
		case 10 :
			VideoMode = XVIDC_VM_640x480_60_P;
			break;
		case 11 :
			VideoMode = XVIDC_VM_800x600_60_P;
			break;
		case 12 :
			VideoMode = XVIDC_VM_1024x768_60_P;
			break;
		case 13 :
			VideoMode = XVIDC_VM_1280x768_60_P;
			break;
		case 14 :
			VideoMode = XVIDC_VM_1366x768_60_P;
			break;
		case 15 :
			VideoMode = XVIDC_VM_1280x1024_60_P;
			break;
		case 16 :
			VideoMode = XVIDC_VM_1680x1050_60_P;
			break;
		case 17 :
			VideoMode = XVIDC_VM_1600x1200_60_P;
			break;
		case 18 :
			VideoMode = XVIDC_VM_1920x1200_60_P;
			break;
#if (XPAR_XV_HDMITXSS_0_INCLUDE_LOW_RESO_VID == 1)
		case 19 :
			VideoMode = XVIDC_VM_1440x480_60_I;
			break;
		case 20 :
			VideoMode = XVIDC_VM_1440x576_50_I;
			break;
#if(CUSTOM_RESOLUTION_ENABLE == 1)
		case 21 :
			VideoMode = XVIDC_VM_1152x864_60_P;
			break;
#endif
#else
#if(CUSTOM_RESOLUTION_ENABLE == 1)
		case 19 :
			VideoMode = XVIDC_VM_1152x864_60_P;
			break;
#endif
#endif
		case 22 :
			EnableColorBar(&Hdmiphy1, &HdmiTxSs, XVIDC_VM_1920x1080_60_P, XVIDC_CSF_RGB, XVIDC_BPC_12);
			InstancePtr->WaitForColorbar = (TRUE);
			return Menu;
		case 23 :
			EnableColorBar(&Hdmiphy1, &HdmiTxSs, XVIDC_VM_3840x2160_30_P, XVIDC_CSF_RGB, XVIDC_BPC_10);
			InstancePtr->WaitForColorbar = (TRUE);
			return Menu;
		case 99 :
			xil_printf("Returning to main menu.\r\n");
			Menu = XHDMI_MAIN_MENU;
			break;
		default :
			xil_printf("Unknown option\r\n");
			XHdmi_DisplayResolutionMenu();
			break;
	}
	if (VideoMode != XVIDC_VM_NO_INPUT) {
#ifdef XPAR_XV_HDMITXSS_NUM_INSTANCES
		EnableColorBar(&Hdmiphy1, &HdmiTxSs, VideoMode, XVIDC_CSF_RGB, XVIDC_BPC_8);
#endif
		InstancePtr->WaitForColorbar = (TRUE);
	}
	return Menu;
}
static XHdmi_MenuType XHdmi_ResolutionMenu ( XHdmi_Menu * InstancePtr , u8 Input ) { XHdmi_MenuType Menu ; XVidC_VideoMode VideoMode ; Menu = XHDMI_RESOLUTION_MENU ; VideoMode = XVIDC_VM_NO_INPUT ; switch ( Input ) { case 1 : VideoMode = XVIDC_VM_720x480_60_P ; break ; case 2 : VideoMode = XVIDC_VM_720x576_50_P ; break ; case 3 : VideoMode = XVIDC_VM_1280x720_60_P ; break ; case 4 : VideoMode = XVIDC_VM_1680x720_60_P ; break ; case 5 : VideoMode = XVIDC_VM_1920x1080_60_P ; break ; case 6 : VideoMode = XVIDC_VM_2560x1080_60_P ; break ; case 7 : #if ( XPAR_HDMIPHY1_0_TRANSCEIVER != XVPHY_GTPE2 ) VideoMode = XVIDC_VM_3840x2160_60_P ; #else VideoMode = XVIDC_VM_3840x2160_30_P ; #endif break ; case 8 : #if ( XPAR_HDMIPHY1_0_TRANSCEIVER != XVPHY_GTPE2 ) VideoMode = XVIDC_VM_4096x2160_60_P ; #else VideoMode = XVIDC_VM_4096x2160_30_P ; #endif break ; case 9 : VideoMode = XVIDC_VM_1920x1080_60_I ; break ; case 10 : VideoMode = XVIDC_VM_640x480_60_P ; break ; case 11 : VideoMode = XVIDC_VM_800x600_60_P ; break ; case 12 : VideoMode = XVIDC_VM_1024x768_60_P ; break ; case 13 : VideoMode = XVIDC_VM_1280x768_60_P ; break ; case 14 : VideoMode = XVIDC_VM_1366x768_60_P ; break ; case 15 : VideoMode = XVIDC_VM_1280x1024_60_P ; break ; case 16 : VideoMode = XVIDC_VM_1680x1050_60_P ; break ; case 17 : VideoMode = XVIDC_VM_1600x1200_60_P ; break ; case 18 : VideoMode = XVIDC_VM_1920x1200_60_P ; break ; #if ( XPAR_XV_HDMITXSS_0_INCLUDE_LOW_RESO_VID == 1 ) case 19 : VideoMode = XVIDC_VM_1440x480_60_I ; break ; case 20 : VideoMode = XVIDC_VM_1440x576_50_I ; break ; #if ( CUSTOM_RESOLUTION_ENABLE == 1 ) case 21 : VideoMode = XVIDC_VM_1152x864_60_P ; break ; #endif #else #if ( CUSTOM_RESOLUTION_ENABLE == 1 ) case 19 : VideoMode = XVIDC_VM_1152x864_60_P ; break ; #endif #endif case 22 : EnableColorBar ( & Hdmiphy1 , & HdmiTxSs , XVIDC_VM_1920x1080_60_P , XVIDC_CSF_RGB , XVIDC_BPC_12 ) ; InstancePtr -> WaitForColorbar = ( TRUE ) ; return Menu ; case 23 : EnableColorBar ( & Hdmiphy1 , & HdmiTxSs , XVIDC_VM_3840x2160_30_P , XVIDC_CSF_RGB , XVIDC_BPC_10 ) ; InstancePtr -> WaitForColorbar = ( TRUE ) ; return Menu ; case 99 : xil_printf ( " \r \n " ) ; Menu = XHDMI_MAIN_MENU ; break ; default : xil_printf ( " \r \n " ) ; XHdmi_DisplayResolutionMenu ( ) ; break ; } if ( VideoMode != XVIDC_VM_NO_INPUT ) { #ifdef XPAR_XV_HDMITXSS_NUM_INSTANCES EnableColorBar ( & Hdmiphy1 , & HdmiTxSs , VideoMode , XVIDC_CSF_RGB , XVIDC_BPC_8 ) ; #endif InstancePtr -> WaitForColorbar = ( TRUE ) ; } return Menu ; }
This function implements the HDMI resolution menu state.
This function implements the HDMI resolution menu state .
// Variables // Default // 720 x 480p // 720  x 576p // 1280 x 720p // 1680 x 720p // 1920 x 1080p // 2560 x 1080p // 3840 x 2160p // 4096 x 2160p // 1920 x 1080i // 640 x 480p (VGA) // 800 x 600p (SVGA) //  1024 x 768p (XGA) // 1280 x 768p (WXGA) // 1366 x 768p (WXGA+) // 1280 x 1024p (SXGA) // 1680 x 1050p (WSXGA+) // 1600 x 1200p (UXGA) // 1920 x 1200p (WUXGA) // 720 x 480i (NTSC) // 720 x 576i (PAL) //3840 x 2160p (SB) (Custom) // Exit