Struct I2c

Source
pub struct I2c<I2C, SCLPIN, SDAPIN> { /* private fields */ }
Expand description

I2C abstraction

Implementations§

Source§

impl<SCLPIN, SDAPIN> I2c<I2C1, SCLPIN, SDAPIN>

Source

pub fn i2c1( i2c: I2C1, pins: (SCLPIN, SDAPIN), speed: KiloHertz, rcc: &mut Rcc, ) -> Self
where SCLPIN: SclPin<I2C1>, SDAPIN: SdaPin<I2C1>,

Source§

impl<I2C, SCLPIN, SDAPIN> I2c<I2C, SCLPIN, SDAPIN>
where I2C: Deref<Target = RegisterBlock>,

Source

pub fn release(self) -> (I2C, (SCLPIN, SDAPIN))

Trait Implementations§

Source§

impl<I2C, SCLPIN, SDAPIN> Read for I2c<I2C, SCLPIN, SDAPIN>
where I2C: Deref<Target = RegisterBlock>,

Source§

type Error = Error

Error type
Source§

fn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Error>

Reads enough bytes from slave with address to fill buffer Read more
Source§

impl<I2C, SCLPIN, SDAPIN> Write for I2c<I2C, SCLPIN, SDAPIN>
where I2C: Deref<Target = RegisterBlock>,

Source§

type Error = Error

Error type
Source§

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

Writes bytes to slave with address address Read more
Source§

impl<I2C, SCLPIN, SDAPIN> WriteRead for I2c<I2C, SCLPIN, SDAPIN>
where I2C: Deref<Target = RegisterBlock>,

Source§

type Error = Error

Error type
Source§

fn write_read( &mut self, addr: u8, bytes: &[u8], buffer: &mut [u8], ) -> Result<(), Error>

Writes bytes to slave with address address and then reads enough bytes to fill buffer in a single transaction Read more

Auto Trait Implementations§

§

impl<I2C, SCLPIN, SDAPIN> Freeze for I2c<I2C, SCLPIN, SDAPIN>
where I2C: Freeze, SCLPIN: Freeze, SDAPIN: Freeze,

§

impl<I2C, SCLPIN, SDAPIN> RefUnwindSafe for I2c<I2C, SCLPIN, SDAPIN>
where I2C: RefUnwindSafe, SCLPIN: RefUnwindSafe, SDAPIN: RefUnwindSafe,

§

impl<I2C, SCLPIN, SDAPIN> Send for I2c<I2C, SCLPIN, SDAPIN>
where I2C: Send, SCLPIN: Send, SDAPIN: Send,

§

impl<I2C, SCLPIN, SDAPIN> Sync for I2c<I2C, SCLPIN, SDAPIN>
where I2C: Sync, SCLPIN: Sync, SDAPIN: Sync,

§

impl<I2C, SCLPIN, SDAPIN> Unpin for I2c<I2C, SCLPIN, SDAPIN>
where I2C: Unpin, SCLPIN: Unpin, SDAPIN: Unpin,

§

impl<I2C, SCLPIN, SDAPIN> UnwindSafe for I2c<I2C, SCLPIN, SDAPIN>
where I2C: UnwindSafe, SCLPIN: UnwindSafe, SDAPIN: 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>,

Source§

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>,

Source§

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.