Generic hardware access library
|
00001 #include "hal/WriteCommand.hh" 00002 00003 00004 HAL::WriteCommand::WriteCommand( std::string item, 00005 HAL::CommandSequence& sequence ) 00006 : sequence(sequence), 00007 item( item ) { 00008 dataPtr = &constantData; 00009 offsetPtr = &offset; 00010 constantData = 0; 00011 offset = 0; 00012 verifyFlag = HAL_NO_VERIFY; 00013 } 00014 00015 void HAL::WriteCommand::setVerify() { 00016 verifyFlag = HAL_DO_VERIFY; 00017 } 00018 00019 void HAL::WriteCommand::excecute( const HAL::HardwareDeviceInterface& device ) const 00020 throw ( HAL::BusAdapterException, 00021 HAL::MaskBoundaryException ) { 00022 device.write( item, *dataPtr, verifyFlag, *offsetPtr ); 00023 } 00024 00025 void HAL::WriteCommand::setOffset( uint32_t offset ) { 00026 this->offset = offset; 00027 } 00028 00029 void HAL::WriteCommand::setData( uint32_t data ) { 00030 this->constantData = data; 00031 } 00032 00033 void HAL::WriteCommand::setOffsetPointer( uint32_t* offsetPtr ) { 00034 this->offsetPtr = offsetPtr; 00035 } 00036 00037 void HAL::WriteCommand::setDataPointer( uint32_t* dataPtr ) { 00038 this->dataPtr = dataPtr; 00039 }