pub struct I2c<C: AnyConfig> { /* private fields */ }
Expand description
Abstraction over a I2C peripheral, allowing to perform I2C transactions.
Implementations
sourceimpl<C: AnyConfig> I2c<C>
impl<C: AnyConfig> I2c<C>
sourcepub fn data_ptr(&self) -> *mut Word
pub fn data_ptr(&self) -> *mut Word
Obtain a pointer to the DATA
register. Necessary for DMA transfers.
sourcepub fn read_flags(&self) -> Flags
pub fn read_flags(&self) -> Flags
Read the interrupt flags
sourcepub fn clear_flags(&mut self, flags: Flags)
pub fn clear_flags(&mut self, flags: Flags)
Clear interrupt status flags
sourcepub fn enable_interrupts(&mut self, flags: Flags)
pub fn enable_interrupts(&mut self, flags: Flags)
Enable interrupts for the specified flags.
sourcepub fn disable_interrupts(&mut self, flags: Flags)
pub fn disable_interrupts(&mut self, flags: Flags)
Disable interrupts for the specified flags.
sourcepub fn read_status(&self) -> Status
pub fn read_status(&self) -> Status
Read the status flags
sourcepub fn clear_status(&mut self, status: Status)
pub fn clear_status(&mut self, status: Status)
Clear the status flags
sourcepub fn reconfigure<F>(&mut self, update: F)where
F: FnOnce(&mut SpecificConfig<C>),
pub fn reconfigure<F>(&mut self, update: F)where
F: FnOnce(&mut SpecificConfig<C>),
Reconfigure the I2C peripheral.
Calling this method will temporarily disable the SERCOM peripheral, as some registers are enable-protected. This may interrupt any ongoing transactions.
use atsamd_hal::sercom::i2c::I2c;
i2c.reconfigure(|c| c.set_run_in_standby(false));
Trait Implementations
Auto Trait Implementations
impl<C> RefUnwindSafe for I2c<C>where
C: RefUnwindSafe,
impl<C> Send for I2c<C>where
C: Send,
impl<C> Sync for I2c<C>where
C: Sync,
impl<C> Unpin for I2c<C>where
C: Unpin,
impl<C> UnwindSafe for I2c<C>where
C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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