// ADWG_InfiniteLoop.cpp : Defines the entry point for the console application. // #include #include #include #include #include "stdafx.h" extern "C" { #include "ADWGC.h" } int _tmain(int argc, _TCHAR* argv[]) { // // Go to the work directory // printf("\nGoing to the work directory...\n"); #ifdef _DEBUG _chdir("..\\debug"); #else _chdir("..\\release"); #endif; // // Open library // printf("\nOpening the ADWGC library...\n"); adwg_ADWGC(); // // Configure the job // printf("\nConfiguring device...\n"); adwg_UseIntClock(); // Select the internal clock source adwg_SetReqClock(1000000); // Set clock freq. to 1MHz adwg_SetOutputClock(true); // Output the generated clock adwg_SetClockContinuity(false); // Select continuous clock mode adwg_SetClockEdge(true); // Patterns change on rising edge adwg_SetOutClockRatio(1); // Clock ratio = 1, i.e. no clock division at the output adwg_SetInternalTrigger(true); // External trigger is not used, pattern generation // start immediately adwg_DisCtrlSeq(); // Disable control sequence adwg_DisDefaultCtrl(); // Disable default values on control lines short DataEnable = (short)0xFFFF; adwg_SetDataMaskOut(&DataEnable); // Enable all data lines // // Added some sample to a cleared buffer // adwg_ClearBuffer(); printf("\nWriting patterns...\n"); int BlockLength = 2048; // in WORDs short *pBlock = (short *)malloc(BlockLength*2); for (int i=0; i