// BoardIo.h // // Board-specific data flow and hardware I/O #ifndef BoardIoH #define BoardIoH #include #include #include #include class BoardIo; //=========================================================================== // CLASS BoardIo -- Hardware Access and Board Io Class //=========================================================================== class BoardIo { friend class X5ScriptPlayer; typedef std::vector<__int64> IntArray; public: // // Member Functions BoardIo(); ~BoardIo(); Innovative::X5_400M & operator() () { return Module; } Innovative::X5_400M & Ref() { return Module; } unsigned int BoardCount(); void Open(); void Close(); void CfgMain(int SampFreq,int ClockInternal,int SyncAD,float *rx, float *tx, void (*sync)(void), int direct); void CfgAD(int ADsamples,int ADdecimate,int ADprint, int _ADscale); void CfgDA(int DAsamples,int DAdecimate,int DAinterpolate,int DAdivider,int DAdosin,int DAsendad, int DAprint, int DAsinfreq, int _DAscale); void StartStreaming(); void StopStreaming(); bool IsTriggered() { return FTriggered >= 0; } unsigned int Channels() const { return 2; } ii64 BlockCount() const { return FBlockCount; } private: // // Member Data double FBlockRate; ii64 FBlockCount; int FChannels; int FDevices; int FTicks; int FTriggered; float *rxBuffer, *txBuffer; void (*syncTs)(void); bool ad_enabled; bool da_enabled; bool do_sin; bool syncAd; bool ad_print; bool da_print; bool da_sendad; int ADscale; int DAscale; int ADPacketSize; int SampleRate; int DAPacketSize; Innovative::X5_400M Module; Innovative::PacketStream Stream; bool Opened; bool Stopped; bool StreamConnected; // // Member Functions void HandleDataAvailable(Innovative::PacketStreamDataEvent & Event); void HandleDataRequired(Innovative::PacketStreamDataEvent & Event); void HandleDirectDataAvailable(Innovative::PacketStreamDirectDataEvent & Event); void HandleDirectDataRequired(Innovative::PacketStreamDirectDataEvent & Event); void HandleInputFifoOverrunAlert(Innovative::AlertSignalEvent & event); void HandleOutputFifoUnderrunAlert(Innovative::AlertSignalEvent & event); void DisplayLogicVersion(); void SetInputSoftwareTrigger(bool state); void SetOutputSoftwareTrigger(bool state); }; #endif