pub struct DeviceMemory<'memory, RB: Integral> { /* private fields */ }
Expand description
Object containing all memory regions (we have available) of the device
Implementations§
Source§impl<'memory, RB: Integral> DeviceMemory<'memory, RB>
impl<'memory, RB: Integral> DeviceMemory<'memory, RB>
Sourcepub fn add_memory_region<M: MemoryRegion + 'memory>(&mut self, region: M)
pub fn add_memory_region<M: MemoryRegion + 'memory>(&mut self, region: M)
Adds a memory region to the device memory
Sourcepub fn add_register_data<RD: RegisterData<RB> + 'memory>(&mut self, data: RD)
pub fn add_register_data<RD: RegisterData<RB> + 'memory>(&mut self, data: RD)
Adds register data to the device memory
Sourcepub fn read_slice(
&self,
address_range: Range<u64>,
) -> Result<Option<Vec<u8>>, MemoryReadError>
pub fn read_slice( &self, address_range: Range<u64>, ) -> Result<Option<Vec<u8>>, MemoryReadError>
Returns the slice of memory that can be found at the given address_range. If the given address range is not fully within one of the captured regions present in the device memory, then None is returned.
Sourcepub fn read_u8(&self, address: u64) -> Result<Option<u8>, MemoryReadError>
pub fn read_u8(&self, address: u64) -> Result<Option<u8>, MemoryReadError>
Reads a byte from the given address if it is present in one of the captured regions present in the device memory
Sourcepub fn read_u32(
&self,
address: u64,
endianness: RunTimeEndian,
) -> Result<Option<u32>, MemoryReadError>
pub fn read_u32( &self, address: u64, endianness: RunTimeEndian, ) -> Result<Option<u32>, MemoryReadError>
Reads a u32 from the given address if it is present in one of the captured regions present in the device memory
Sourcepub fn register(&self, register: Register) -> Result<RB, MissingRegisterError>
pub fn register(&self, register: Register) -> Result<RB, MissingRegisterError>
Try to get the value of the given register. Returns an error if the register is not present in any of the register collections.
Sourcepub fn register_ref(
&self,
register: Register,
) -> Result<&RB, MissingRegisterError>
pub fn register_ref( &self, register: Register, ) -> Result<&RB, MissingRegisterError>
Try to get a reference to the given register. Returns an error if the register is not present in any of the register collections.
Sourcepub fn register_mut(
&mut self,
register: Register,
) -> Result<&mut RB, MissingRegisterError>
pub fn register_mut( &mut self, register: Register, ) -> Result<&mut RB, MissingRegisterError>
Try to get a mutable reference to the given register. Returns an error if the register is not present in any of the register collections.