Trait embedded_storage::nor_flash::ReadNorFlash

source ·
pub trait ReadNorFlash: ErrorType {
    const READ_SIZE: usize;

    // Required methods
    fn read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error>;
    fn capacity(&self) -> usize;
}
Expand description

Read only NOR flash trait.

Required Associated Constants§

source

const READ_SIZE: usize

The minumum number of bytes the storage peripheral can read

Required Methods§

source

fn read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error>

Read a slice of data from the storage peripheral, starting the read operation at the given address offset, and reading bytes.len() bytes.

§Errors

Returns an error if the arguments are not aligned or out of bounds. The implementation can use the check_read helper function.

source

fn capacity(&self) -> usize

The capacity of the peripheral in bytes.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: ReadNorFlash> ReadNorFlash for &mut T

source§

const READ_SIZE: usize = T::READ_SIZE

source§

fn read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error>

source§

fn capacity(&self) -> usize

Implementors§