Struct grapple_m24c64::M24C64

source ·
pub struct M24C64<I2C> { /* private fields */ }
Expand description

M24C64 Driver

Implementations§

source§

impl<I2C> M24C64<I2C>

source

pub fn new(i2c: I2C, e_addr: u8) -> Self

Create a new instance of the M24C64 Driver

Arguments
  • i2c - I2C Interface (from the embedded-hal crate)
  • e_addr - The address set on the E pins
Example
use grapple_m24c64::M24C64;
 
let eeprom = M24C64::new(i2c, 0);
source§

impl<I2C, E> M24C64<I2C>where I2C: Write<u8, Error = E> + WriteRead<u8, Error = E>,

source

pub fn write( &mut self, address: usize, data: &[u8], delay: &mut dyn DelayMs<u16> ) -> Result<(), E>

Write an arbitrary number of bytes into the EEPROM, starting at address. This function will automatically paginate.

source

pub fn read(&mut self, address: usize, data: &mut [u8]) -> Result<(), E>

Read an arbitrary number of bytes from the EEPROM, starting at address. This function will automatically paginate.

Auto Trait Implementations§

§

impl<I2C> RefUnwindSafe for M24C64<I2C>where I2C: RefUnwindSafe,

§

impl<I2C> Send for M24C64<I2C>where I2C: Send,

§

impl<I2C> Sync for M24C64<I2C>where I2C: Sync,

§

impl<I2C> Unpin for M24C64<I2C>where I2C: Unpin,

§

impl<I2C> UnwindSafe for M24C64<I2C>where I2C: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.