Trait avr_oxide::hal::generic::eeprom::EepromSpace

source ·
pub trait EepromSpace<'e> {
    type W: Write;
    type R: Read;

    const SIZE: usize;

    // Required methods
    fn read_at_into(&self, offset: usize, dest: &mut [u8]) -> usize;
    fn write_at_from(&mut self, offset: usize, src: &[u8]) -> usize;
    fn writer(&'e mut self) -> Self::W;
    fn writer_at(&'e mut self, offset: usize) -> Self::W;
    fn reader(&'e self) -> Self::R;
    fn reader_at(&'e self, offset: usize) -> Self::R;
}

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn read_at_into(&self, offset: usize, dest: &mut [u8]) -> usize

Read from the EEPROM space, from the given offset, into the buffer provided. The entire buffer will be filled (up to a maximum of Self::SIZE bytes.)

§Returns

Number of bytes read

source

fn write_at_from(&mut self, offset: usize, src: &[u8]) -> usize

Write into the EEPROM space from the given buffer. The entire buffer will be written starting at the given offset address.

§Returns

Number of bytes written

§Panics

Panics if the given (buffer+offset) is outside the EEPROM area.

source

fn writer(&'e mut self) -> Self::W

Return a Writer that will write to the EEPROM space

source

fn writer_at(&'e mut self, offset: usize) -> Self::W

Return a Writer that will write to the EEPROM space starting at the given byte

source

fn reader(&'e self) -> Self::R

Return a Reader that will read from the EEPROM space

source

fn reader_at(&'e self, offset: usize) -> Self::R

Return a Reader that will read from the EEPROM space starting at the given byte

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'e, const SIZE: usize> EepromSpace<'e> for DummyEepromImpl<SIZE>

source§

const SIZE: usize = SIZE

§

type W = Stderr

§

type R = Stdin