Generic hardware access library
|
00001 #ifndef __VMESlot 00002 #define __VMESlot 00003 00004 #include <list> 00005 #include <vector> 00006 #include <string> 00007 00008 #include "hal/VMEConfigurationSpaceHandler.hh" 00009 #include "hal/AddressTableContainerInterface.hh" 00010 #include "hal/ModuleMapperInterface.hh" 00011 #include "hal/VME64xFunction.hh" 00012 #include "hal/VMEDevice.hh" 00013 #include "hal/VME64xHardwareAddress.hh" 00014 #include "VMEConstants.h" 00015 #include "hal/StaticVMEItem.hh" 00016 00017 namespace HAL { 00018 00019 enum SlotContents{ EMPTY, VME, VME64x }; 00020 00043 class VMESlot { 00044 00045 public: 00046 00062 VMESlot( uint32_t slotNumber, 00063 VMEConfigurationSpaceHandler* configAdapterPtr, 00064 AddressTableContainerInterface& addressTableContainer, 00065 ModuleMapperInterface & moduleMapper, 00066 bool ignoreChecksumError = false) 00067 throw( IllegalValueException, 00068 UnsupportedException ); 00069 00074 VMESlot( StaticVMEItem* staticVME, 00075 VMEBusAdapterInterface* busAdapterPtr, 00076 AddressTableContainerInterface& addressTableContainer, 00077 ModuleMapperInterface & moduleMapper ) 00078 throw( IllegalValueException ); 00079 00080 00081 virtual ~VMESlot(); 00082 00083 enum SlotContents getContents() const; 00084 00085 std::string getTypeId() const; 00086 00091 std::string getSerialNumber() const; 00092 00099 std::list< VME64xFunction* > getImplementedFunctions() const; 00100 00108 VMEDevice* getVMEDevice() const 00109 throw( IllegalOperationException, 00110 IllegalValueException, 00111 UnsupportedException, 00112 BusAdapterException, 00113 NoSuchItemException ); 00117 uint32_t getSlotId() const; 00118 00132 void stdConfigRead( std::string item, 00133 uint32_t* resultPtr, 00134 uint32_t offset = 0 ) const 00135 throw( NoSuchItemException, 00136 IllegalOperationException, 00137 BusAdapterException ); 00138 00139 00155 void stdConfigWrite( std::string item, 00156 uint32_t data, 00157 HalVerifyOption verifyFlag = HAL_NO_VERIFY, 00158 uint32_t offset = 0 ) const 00159 throw( NoSuchItemException, 00160 IllegalOperationException, 00161 BusAdapterException ); 00162 00163 00164 private: 00171 void checkVME64xTable( VMEAddressTable& table ) const 00172 throw( IllegalValueException ); 00173 00174 uint32_t slotId_; 00175 VMEConfigurationSpaceHandler* configAdapterPtr_; 00176 VMEBusAdapterInterface* busAdapterPtr_; 00177 AddressTableContainerInterface& addressTableContainer_; 00178 ModuleMapperInterface& moduleMapper_; 00179 enum SlotContents contents_; 00180 00186 std::list< VME64xFunction* > functionPtrs_; 00187 00188 std::string serialNumber_; 00189 std::string typeId_; 00190 00195 std::vector< const VME64xMappedWindow* > windowVector_; 00196 00197 00198 }; 00199 00200 } /* namespace HAL */ 00201 00202 #endif /* __VMESlot */ 00203