pub struct Eeprom<'d, M: Mode> { /* private fields */ }Expand description
Driver for the data EEPROM.
The EEPROM is written without erasing it first, at any offset and with any length. The hardware erases and programs it in 32-bit words, which takes a few milliseconds per word: a write rewrites every word it touches, except the ones that already have the value written. While a word is programmed, the CPU stalls when it reads from the flash bank being written.
Erased EEPROM reads as 0x00.
Implementations§
Source§impl<'d, M: Mode> Eeprom<'d, M>
impl<'d, M: Mode> Eeprom<'d, M>
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Size of the EEPROM in bytes, EEPROM_SIZE.
Sourcepub fn blocking_read(
&mut self,
offset: u32,
bytes: &mut [u8],
) -> Result<(), Error>
pub fn blocking_read( &mut self, offset: u32, bytes: &mut [u8], ) -> Result<(), Error>
Blocking read.
NOTE: offset is an offset from the start of the EEPROM, EEPROM_BASE.
Source§impl<'d> Eeprom<'d, Blocking>
impl<'d> Eeprom<'d, Blocking>
Sourcepub fn blocking_write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Error>
pub fn blocking_write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Error>
Blocking write.
NOTE: offset is an offset from the start of the EEPROM, EEPROM_BASE.
Trait Implementations§
Auto Trait Implementations§
impl<'d, M> !UnwindSafe for Eeprom<'d, M>
impl<'d, M> Freeze for Eeprom<'d, M>where
PhantomData<M>: Freeze,
impl<'d, M> RefUnwindSafe for Eeprom<'d, M>where
PhantomData<M>: RefUnwindSafe,
impl<'d, M> Send for Eeprom<'d, M>where
PhantomData<M>: Send,
impl<'d, M> Sync for Eeprom<'d, M>where
PhantomData<M>: Sync,
impl<'d, M> Unpin for Eeprom<'d, M>where
PhantomData<M>: Unpin,
impl<'d, M> UnsafeUnpin for Eeprom<'d, M>where
PhantomData<M>: UnsafeUnpin,
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