Struct capsules_extra::tickv::TickFSFlashCtrl
source · pub struct TickFSFlashCtrl<'a, F: Flash + 'static> { /* private fields */ }
Expand description
Wrapper object that provides the flash interface TicKV expects using the Tock flash HIL.
Note, TicKV expects a synchronous flash implementation, but the Tock flash
HIL is asynchronous. To mediate this, this wrapper starts a flash
read/write/erase, but returns without the requested operation having
completed. To signal TicKV that this is what happened, this implementation
returns NotReady
errors. When the underlying flash operation has completed
the TicKVSystem
object will get the callback and then notify TicKV that
the requested operation is now ready.
Implementations§
source§impl<'a, F: Flash> TickFSFlashCtrl<'a, F>
impl<'a, F: Flash> TickFSFlashCtrl<'a, F>
Trait Implementations§
source§impl<'a, F: Flash, const PAGE_SIZE: usize> FlashController<PAGE_SIZE> for TickFSFlashCtrl<'a, F>
impl<'a, F: Flash, const PAGE_SIZE: usize> FlashController<PAGE_SIZE> for TickFSFlashCtrl<'a, F>
source§fn read_region(
&self,
region_number: usize,
_buf: &mut [u8; PAGE_SIZE],
) -> Result<(), ErrorCode>
fn read_region( &self, region_number: usize, _buf: &mut [u8; PAGE_SIZE], ) -> Result<(), ErrorCode>
This function must read the data from the flash region specified by
region_number
into buf
. The length of the data read should be the
same length as buf. Read moresource§fn write(&self, address: usize, buf: &[u8]) -> Result<(), ErrorCode>
fn write(&self, address: usize, buf: &[u8]) -> Result<(), ErrorCode>
This function must write the length of
buf
to the specified address
in flash.
If the length of buf
is smaller then the minimum supported write size
the implementation can write a larger value. This should be done by first
reading the value, making the changed from buf
and then writing it back. Read moreAuto Trait Implementations§
impl<'a, F> !Freeze for TickFSFlashCtrl<'a, F>
impl<'a, F> !RefUnwindSafe for TickFSFlashCtrl<'a, F>
impl<'a, F> Send for TickFSFlashCtrl<'a, F>
impl<'a, F> !Sync for TickFSFlashCtrl<'a, F>
impl<'a, F> Unpin for TickFSFlashCtrl<'a, F>
impl<'a, F> !UnwindSafe for TickFSFlashCtrl<'a, F>
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