Rhd2000DataBlock RunSingleCommandSequence() { // Start SPI interface. evalBoard.Run(); // Wait for the 60-sample run to complete. while (evalBoard.IsRunning()) { Thread.Sleep(0); } // Read the resulting single data block from the USB interface. var dataBlock = new Rhd2000DataBlock(evalBoard.GetNumEnabledDataStreams(), evalBoard.IsUsb3()); evalBoard.ReadDataBlock(dataBlock); return(dataBlock); }
private void Load() { evalBoard = new Rhythm.Net.Rhd2000EvalBoard(); // Open Opal Kelly XEM6010 board. evalBoard.Open(); samplesPerBlock = Rhd2000DataBlock.GetSamplesPerDataBlock(evalBoard.IsUsb3()); try { // Load Rhythm FPGA configuration bitfile (provided by Intan Technologies). evalBoard.UploadFpgaBitfile(BitFileName); // Initialize interface board. evalBoard.Initialize(); // Set sample rate and upload all auxiliary SPI command sequences. ChangeSampleRate(SampleRate); // Run ADC calibration RunCalibration(); // Set default configuration for all eight DACs on interface board. SetDacDefaultConfiguration(); // Find amplifier chips connected to interface board and compute their // optimal delay parameters. ScanConnectedAmplifiers(); } catch { // Close interface board in case of configuration errors evalBoard.Close(); throw; } }