pub struct SectorMockFlash<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> { /* private fields */ }Expand description
Sector-based mock flash device
Simulates NOR flash where writes can only set bits from 1 to 0, and entire sectors must be erased to set bits back to 1. This more accurately models real NOR flash behavior.
Implementations§
Trait Implementations§
Source§impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Debug for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Debug for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
Source§impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Default for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Default for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
Source§impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Flash for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Flash for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
Source§type Error = Infallible
type Error = Infallible
The error type for flash operations
Source§fn read(&mut self, addr: u32, buf: &mut [u8]) -> Result<(), Self::Error>
fn read(&mut self, addr: u32, buf: &mut [u8]) -> Result<(), Self::Error>
Read data from flash memory at the specified byte address Read more
Source§fn write(&mut self, addr: u32, buf: &mut [u8]) -> Result<(), Self::Error>
fn write(&mut self, addr: u32, buf: &mut [u8]) -> Result<(), Self::Error>
Write data to flash memory at the specified address Read more
Source§impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> PartialEq for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> PartialEq for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
Source§fn eq(&self, other: &SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>) -> bool
fn eq(&self, other: &SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> StructuralPartialEq for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
Auto Trait Implementations§
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Freeze for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> RefUnwindSafe for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Send for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Sync for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> Unpin for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
impl<const SECTOR_SIZE: usize, const SECTOR_COUNT: usize> UnwindSafe for SectorMockFlash<SECTOR_SIZE, SECTOR_COUNT>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more