From 0362882a923dd1e332ce0b2fe209eaf40901dff7 Mon Sep 17 00:00:00 2001 From: Jeremy Grosser Date: Sat, 16 Nov 2024 14:01:53 -0800 Subject: [PATCH] enable clock and reset in I2C_Master Configure --- src/devices/rp2350/rp-i2c_master.adb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/devices/rp2350/rp-i2c_master.adb b/src/devices/rp2350/rp-i2c_master.adb index 4d5bebf..409c5e3 100644 --- a/src/devices/rp2350/rp-i2c_master.adb +++ b/src/devices/rp2350/rp-i2c_master.adb @@ -4,6 +4,7 @@ -- SPDX-License-Identifier: BSD-3-Clause -- with RP.Clock; +with RP.Reset; with System; package body RP.I2C_Master is @@ -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,