Struct stm32f4xx_hal::i2c::I2c
source · [−]pub struct I2c<I2C: Instance, PINS> { /* private fields */ }
Expand description
I2C abstraction
Implementations
sourceimpl<I2C: Instance, PINS> I2c<I2C, PINS>
impl<I2C: Instance, PINS> I2c<I2C, PINS>
pub fn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Error>
pub fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error>
pub fn write_iter<B>(&mut self, addr: u8, bytes: B) -> Result<(), Error> where
B: IntoIterator<Item = u8>,
pub fn write_read(
&mut self,
addr: u8,
bytes: &[u8],
buffer: &mut [u8]
) -> Result<(), Error>
pub fn write_iter_read<B>(
&mut self,
addr: u8,
bytes: B,
buffer: &mut [u8]
) -> Result<(), Error> where
B: IntoIterator<Item = u8>,
Trait Implementations
sourceimpl<I2C: Instance, PINS> I2c<u8> for I2c<I2C, PINS>
impl<I2C: Instance, PINS> I2c<u8> for I2c<I2C, PINS>
sourcefn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Self::Error>
fn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Self::Error>
Reads enough bytes from slave with address
to fill buffer
Read more
sourcefn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Self::Error>
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Self::Error>
Writes bytes to slave with address address
Read more
sourcefn write_iter<B>(&mut self, addr: u8, bytes: B) -> Result<(), Self::Error> where
B: IntoIterator<Item = u8>,
fn write_iter<B>(&mut self, addr: u8, bytes: B) -> Result<(), Self::Error> where
B: IntoIterator<Item = u8>,
Writes bytes to slave with address address
Read more
sourcefn write_read(
&mut self,
addr: u8,
bytes: &[u8],
buffer: &mut [u8]
) -> Result<(), Self::Error>
fn write_read(
&mut self,
addr: u8,
bytes: &[u8],
buffer: &mut [u8]
) -> Result<(), Self::Error>
Writes bytes to slave with address address
and then reads enough bytes to fill buffer
in a
single transaction Read more
sourcefn write_iter_read<B>(
&mut self,
addr: u8,
bytes: B,
buffer: &mut [u8]
) -> Result<(), Self::Error> where
B: IntoIterator<Item = u8>,
fn write_iter_read<B>(
&mut self,
addr: u8,
bytes: B,
buffer: &mut [u8]
) -> Result<(), Self::Error> where
B: IntoIterator<Item = u8>,
Writes bytes to slave with address address
and then reads enough bytes to fill buffer
in a
single transaction Read more
sourcefn transaction<'a>(
&mut self,
_addr: u8,
_operations: &mut [Operation<'a>]
) -> Result<(), Self::Error>
fn transaction<'a>(
&mut self,
_addr: u8,
_operations: &mut [Operation<'a>]
) -> Result<(), Self::Error>
Execute the provided operations on the I2C bus. Read more
sourcefn transaction_iter<'a, O>(
&mut self,
_addr: u8,
_operations: O
) -> Result<(), Self::Error> where
O: IntoIterator<Item = Operation<'a>>,
fn transaction_iter<'a, O>(
&mut self,
_addr: u8,
_operations: O
) -> Result<(), Self::Error> where
O: IntoIterator<Item = Operation<'a>>,
Execute the provided operations on the I2C bus (iterator version). Read more
sourceimpl<I2C, PINS> WriteIterRead<u8> for I2c<I2C, PINS> where
I2C: Instance,
impl<I2C, PINS> WriteIterRead<u8> for I2c<I2C, PINS> where
I2C: Instance,
Auto Trait Implementations
impl<I2C, PINS> RefUnwindSafe for I2c<I2C, PINS> where
I2C: RefUnwindSafe,
PINS: RefUnwindSafe,
impl<I2C, PINS> Send for I2c<I2C, PINS> where
I2C: Send,
PINS: Send,
impl<I2C, PINS> Sync for I2c<I2C, PINS> where
I2C: Sync,
PINS: Sync,
impl<I2C, PINS> Unpin for I2c<I2C, PINS> where
I2C: Unpin,
PINS: Unpin,
impl<I2C, PINS> UnwindSafe for I2c<I2C, PINS> where
I2C: UnwindSafe,
PINS: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more