void avnet_console_start_command( avnet_console_t *pConsole, int cargc, char ** cargv ) { int bDispSyntax = 0; if ( cargc > 1 && !strcmp(cargv[1],"help") ) { bDispSyntax = 1; } else if ( cargc > 1 ) { if ( !strcmp(cargv[1],"hdmi") ) { demo_stop_frame_buffer(pdemo); demo_init_frame_buffer(pdemo); demo_start_hdmi_out(pdemo); pdemo->cam_alpha = 0x00; pdemo->hdmi_alpha = 0xFF; demo_start_hdmi_in(pdemo); demo_start_frame_buffer(pdemo); } else if ( !strcmp(cargv[1],"cam") ) { demo_stop_frame_buffer(pdemo); demo_init_frame_buffer(pdemo); demo_start_hdmi_out(pdemo); pdemo->cam_alpha = 0xFF; pdemo->hdmi_alpha = 0x00; demo_start_cam_in(pdemo); demo_start_frame_buffer(pdemo); } } if ( bDispSyntax ) { pConsole->io_hprintf( pConsole->io_handle, "\tSyntax :\r\n" ); pConsole->io_hprintf( pConsole->io_handle, "\t\tstart cam => Start CAM video source\r\n" ); pConsole->io_hprintf( pConsole->io_handle, "\t\tstart hdmi => Start HDMI video source\r\n" ); } return; }
int main() { xil_printf("\n\r"); xil_printf("------------------------------------------------------\n\r"); xil_printf("-- FMC-IMAGEON --\n\r"); xil_printf("-- Getting Started Design --\n\r"); xil_printf("------------------------------------------------------\n\r"); xil_printf("\n\r"); pdemo = &demo; demo_init( pdemo ); // Init reference design demo_init_frame_buffer(pdemo); // Try CAM first pdemo->cam_alpha = 0xFF; pdemo->hdmi_alpha = 0x00; if ( !demo_start_cam_in(pdemo) ) { // Then try HDMI pdemo->cam_alpha = 0x00; pdemo->hdmi_alpha = 0xFF; demo_start_hdmi_in(pdemo); } demo_start_frame_buffer(pdemo); // Start serial console print_avnet_console_serial_app_header(); start_avnet_console_serial_application(); while (1) { if (transfer_avnet_console_serial_data()) { break; } } return 0; // xil_printf("\r\n\tPress 0-9 to change alpha blending of hdmi/camera layers\r\n"); // xil_printf("\r\n\tPress ENTER to restart\r\n\r\n" ); // c = getchar(); // if ( c >= '0' && c <= '9' ) // { // camera_alpha = (c - '0') * 28; // hdmi_alpha = ('9' - c) * 28; // } // if ( c == '+' ) // { // if ( pdemo->pvita_receiver->uManualTap < 31 ) // pdemo->pvita_receiver->uManualTap++; // xil_printf( "\tuManualTap = %d\n\r", pdemo->pvita_receiver->uManualTap ); // } // if ( c == '-' ) // { // if ( pdemo->pvita_receiver->uManualTap > 0 ) // pdemo->pvita_receiver->uManualTap--; // xil_printf( "\tuManualTap = %d\n\r", pdemo->pvita_receiver->uManualTap ); // } //} return 0; }
void avnet_console_test_hdmi_command( avnet_console_t *pConsole, int cargc, char ** cargv ) { int bDispSyntax = 0; int bPass = 0; char c; if ( cargc > 1 && !strcmp(cargv[1],"help") ) { bDispSyntax = 1; } else if ( cargc == 2 && !strcmp(cargv[1],"test") ) { pConsole->io_hprintf( pConsole->io_handle, "\n\r" ); pConsole->io_hprintf( pConsole->io_handle, "---------------------------------------------------\n\r" ); pConsole->io_hprintf( pConsole->io_handle, "---- TEST 3 : HDMI Pass-Through Test ----\n\r" ); pConsole->io_hprintf( pConsole->io_handle, "---------------------------------------------------\n\r" ); demo_stop_frame_buffer(pdemo); demo_init_frame_buffer(pdemo); pdemo->cam_alpha = 0x00; pdemo->hdmi_alpha = 0xFF; demo_start_hdmi_in(pdemo); demo_start_frame_buffer(pdemo); bPass = 0; if ( (pdemo->hdmii_height == 720) && (pdemo->hdmii_width == 1280) ) { bPass = 1; } pConsole->io_hprintf( pConsole->io_handle, "HDMI Input Detection ........................ " ); if ( bPass ) { pConsole->io_hprintf( pConsole->io_handle, "PASS!\n\r" ); } else { pConsole->io_hprintf( pConsole->io_handle, "FAIL!\n\r" ); } pConsole->io_hprintf( pConsole->io_handle, "Enter result of visual test\n\r" ); pConsole->io_hprintf( pConsole->io_handle, "\t(Y=pass, N=fail) : " ); c = ' '; while ( 1 ) { c = inbyte(); if ( c == 'y' || c == 'Y' ) { bPass = 1; break; } if ( c == 'n' || c == 'N' ) { bPass = 0; break; } } pConsole->io_hprintf( pConsole->io_handle, "%c\n\r", c ); pConsole->io_hprintf( pConsole->io_handle, "HDMI Visual Test ............................. " ); if ( bPass ) { pConsole->io_hprintf( pConsole->io_handle, "PASS!\n\r" ); } else { pConsole->io_hprintf( pConsole->io_handle, "FAIL!\n\r" ); } } if ( bDispSyntax ) { pConsole->io_hprintf( pConsole->io_handle, "\tSyntax :\r\n" ); pConsole->io_hprintf( pConsole->io_handle, "\t\thdmi test => Test HDMI Interfaces (requires loopback cable)\r\n" ); } return; }