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