Struct eeprom24x::Storage

source ·
pub struct Storage<I2C, PS, AS, SN, D> {
    pub eeprom: Eeprom24x<I2C, PS, AS, SN>,
    /* private fields */
}
Expand description

EEPROM24X extension which supports the embedded-storage traits but requires an embedded_hal::delay::DelayNs to handle the timeouts when writing over page boundaries

Fields§

§eeprom: Eeprom24x<I2C, PS, AS, SN>

Eeprom driver over which we implement the Storage traits

Implementations§

source§

impl<I2C, PS, AS, SN, D> Storage<I2C, PS, AS, SN, D>

This impl block contains no items.

Common methods

source§

impl<I2C, PS, AS, SN, D> Storage<I2C, PS, AS, SN, D>
where D: DelayNs,

Common methods

source

pub fn new(eeprom: Eeprom24x<I2C, PS, AS, SN>, delay: D) -> Self

Create a new Storage instance wrapping the given Eeprom

source§

impl<I2C, PS, AS, SN, D> Storage<I2C, PS, AS, SN, D>

Common methods

source

pub fn destroy(self) -> (I2C, D)

Destroy driver instance, return I²C bus and timer instance.

Trait Implementations§

source§

impl<I2C: Debug, PS: Debug, AS: Debug, SN: Debug, D: Debug> Debug for Storage<I2C, PS, AS, SN, D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<I2C, E, PS, AS, SN, D> ReadStorage for Storage<I2C, PS, AS, SN, D>
where I2C: I2c<Error = E>, AS: MultiSizeAddr, D: DelayNs,

§

type Error = Error<E>

An enumeration of storage errors
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. Read more
source§

fn capacity(&self) -> usize

The capacity of the storage peripheral in bytes.
source§

impl<I2C, E, PS, AS, SN, D> Storage for Storage<I2C, PS, AS, SN, D>
where I2C: I2c<Error = E>, AS: MultiSizeAddr, Eeprom24x<I2C, PS, AS, SN>: PageWrite<E>, D: DelayNs,

source§

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

Write a slice of data to the storage peripheral, starting the write operation at the given address offset (between 0 and self.capacity()). Read more

Auto Trait Implementations§

§

impl<I2C, PS, AS, SN, D> Freeze for Storage<I2C, PS, AS, SN, D>
where D: Freeze, I2C: Freeze,

§

impl<I2C, PS, AS, SN, D> RefUnwindSafe for Storage<I2C, PS, AS, SN, D>

§

impl<I2C, PS, AS, SN, D> Send for Storage<I2C, PS, AS, SN, D>
where D: Send, I2C: Send, PS: Send, AS: Send, SN: Send,

§

impl<I2C, PS, AS, SN, D> Sync for Storage<I2C, PS, AS, SN, D>
where D: Sync, I2C: Sync, PS: Sync, AS: Sync, SN: Sync,

§

impl<I2C, PS, AS, SN, D> Unpin for Storage<I2C, PS, AS, SN, D>
where D: Unpin, I2C: Unpin, PS: Unpin, AS: Unpin, SN: Unpin,

§

impl<I2C, PS, AS, SN, D> UnwindSafe for Storage<I2C, PS, AS, SN, D>
where D: UnwindSafe, I2C: UnwindSafe, PS: UnwindSafe, AS: UnwindSafe, SN: UnwindSafe,

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.