예제 #1
0
static void DumpDeviceInformation ()
{
	std::string sId = s_cfgDevice.IdentifyDevice();
	std::string sVer = s_cfgDevice.FirmwareVersion();
	uint16 idFpga = s_cfgDevice.FpgaId();
	uint16 verFpga = s_cfgDevice.FpgaVersion();
	int iVer = (verFpga >> 8);
	int iRev = (verFpga & 0x00ff);

	printf("\n");
	printf("Identity:    %s\n", sId.c_str());
	printf("FW Ver:      %s\n", sVer.c_str());
	printf("FPGA ID-Ver: %04X-%02X.%02X\n\n", idFpga, iVer, iRev);
}
예제 #2
0
// This program demonstrates how to use the ConfigeDevice class to easily attach
// to an ASR-2300 device.  Then using the TransportDci to set a custom property on the default waveform 
// component.  The property (A0) sets an LED blink rate in the custom HDL container demonstrated at the 
// Loctronix A2300 Open Source Webinar presentation dated 2/18/14.  Be sure to build and load the corresponding
// verilog container in the hdl/containers directory to use with this demo application. See
// http://www.loctronix.com/news/webinars/LoctronixWebinar-2-140218.pdf for discussion and setup.
int main(int, char**)
{

	// Attach to the first device we find.
	ConfigDevice config;
	int result = config.Attach();
	if( result < 0)
	{
		printf("Could not attach ASR-2300 device\n");
		return result;
	}
	else
		printf( "ASR-2300 Device Opened\n");

	//Get the FPGA ID and Version
	uint16	    idFpga 		= config.FpgaId();
	uint16 		verFpga 	= config.FpgaVersion();
	int  		iVer = (verFpga>>8);
	int	 		iRev = (verFpga& 0x00ff);
	printf("  FPGA ID-Ver:  %04X - %02X.%02X\n\n", idFpga, iVer, iRev);


	//Set the custom register( id = A0) setting the frequency
	//on the LED blinker from slowest rate to 16 times slowest rate
	TransportDci& dt = config.Dci0Transport();
	for( uint32 i = 0; i < 4; i++)
	{
		uint32 countval = 1 + i*16;

		printf("Setting Blink Rate Count Value = %d\n", countval);  
		
		dt.SetProperty<uint32>( 0x00, 0xA0, 1 + i*16);
		SLEEP_SEC(5);		
	}

	//Detach from ASR-2300 
	config.Detach();
	return(0);
}