Exemple #1
0
int main()
{
	xil_printf("\n\r");
	xil_printf("------------------------------------------------------\n\r");
	xil_printf("--       PZSDR FMC Carrier Card + PYTHON-1300-C     --\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->tpg_alpha = 0x00;
	demo_start_cam_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;
}
Exemple #2
0
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;
}
Exemple #3
0
void avnet_console_test_camera_command( avnet_console_t *pConsole, int cargc, char ** cargv )
{
   int bDispSyntax = 0;
   Xuint32 frameWidth;
   Xuint32 frameHeight;
   Xuint32 frameRate;
   int bPass = 0;
   char c;

   Xuint32 uManualTap;

   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 4 : Camera (PYTHON-1300-C) Test      ----\n\r" );
	  pConsole->io_hprintf( pConsole->io_handle, "---------------------------------------------------\n\r" );


     //for ( uManualTap = 0; uManualTap < 32; uManualTap++ )
     uManualTap = pdemo->ppython_receiver->uManualTap; // optimal tap setting for FMC-HDMI-CAM
     {
      demo_stop_frame_buffer(pdemo);
      demo_init_frame_buffer(pdemo);

      pConsole->io_hprintf( pConsole->io_handle, "Detecting PYTHON-1300-C Camera ...\n\r" );

      pdemo->cam_alpha = 0xFF;
      pdemo->hdmi_alpha = 0x00;
      demo_start_cam_in(pdemo);

      demo_start_frame_buffer(pdemo);

	  sleep(1);
	  onsemi_python_get_status( pdemo->ppython_receiver, &(pdemo->python_status_t1), 0 );
	  sleep(1);
	  onsemi_python_get_status( pdemo->ppython_receiver, &(pdemo->python_status_t2), 0 );
	  //
	  frameWidth  = pdemo->python_status_t1.cntImagePixels * 4;
	  frameHeight = pdemo->python_status_t1.cntImageLines;
	  frameRate   = pdemo->python_status_t2.cntFrames - pdemo->python_status_t1.cntFrames;
	  if ( pConsole->verbose )
      {
         pConsole->io_hprintf( pConsole->io_handle, "PYTHON Status\n\r" );
         pConsole->io_hprintf( pConsole->io_handle, "\tBlack Lines  = %d\n\r", pdemo->python_status_t2.cntBlackLines );
         pConsole->io_hprintf( pConsole->io_handle, "\tImage Lines  = %d\n\r", pdemo->python_status_t2.cntImageLines );
         pConsole->io_hprintf( pConsole->io_handle, "\tBlack Pixels = %d\n\r", pdemo->python_status_t2.cntBlackPixels*4 );
         pConsole->io_hprintf( pConsole->io_handle, "\tImage Pixels = %d\n\r", pdemo->python_status_t2.cntImagePixels*4 );
         pConsole->io_hprintf( pConsole->io_handle, "\tFrames       = %d\n\r", pdemo->python_status_t2.cntFrames );
         pConsole->io_hprintf( pConsole->io_handle, "\tWindows      = %d\n\r", pdemo->python_status_t2.cntWindows );
         pConsole->io_hprintf( pConsole->io_handle, "\tStart Lines  = %d\n\r", pdemo->python_status_t2.cntStartLines );
         pConsole->io_hprintf( pConsole->io_handle, "\tEnd Lines    = %d\n\r", pdemo->python_status_t2.cntEndLines );
         pConsole->io_hprintf( pConsole->io_handle, "\t(End-Start)  = %d\n\r", pdemo->python_status_t2.cntEndLines - pdemo->python_status_t2.cntStartLines );

         pConsole->io_hprintf( pConsole->io_handle, "\tClocks       = %d\n\r", pdemo->python_status_t2.cntClocks );

         pConsole->io_hprintf( pConsole->io_handle, "\tCRC Status   = 0x%08X\n\r", pdemo->python_status_t2.crcStatus );

         pConsole->io_hprintf( pConsole->io_handle, "\tImage Width  = %d\n\r", frameWidth );
	     pConsole->io_hprintf( pConsole->io_handle, "\tImage Height = %d\n\r", frameHeight  );
	     pConsole->io_hprintf( pConsole->io_handle, "\tFrame Rate   = %d frames/sec\n\r", frameRate );

         pConsole->io_hprintf( pConsole->io_handle, "VITA Status = \n\r" );
         pConsole->io_hprintf( pConsole->io_handle, "\tCRC Status   = 0x%02X\n\r", pdemo->python_status_t2.crcStatus );
	  }
	  else
	  {
		 pConsole->io_hprintf( pConsole->io_handle, "\tImage Width  = %d\n\r", frameWidth );
		 pConsole->io_hprintf( pConsole->io_handle, "\tImage Height = %d\n\r", frameHeight  );
		 pConsole->io_hprintf( pConsole->io_handle, "\tFrame Rate   = %d frames/sec\n\r", frameRate );
	  }

	  if ( (frameWidth != 1280) || (frameHeight != 1023) ) // based on working hardware
	  {
         pConsole->io_hprintf( pConsole->io_handle, "\tERROR : Invalid frame dimensions (%d x %d)\n\r", frameWidth, frameHeight );
	  }
	  //else if ( (frameRate < 50) || (frameRate > 70)  ) // 60 frame/sec
	  else if ( (frameRate < 35) || (frameRate > 40)  ) // 37-38 frame/sec
      {
         pConsole->io_hprintf( pConsole->io_handle, "\tERROR : Invalid frame rate (%d frames/sec)\n\r", frameRate );
      }
	  else if ( (pdemo->python_status_t2.cntStartLines != pdemo->python_status_t2.cntEndLines) )
	  {
         pConsole->io_hprintf( pConsole->io_handle, "\tERROR : Mismatching number for StartLine (%d) & EndLine (%d)\n\r", pdemo->python_status_t2.cntStartLines, pdemo->python_status_t2.cntEndLines );
	  }
	  else if ( (pdemo->python_status_t2.crcStatus != 0x00) )
	  {
         pConsole->io_hprintf( pConsole->io_handle, "\tERROR : CRC checksum errors (0x%02X)\n\r", pdemo->python_status_t2.crcStatus );
	  }
	  else
	  {
         bPass = 1;
	  }

      if ( bPass )
      {
    	   pConsole->io_hprintf( pConsole->io_handle, "PYTHON-1300-C Camera detection ............... PASS!\n\r" );
      }
      else
      {
    	   pConsole->io_hprintf( pConsole->io_handle, "PYTHON-1300-C Camera detection ............... FAIL!\n\r" );
      }
     } // for ( uManualTap = 0; uManualTap < 32; uManualTap++ )

     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, "PYTHON-1300-C Camera 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\tcamera test     => Test Camera Interface (requires VITA-2000 camera module)\r\n" );
   }

   return;
}