00001
00035
00036 #ifndef CLDAQ__TCAMACCRATECONTROLLER_HH
00037 #define CLDAQ__TCAMACCRATECONTROLLER_HH
00038
00039 #include "Tglobals.h"
00040 #include "TModule.hh"
00041
00042 #define CC7x00_IOC_MAGIC 0xcc
00043 #define IOC_TEST_ONLINE _IO( CC7x00_IOC_MAGIC, 0x02 )
00044 #define IOC_RESET_CRATE _IO( CC7x00_IOC_MAGIC, 0x03 )
00045 #define IOC_SET_Z _IO( CC7x00_IOC_MAGIC, 0x04 )
00046 #define IOC_SET_C _IO( CC7x00_IOC_MAGIC, 0x05 )
00047 #define IOC_SET_I _IO( CC7x00_IOC_MAGIC, 0x06 )
00048 #define IOC_RESET_I _IO( CC7x00_IOC_MAGIC, 0x07 )
00049 #define IOC_SET_EI _IO( CC7x00_IOC_MAGIC, 0x08 )
00050 #define IOC_RESET_EI _IO( CC7x00_IOC_MAGIC, 0x09 )
00051 #define IOC_SET_LI _IO( CC7x00_IOC_MAGIC, 0x0a )
00052 #define IOC_RESET_LI _IO( CC7x00_IOC_MAGIC, 0x0b )
00053 #define IOC_SET_CN _IOW( CC7x00_IOC_MAGIC, 0x0c, TUint )
00054 #define IOC_WAIT_LAM _IOW( CC7x00_IOC_MAGIC, 0x0d, TUint** )
00055 #define IOC_GET_LAM _IOR( CC7x00_IOC_MAGIC, 0x0e, TUint* )
00056 #define IOC_CAM16 _IOR( CC7x00_IOC_MAGIC, 0x0f, struct TCamacDriverInterface )
00057 #define IOC_CAM24 _IOR( CC7x00_IOC_MAGIC, 0x10, struct TCamacDriverInterface )
00058
00059
00079 class TCamacCrateController
00080 : public TModule
00081 {
00082
00083 private:
00084 TcamacCrateController_t theCrateControllerType;
00085 Tint theCrateID;
00086 Tint theFileDescriptor;
00087 Tbool theISA7000;
00088
00089 public:
00090 TCamacCrateController();
00091 TCamacCrateController( TcamacCrateController_t cctype );
00092 TCamacCrateController( const TCamacCrateController& right );
00093 ~TCamacCrateController();
00094
00095 public:
00096 Tbool IsOnline();
00097 Tbool IsOpen();
00098 Tvoid Open();
00099 Tvoid Close();
00100 Tint Reset();
00101 Tint SetInhibition();
00102 Tint ReleaseInhibition();
00103 Tint EnableInterrupt();
00104 Tint DisableInterrupt();
00105
00106 public:
00107 Tint Clear();
00108 Tint Update();
00109 Tint Initialize();
00110 Tvoid FillData( TDataElement& element, Tint channel );
00111
00112 public:
00113 const TCamacCrateController& operator=( const TCamacCrateController& right );
00114 Tbool operator==( const TCamacCrateController& right ) const;
00115 Tbool operator!=( const TCamacCrateController& right ) const;
00116
00117 public:
00118 TcamacCrateController_t GetCrateControllerType() const;
00119 Tint GetCrateID() const;
00120 Tint GetFileDescriptor() const;
00121 Tvoid SetCrateControllerType( TcamacCrateController_t type );
00122 Tvoid SetCrateID( Tint crateid );
00123 Tvoid SetFileDescriptor( Tint fd );
00124 Tbool IsISA7000() const;
00125
00126 #ifdef __CLDAQ_ROOT_DLL
00127 ClassDef(TCamacCrateController,0)
00128 #endif
00129
00130 };
00131
00132 inline TcamacCrateController_t TCamacCrateController::GetCrateControllerType() const
00133 {
00134 return theCrateControllerType;
00135 }
00136
00137 inline Tint TCamacCrateController::GetCrateID() const
00138 {
00139 return theCrateID;
00140 }
00141
00142 inline Tint TCamacCrateController::GetFileDescriptor() const
00143 {
00144 return theFileDescriptor;
00145 }
00146
00147 inline Tvoid TCamacCrateController::SetFileDescriptor( Tint fd )
00148 {
00149 theFileDescriptor = fd;
00150 return;
00151 }
00152
00153 inline Tbool TCamacCrateController::IsISA7000() const
00154 {
00155 return theISA7000;
00156 }
00157
00158 #endif