pub struct I2c<'d, T: Instance, M: Mode> { /* private fields */ }Expand description
I2C Controller Driver.
Implementations§
Source§impl<'d, T: Instance, M: Mode> I2c<'d, T, M>
impl<'d, T: Instance, M: Mode> I2c<'d, T, M>
Source§impl<'d, T: Instance> I2c<'d, T, Async>
impl<'d, T: Instance> I2c<'d, T, Async>
Sourcepub fn new_async(
peri: Peri<'d, T>,
scl: Peri<'d, impl SclPin<T>>,
sda: Peri<'d, impl SdaPin<T>>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
config: Config,
) -> Result<Self>
pub fn new_async( peri: Peri<'d, T>, scl: Peri<'d, impl SclPin<T>>, sda: Peri<'d, impl SdaPin<T>>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, config: Config, ) -> Result<Self>
Create a new async instance of the I2C Controller bus driver.
Sourcepub fn async_read<'a>(
&mut self,
address: u8,
read: &'a mut [u8],
) -> impl Future<Output = Result<()>> + use<'_, 'a, 'd, T>
pub fn async_read<'a>( &mut self, address: u8, read: &'a mut [u8], ) -> impl Future<Output = Result<()>> + use<'_, 'a, 'd, T>
Read from address into buffer asynchronously.
Trait Implementations§
Source§impl<'d, T: Instance> I2c for I2c<'d, T, Async>
impl<'d, T: Instance> I2c for I2c<'d, T, Async>
Source§async fn transaction(
&mut self,
address: u8,
operations: &mut [Operation<'_>],
) -> Result<()>
async fn transaction( &mut self, address: u8, operations: &mut [Operation<'_>], ) -> Result<()>
Execute the provided operations on the I2C bus as a single transaction. Read more
Source§impl<'d, T: Instance, M: Mode> I2c for I2c<'d, T, M>
impl<'d, T: Instance, M: Mode> I2c for I2c<'d, T, M>
Source§fn transaction(
&mut self,
address: u8,
operations: &mut [Operation<'_>],
) -> Result<()>
fn transaction( &mut self, address: u8, operations: &mut [Operation<'_>], ) -> Result<()>
Execute the provided operations on the I2C bus. Read more
Auto Trait Implementations§
impl<'d, T, M> Freeze for I2c<'d, T, M>where
T: Freeze,
impl<'d, T, M> !RefUnwindSafe for I2c<'d, T, M>
impl<'d, T, M> !Send for I2c<'d, T, M>
impl<'d, T, M> !Sync for I2c<'d, T, M>
impl<'d, T, M> Unpin for I2c<'d, T, M>
impl<'d, T, M> !UnwindSafe for I2c<'d, T, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more