Generic hardware access library
|
00001 #ifndef __VME64xMappedWindow 00002 #define __VME64xMappedWindow 00003 00004 #include <list> 00005 00006 #include "hal/VMEConfigurationSpaceHandler.hh" 00007 #include "hal/IllegalOperationException.hh" 00008 #include "hal/IllegalValueException.hh" 00009 #include "hal/UnsupportedException.hh" 00010 #include "hal/BusAdapterException.hh" 00011 #include "hal/NoSuchItemException.hh" 00012 #include "hal/AMSortFunctor.hh" 00013 00014 namespace HAL { 00015 00043 class VME64xMappedWindow { 00044 00045 public: 00046 VME64xMappedWindow( uint32_t slotId, 00047 uint32_t functionId, 00048 uint32_t mappedWindowId, 00049 VMEConfigurationSpaceHandler* vmeConfigurationSpaceHandler ) 00050 throw( NoSuchItemException, 00051 IllegalOperationException, 00052 BusAdapterException, 00053 UnsupportedException, 00054 IllegalValueException ); 00055 00064 VME64xMappedWindow( uint32_t slotId_, 00065 uint32_t baseAddress, 00066 uint32_t addressRank ); 00067 00068 virtual ~VME64xMappedWindow(); 00069 00070 uint32_t getDataAccessWidth() const; 00071 uint32_t getAddressRank() const; 00072 uint32_t getAM() const; 00073 uint32_t getMappedWindowId() const; 00074 uint32_t getFunctionId() const; 00075 uint32_t getSlotId() const; 00076 uint32_t getBaseaddress() const; 00077 const std::list< uint32_t >& getSortedAMCAPList() const; 00078 00079 bool isConfigured() const; 00080 bool isImplemented() const; 00081 bool hasAnotherWindow() const; 00082 bool canA32() const; 00083 bool canA24() const; 00084 bool canA16() const; 00085 00093 void setADER( uint32_t baseAddress, 00094 uint32_t AM ) 00095 throw( NoSuchItemException, 00096 IllegalOperationException, 00097 BusAdapterException ); 00098 00099 private: 00104 void configFromHardware() 00105 throw( NoSuchItemException, 00106 IllegalOperationException, 00107 UnsupportedException, 00108 BusAdapterException ); 00109 00110 void setAddressCapability( uint32_t AM ); 00111 uint32_t slotId_; // needed to access the configuration space 00112 uint32_t functionId_; 00113 uint32_t mappedWindowId_; // between 0..7 00114 VMEConfigurationSpaceHandler* vmeConfigurationSpaceHandlerRef_; 00115 00116 std::list<uint32_t> AMCAP_; 00117 uint32_t AM_; 00118 uint32_t baseaddress_; 00119 00120 uint32_t ADEM_; 00121 uint32_t addressRank_; 00122 00123 uint32_t DAWPR_; 00124 uint32_t dataAccessWidth_; 00125 00126 uint32_t ADER_; 00127 00128 bool implemented_; 00129 bool configured_; 00130 00131 bool canA16_; 00132 bool canA24_; 00133 bool canA32_; 00134 }; 00135 00136 } /* namespace HAL */ 00137 00138 #endif /* __VME64xMappedWindow */