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