Generic hardware access library
|
00001 #include "hal/GeneralHardwareAddress.hh" 00002 00003 HAL::GeneralHardwareAddress::GeneralHardwareAddress( uint32_t address, 00004 uint32_t dataWidth ) 00005 : address_(address), 00006 dataWidth_(dataWidth) { 00007 } 00008 00009 HAL::GeneralHardwareAddress::~GeneralHardwareAddress() { 00010 } 00011 00012 uint32_t HAL::GeneralHardwareAddress::getAddress() const { 00013 return address_; 00014 } 00015 00016 uint32_t HAL::GeneralHardwareAddress::getComputedAddress( const std::vector<uint32_t>& baseaddresses ) const { 00017 return (address_ + baseaddresses[mapId_] ); 00018 } 00019 00020 uint32_t HAL::GeneralHardwareAddress::getDataWidth() const { 00021 return dataWidth_; 00022 } 00023 00024 enum HAL::AddressSpace HAL::GeneralHardwareAddress::getAddressSpace() const { 00025 return addressSpace_; 00026 } 00027 00028 uint32_t HAL::GeneralHardwareAddress::getMapId() const { 00029 return mapId_; 00030 } 00031 00032 bool HAL::GeneralHardwareAddress::isConfigSpace() const { 00033 return ( addressSpace_ == (HAL::AddressSpace)CONFIGURATION ); 00034 } 00035 00036 bool HAL::GeneralHardwareAddress::isMemorySpace() const { 00037 return ( addressSpace_ == (HAL::AddressSpace)MEMORY ) ; 00038 }