diff options
| author | HybridChild <[email protected]> | 2025-08-07 10:34:29 +0200 |
|---|---|---|
| committer | HybridChild <[email protected]> | 2025-08-23 08:52:01 +0200 |
| commit | c531af42c8dd2eaeb56ef1891396ac559918560e (patch) | |
| tree | 767a41bde0b6b0a117d7fba5932b481bef45ca82 /embassy-stm32/src/i2c/mod.rs | |
| parent | 392548997ab65e5654a32848d93a05d5fb695a79 (diff) | |
Revert "stm32/i2c: Add temporary trait for version-specific initialization during v1 rework"
This reverts commit d38e1de962b92d1d48f1991ce09e494ea46d3f7f.
Diffstat (limited to 'embassy-stm32/src/i2c/mod.rs')
| -rw-r--r-- | embassy-stm32/src/i2c/mod.rs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index 660b8144a..675a392f9 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -29,21 +29,6 @@ use crate::rcc::{RccInfo, SealedRccPeripheral}; | |||
| 29 | use crate::time::Hertz; | 29 | use crate::time::Hertz; |
| 30 | use crate::{interrupt, peripherals}; | 30 | use crate::{interrupt, peripherals}; |
| 31 | 31 | ||
| 32 | /// Temporary trait for version-specific initialization during I2C v1 async rework. | ||
| 33 | /// | ||
| 34 | /// This trait allows the shared constructor in mod.rs to call version-specific | ||
| 35 | /// initialization while we incrementally migrate v1 async operations to use | ||
| 36 | /// the new event-driven interrupt pattern. Will be removed once the rework | ||
| 37 | /// is complete and both blocking/async modes use unified initialization. | ||
| 38 | pub trait VersionSpecificInit { | ||
| 39 | /// Performs version and mode-specific initialization. | ||
| 40 | /// | ||
| 41 | /// For v1: Sets interrupt pattern flag based on blocking vs async mode. | ||
| 42 | /// For v2: No-op, does nothing. | ||
| 43 | fn version_specific_init(&mut self); | ||
| 44 | } | ||
| 45 | |||
| 46 | |||
| 47 | /// I2C error. | 32 | /// I2C error. |
| 48 | #[derive(Debug, PartialEq, Eq, Copy, Clone)] | 33 | #[derive(Debug, PartialEq, Eq, Copy, Clone)] |
| 49 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 34 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| @@ -207,10 +192,7 @@ impl<'d> I2c<'d, Blocking, Master> { | |||
| 207 | } | 192 | } |
| 208 | } | 193 | } |
| 209 | 194 | ||
| 210 | impl<'d, M: Mode> I2c<'d, M, Master> | 195 | impl<'d, M: Mode> I2c<'d, M, Master> { |
| 211 | where | ||
| 212 | Self: VersionSpecificInit | ||
| 213 | { | ||
| 214 | /// Create a new I2C driver. | 196 | /// Create a new I2C driver. |
| 215 | fn new_inner<T: Instance>( | 197 | fn new_inner<T: Instance>( |
| 216 | _peri: Peri<'d, T>, | 198 | _peri: Peri<'d, T>, |
| @@ -241,7 +223,6 @@ where | |||
| 241 | }; | 223 | }; |
| 242 | 224 | ||
| 243 | this.enable_and_init(config); | 225 | this.enable_and_init(config); |
| 244 | this.version_specific_init(); | ||
| 245 | 226 | ||
| 246 | this | 227 | this |
| 247 | } | 228 | } |
