Struct esp32c2_hal::i2c::I2C
source · pub struct I2C<T> { /* private fields */ }
Expand description
I2C peripheral container (I2C)
Implementations
sourceimpl<T> I2C<T>where
T: Instance,
impl<T> I2C<T>where
T: Instance,
sourcepub fn new<SDA, SCL>(
i2c: T,
sda: SDA,
scl: SCL,
frequency: Rate<u32, 1, 1>,
peripheral_clock_control: &mut PeripheralClockControl,
clocks: &Clocks
) -> Result<I2C<T>, SetupError>where
SDA: OutputPin + InputPin,
SCL: OutputPin + InputPin,
pub fn new<SDA, SCL>(
i2c: T,
sda: SDA,
scl: SCL,
frequency: Rate<u32, 1, 1>,
peripheral_clock_control: &mut PeripheralClockControl,
clocks: &Clocks
) -> Result<I2C<T>, SetupError>where
SDA: OutputPin + InputPin,
SCL: OutputPin + InputPin,
Create a new I2C instance This will enable the peripheral but the peripheral won’t get automatically disabled when this gets dropped.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for I2C<T>where
T: RefUnwindSafe,
impl<T> Send for I2C<T>where
T: Send,
impl<T> Sync for I2C<T>where
T: Sync,
impl<T> Unpin for I2C<T>where
T: Unpin,
impl<T> UnwindSafe for I2C<T>where
T: 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