00001 /* 00002 * $RCSfile: DIOStreamSubsystem.hpp,v $ 00003 * $Revision: 1.9 $ 00004 * $Date: 2010/01/29 00:08:11 $ 00005 * jEdit:tabSize=4:collapseFolds=1: 00006 * 00007 * class DIOStreamSubsystem declarations 00008 */ 00009 00010 #if ! defined( DIOStreamSubsystem_hpp ) 00011 #define DIOStreamSubsystem_hpp 00012 00013 // {{{ includes 00014 #include <DeviceSubsystem.hpp> 00015 // }}} 00016 00017 namespace AIOUSB { 00018 00025 class DIOStreamSubsystem : public DeviceSubsystem { 00026 friend class USB_DIO_16_Family; 00027 00028 // {{{ protected members 00029 protected: 00030 double clockHz; // last actual frequency set by setClock() 00031 // }}} 00032 00033 // {{{ protected methods 00034 protected: 00035 DIOStreamSubsystem( USBDevice &parent ); 00036 virtual ~DIOStreamSubsystem(); 00037 // }}} 00038 00039 // {{{ public methods 00040 public: 00041 00042 /* 00043 * properties 00044 */ 00045 00046 virtual std::ostream &print( std::ostream &out ); 00047 00048 /* 00049 * configuration 00050 */ 00051 00059 int getStreamingBlockSize() const { 00060 return parent->getStreamingBlockSize(); 00061 } // getStreamingBlockSize() 00062 00072 DIOStreamSubsystem &setStreamingBlockSize( int blockSize ) { 00073 parent->setStreamingBlockSize( blockSize ); 00074 return *this; 00075 } // setStreamingBlockSize() 00076 00083 double getClock() const { 00084 return clockHz; 00085 } // getClock() 00086 00087 double setClock( bool directionRead, double clockHz ); 00088 00095 DIOStreamSubsystem &stopClock() { 00096 setClock( false /* which clock doesn't matter */, 0 ); 00097 return *this; 00098 } // stopClock() 00099 00100 /* 00101 * operations 00102 */ 00103 00104 DIOStreamSubsystem &open( bool directionRead ); 00105 DIOStreamSubsystem &close(); 00106 UShortArray read( int numSamples ); 00107 int write( const UShortArray &values ); 00108 00119 DIOStreamSubsystem &clearFIFO( int method ) { 00120 parent->clearFIFO( method ); 00121 return *this; 00122 } // clearFIFO() 00123 00124 // }}} 00125 00126 }; // class DIOStreamSubsystem 00127 00128 } // namespace AIOUSB 00129 00130 #endif 00131 00132 /* end of file */