Skip to content

Commit

Permalink
enable clock and reset in I2C_Master Configure
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyGrosser committed Nov 16, 2024
1 parent db44af2 commit 0362882
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/devices/rp2350/rp-i2c_master.adb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-- SPDX-License-Identifier: BSD-3-Clause
--
with RP.Clock;
with RP.Reset;
with System;

package body RP.I2C_Master is
Expand Down Expand Up @@ -213,6 +214,14 @@ package body RP.I2C_Master is
SDA_TX_HOLD : constant Natural :=
((CLK_SYS * 3) / (if Baudrate < 1e6 then 10e6 else 25e6)) + 1;
begin
RP.Clock.Enable (RP.Clock.PERI);
case This.Num is
when 0 =>
RP.Reset.Reset_Peripheral (RP.Reset.Reset_I2C0);
when 1 =>
RP.Reset.Reset_Peripheral (RP.Reset.Reset_I2C1);
end case;

P.ENABLE := (others => False);
P.CON :=
(TX_EMPTY_CTRL => True,
Expand Down

0 comments on commit 0362882

Please sign in to comment.