pub struct I2c<'d, M: Mode> { /* private fields */ }Expand description
I2C Controller Driver.
Implementations§
Source§impl<'d, M: Mode> I2c<'d, M>
impl<'d, M: Mode> I2c<'d, M>
Source§impl<'d, M: AsyncMode> I2c<'d, M>where
Self: AsyncEngine,
impl<'d, M: AsyncMode> I2c<'d, M>where
Self: AsyncEngine,
Source§impl<'d> I2c<'d, Async>
impl<'d> I2c<'d, Async>
Sourcepub fn new_async<T: Instance>(
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, SetupError>
pub fn new_async<T: Instance>( 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, SetupError>
Create a new async instance of the I2C Controller bus driver.
Any external pin will be placed into Disabled state upon Drop.
Source§impl<'d> I2c<'d, Dma<'d>>
impl<'d> I2c<'d, Dma<'d>>
Sourcepub fn new_async_with_dma<T: Instance>(
peri: Peri<'d, T>,
scl: Peri<'d, impl SclPin<T>>,
sda: Peri<'d, impl SdaPin<T>>,
tx_dma: Peri<'d, impl TxDma<T>>,
rx_dma: Peri<'d, impl RxDma<T>>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
config: Config,
) -> Result<Self, SetupError>
pub fn new_async_with_dma<T: Instance>( peri: Peri<'d, T>, scl: Peri<'d, impl SclPin<T>>, sda: Peri<'d, impl SdaPin<T>>, tx_dma: Peri<'d, impl TxDma<T>>, rx_dma: Peri<'d, impl RxDma<T>>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, config: Config, ) -> Result<Self, SetupError>
Create a new async instance of the I2C Controller bus driver with DMA support.
Any external pin will be placed into Disabled state upon Drop, additionally, the DMA channel is disabled.
Trait Implementations§
Source§impl<'d, M: Mode> I2c for I2c<'d, M>
impl<'d, M: Mode> I2c for I2c<'d, M>
Source§fn transaction(
&mut self,
address: u8,
operations: &mut [Operation<'_>],
) -> Result<(), Self::Error>
fn transaction( &mut self, address: u8, operations: &mut [Operation<'_>], ) -> Result<(), Self::Error>
Execute the provided operations on the I2C bus. Read more
Source§impl<'d, M: AsyncMode> I2c for I2c<'d, M>where
I2c<'d, M>: AsyncEngine,
impl<'d, M: AsyncMode> I2c for I2c<'d, M>where
I2c<'d, M>: AsyncEngine,
Source§async fn transaction(
&mut self,
address: u8,
operations: &mut [Operation<'_>],
) -> Result<(), Self::Error>
async fn transaction( &mut self, address: u8, operations: &mut [Operation<'_>], ) -> Result<(), Self::Error>
Execute the provided operations on the I2C bus as a single transaction. Read more
Source§impl<'d, M: Mode> SetConfig for I2c<'d, M>
impl<'d, M: Mode> SetConfig for I2c<'d, M>
Source§type ConfigError = SetupError
type ConfigError = SetupError
The error type that can occur if
set_config fails.Source§fn set_config(&mut self, config: &Self::Config) -> Result<(), SetupError>
fn set_config(&mut self, config: &Self::Config) -> Result<(), SetupError>
Set the configuration of the driver.
Source§impl<'d, M: Mode> Transactional for I2c<'d, M>
impl<'d, M: Mode> Transactional for I2c<'d, M>
Auto Trait Implementations§
impl<'d, M> Freeze for I2c<'d, M>where
M: Freeze,
impl<'d, M> !RefUnwindSafe for I2c<'d, M>
impl<'d, M> Send for I2c<'d, M>where
M: Send,
impl<'d, M> Sync for I2c<'d, M>where
M: Sync,
impl<'d, M> Unpin for I2c<'d, M>where
M: Unpin,
impl<'d, M> !UnwindSafe for I2c<'d, 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