The tcDspAdc8402 class may be used to provide access to the MityDSP ADS8402 interface core. The ADS8402 interface core marries the MityDSP to a Burr Brown ADS8402 series high speed 16 bit analog to digital converter.
This class allows for configuring the ADC to provide continuous or burst data colletion data.
This is a simple example of tcDspAdc8402 creation and usage:
{ tcDspAdc8402* mpADC; int numwords; volatile unsigned int* lpData; unsigned int tmp, index; // new up the ADS8402 core. mpADC = new tcDspAdc8402((void*)BASE_ADDR); // burst capture of 512 samples mpADC->Enable(false); mpADC->DrainFIFO(); mpADC->SetBurstCapture(true); mpADC->SetCaptureLength(512); mpADC->ClearBurstComplete(); mpADC->Enable(true); mpADC->SetPack(false); while(false == mpADC->IsBurstComplete()); mpADC->Enable(false); numwords = mpADC->GetFIFOLevel(); lpData = mpADC->GetFIFODataPtr(); index = 0; while(false == mpADC->GetFIFOLevel(eeEmpty)) { tmp = *lpData; printf("%d - %8.8X\r\n",index,tmp); } ... }