diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index c70d94ef3..ac99d476c 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -60,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Xtensa devices now correctly enable the `esp-hal-procmacros/rtc-slow` feature (#2594) - User-bound GPIO interrupt handlers should no longer interfere with async pins. (#2625) +- `spi::master::Spi::{into_async, into_blocking}` are now correctly available on the typed driver, to. (#2674) ### Removed diff --git a/esp-hal/src/spi/master.rs b/esp-hal/src/spi/master.rs index 59b6d682d..5f74703be 100644 --- a/esp-hal/src/spi/master.rs +++ b/esp-hal/src/spi/master.rs @@ -511,21 +511,21 @@ impl<'d> Spi<'d, Blocking> { ) -> Result { Self::new_typed(spi.map_into(), config) } - - /// Converts the SPI instance into async mode. - pub fn into_async(self) -> Spi<'d, Async> { - Spi { - spi: self.spi, - _mode: PhantomData, - guard: self.guard, - } - } } impl<'d, T> Spi<'d, Blocking, T> where T: Instance, { + /// Converts the SPI instance into async mode. + pub fn into_async(self) -> Spi<'d, Async, T> { + Spi { + spi: self.spi, + _mode: PhantomData, + guard: self.guard, + } + } + /// Configures the SPI instance to use DMA with the specified channel. /// /// This method prepares the SPI instance for DMA transfers using SPI @@ -539,9 +539,12 @@ where } } -impl<'d> Spi<'d, Async> { +impl<'d, T> Spi<'d, Async, T> +where + T: Instance, +{ /// Converts the SPI instance into blocking mode. - pub fn into_blocking(self) -> Spi<'d, Blocking> { + pub fn into_blocking(self) -> Spi<'d, Blocking, T> { Spi { spi: self.spi, _mode: PhantomData,