Skip to content

Commit

Permalink
Implement Peripheral
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Oct 18, 2024
1 parent 888b955 commit 399cf60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions esp-hal/src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,16 +501,17 @@ where
) -> Self {
crate::into_ref!(i2c, sda, scl);

PeripheralClockControl::reset(i2c.peripheral());
PeripheralClockControl::enable(i2c.peripheral());

let i2c = I2c {
i2c,
phantom: PhantomData,
frequency,
timeout,
};

PeripheralClockControl::reset(i2c.i2c.peripheral());
PeripheralClockControl::enable(i2c.i2c.peripheral());

// TODO: implement with_pins et. al.
// avoid SCL/SDA going low during configuration
scl.set_output_high(true, crate::private::Internal);
sda.set_output_high(true, crate::private::Internal);
Expand Down

0 comments on commit 399cf60

Please sign in to comment.