00001
00002
00003
00004
00005 #ifndef __TCAMACCRATECONTROLLER_HH
00006 #define __TCAMACCRATECONTROLLER_HH
00007
00008 #include "Tglobals.h"
00009 #include "TModule.hh"
00010
00011 #define CC7x00_IOC_MAGIC 0xcc
00012 #define IOC_TEST_ONLINE _IO( CC7x00_IOC_MAGIC, 0x02 )
00013 #define IOC_RESET_CRATE _IO( CC7x00_IOC_MAGIC, 0x03 )
00014 #define IOC_SET_Z _IO( CC7x00_IOC_MAGIC, 0x04 )
00015 #define IOC_SET_C _IO( CC7x00_IOC_MAGIC, 0x05 )
00016 #define IOC_SET_I _IO( CC7x00_IOC_MAGIC, 0x06 )
00017 #define IOC_RESET_I _IO( CC7x00_IOC_MAGIC, 0x07 )
00018 #define IOC_SET_EI _IO( CC7x00_IOC_MAGIC, 0x08 )
00019 #define IOC_RESET_EI _IO( CC7x00_IOC_MAGIC, 0x09 )
00020 #define IOC_SET_LI _IO( CC7x00_IOC_MAGIC, 0x0a )
00021 #define IOC_RESET_LI _IO( CC7x00_IOC_MAGIC, 0x0b )
00022 #define IOC_SET_CN _IOW( CC7x00_IOC_MAGIC, 0x0c, TUint )
00023 #define IOC_WAIT_LAM _IOW( CC7x00_IOC_MAGIC, 0x0d, TUint** )
00024 #define IOC_GET_LAM _IOR( CC7x00_IOC_MAGIC, 0x0e, TUint* )
00025 #define IOC_CAM16 _IOR( CC7x00_IOC_MAGIC, 0x0f, struct CamacDriverInterface )
00026 #define IOC_CAM24 _IOR( CC7x00_IOC_MAGIC, 0x10, struct CamacDriverInterface )
00027
00028 class TCamacCrateController
00029 : public TModule
00030 {
00031
00032 private:
00033 TcamacCrateController_t theCrateControllerType;
00034 Tint theCrateID;
00035 Tint theFileDescriptor;
00036 Tbool theISA7000;
00037
00038 public:
00039 TCamacCrateController();
00040 TCamacCrateController( TcamacCrateController_t cctype );
00041 TCamacCrateController( const TCamacCrateController& right );
00042 ~TCamacCrateController();
00043
00044 public:
00045 Tbool IsOnline();
00046 Tbool IsOpen();
00047 Tvoid Open();
00048 Tvoid Close();
00049 Tint Reset();
00050 Tint SetInhibition();
00051 Tint ReleaseInhibition();
00052 Tint EnableInterrupt();
00053 Tint DisableInterrupt();
00054
00055 public:
00056 Tint Clear();
00057 Tint Update();
00058 Tint Initialize();
00059 Tvoid FillData( TDataElement& element, Tint channel );
00060
00061 public:
00062 const TCamacCrateController& operator=( const TCamacCrateController& right );
00063 Tbool operator==( const TCamacCrateController& right ) const;
00064 Tbool operator!=( const TCamacCrateController& right ) const;
00065
00066 public:
00067 TcamacCrateController_t GetCrateControllerType() const;
00068 Tint GetCrateID() const;
00069 Tint GetFileDescriptor() const;
00070 Tvoid SetCrateControllerType( TcamacCrateController_t type );
00071 Tvoid SetCrateID( Tint crateid );
00072 Tvoid SetFileDescriptor( Tint fd );
00073 Tbool IsISA7000() const;
00074
00075 };
00076
00077 inline TcamacCrateController_t TCamacCrateController::GetCrateControllerType() const
00078 {
00079 return( theCrateControllerType );
00080 }
00081
00082 inline Tint TCamacCrateController::GetCrateID() const
00083 {
00084 return( theCrateID );
00085 }
00086
00087 inline Tint TCamacCrateController::GetFileDescriptor() const
00088 {
00089 return( theFileDescriptor );
00090 }
00091
00092 inline Tvoid TCamacCrateController::SetFileDescriptor( Tint fd )
00093 {
00094 theFileDescriptor = fd;
00095 return;
00096 }
00097
00098 inline Tbool TCamacCrateController::IsISA7000() const
00099 {
00100 return( theISA7000 );
00101 }
00102
00103 #endif