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>

source

pub fn new( flash: &'a F, flash_read_buffer: &'static mut F::Page, region_offset: usize, ) -> TickFSFlashCtrl<'a, F>

Trait Implementations§

source§

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>

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 more
source§

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 more
source§

fn erase_region(&self, region_number: usize) -> Result<(), ErrorCode>

This function must erase the region specified by region_number. Read more

Auto 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>
where F: Sync, <F as Flash>::Page: Send,

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.