Struct esp32c2_hal::i2c::I2C
source · pub struct I2C<T> { /* private fields */ }
Expand description
I2C peripheral container (I2C)
Implementations§
source§impl<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
) -> I2C<T>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
) -> I2C<T>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.