DspDump.cxx

00001 void DspDump () {
00002   gSystem->Load("libTApi.so");
00003 
00004   if(!tapi) 
00005     tapi = new TApi();
00006 
00007   tapi->initialiseAll(1);
00008 
00009   // get DSP number (-1 for MDSP) starting address and number of bytes to read
00010 
00011   char response;
00012   do {
00013     int dspNumber, dspStart, dspEnd;
00014 
00015     cout << "DSP number (-1 for Master):";
00016     cin >> dspNumber;
00017     hex(cin);
00018     cout << "Starting address (hex): ";
00019     cin >> dspStart;
00020     cout << "Ending address (hex): ";
00021     cin >> dspEnd;
00022     dec(cin);
00023     if(dspEnd < dspStart) {
00024       cout << "Start must be less than end, skipping\n";
00025     } else {
00026       int numWords = (dspEnd +1 - dspStart)/4;
00027 
00028       tapi->DspBlockRead(0, dspStart, numWords, dspNumber);
00029     }    
00030 
00031     // do another?
00032     cout << "Do another? [Y/n]: ";
00033     cin >> response;
00034   } while (response != 'n');
00035 
00036   // Clean up before exiting
00037   delete tapi;
00038 
00039   return ; 
00040 }
00041 
00042 

Generated on Mon Feb 6 14:01:19 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6