Generic hardware access library
|
00001 #ifndef __VME64xDevice_hh_ 00002 #define __VME64xDevice_hh_ 00003 00004 #include <string> 00005 00006 #include "hal/VMEDevice.hh" 00007 #include "hal/VMESlot.hh" 00008 00009 namespace HAL { 00010 00011 class VME64xDevice : public VMEDevice 00012 { 00013 public : 00014 00023 VME64xDevice( HAL::VMEAddressTable & vmeAddressTable, 00024 HAL::VMEBusAdapterInterface & vmeBusAdapter, 00025 std::vector<uint32_t>& baseaddresses, 00026 bool doSwapping, 00027 const HAL::VMESlot &vmeSLot ) 00028 00029 throw( HAL::NoSuchItemException, 00030 HAL::IllegalOperationException, 00031 HAL::BusAdapterException, 00032 HAL::IllegalValueException, 00033 HAL::UnsupportedException ); 00034 00051 void hardwareRead( const HAL::GeneralHardwareAddress& vmeAddress, 00052 uint32_t* result, 00053 uint32_t offset ) const 00054 throw( HAL::BusAdapterException ); 00055 00059 void hardwareWrite( const HAL::GeneralHardwareAddress& vmeAddress, 00060 uint32_t data, 00061 uint32_t offset ) const 00062 throw( HAL::BusAdapterException ); 00063 00094 void stdConfigRead( std::string item, 00095 uint32_t* resultPtr, 00096 uint32_t offset = 0 ) const 00097 throw( HAL::NoSuchItemException, 00098 HAL::IllegalOperationException, 00099 HAL::BusAdapterException ); 00100 00101 void stdConfigWrite( std::string item, 00102 uint32_t data, 00103 HalVerifyOption verifyFlag, 00104 uint32_t offset = 0 ) const 00105 throw( HAL::NoSuchItemException, 00106 HAL::IllegalOperationException, 00107 HAL::BusAdapterException ); 00108 00117 std::string getSerialNumber() const; 00118 00119 protected : 00120 00124 void userConfigRead( const HAL::GeneralHardwareAddress& vmeAddress, 00125 uint32_t *resultPtr, 00126 uint32_t offset ) const 00127 throw( HAL::IllegalOperationException, 00128 HAL::BusAdapterException ); 00129 00133 void userConfigWrite(const HAL::GeneralHardwareAddress& vmeAddress, 00134 uint32_t data, 00135 uint32_t offset) const 00136 throw( HAL::IllegalOperationException, 00137 HAL::BusAdapterException ); 00138 00139 const HAL::VMESlot &vmeSlot_; 00140 uint32_t configSpaceOffset_; 00141 uint32_t CRAMAccessWidth_; 00142 uint32_t CROMAccessWidth_; 00143 uint32_t CSRAccessWidth_; 00144 00145 uint32_t userCRStart_; 00146 uint32_t userCREnd_; 00147 uint32_t userCSRStart_; 00148 uint32_t userCSREnd_; 00149 uint32_t CRAMStart_; 00150 uint32_t CRAMEnd_; 00151 00152 private: 00153 uint32_t getAccessWidth( std::string item ) const 00154 throw( HAL::NoSuchItemException, 00155 HAL::IllegalOperationException, 00156 HAL::BusAdapterException ); 00157 00158 uint32_t getAccessInterval(uint32_t address, uint32_t width ) const 00159 throw( HAL::IllegalOperationException ); 00160 }; 00161 00162 } /* namespace HAL */ 00163 00164 #endif /* __VME64xDevice_hh_ */ 00165