diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index 2441a45094..f4eb22c01b 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Peripheral singletons now implement `Debug` and `defmt::Format` (#2682, #2834) - `BurstConfig`, a device-specific configuration for configuring DMA transfers in burst mode (#2543) - `{DmaRxBuf, DmaTxBuf, DmaRxTxBuf}::set_burst_config` (#2543) +- Added `SpiDmaBus::split` for moving between manual & automatic DMA buffers (#2824) - ESP32-S2: DMA support for AES (#2699) - Added `transfer_in_place_async` and embedded-hal-async implementation to `Spi` (#2691) - `InterruptHandler` now implements `Hash` and `defmt::Format` (#2830) diff --git a/esp-hal/src/spi/master.rs b/esp-hal/src/spi/master.rs index a3de6b7928..15dc232e73 100644 --- a/esp-hal/src/spi/master.rs +++ b/esp-hal/src/spi/master.rs @@ -1646,6 +1646,12 @@ mod dma { tx_buf, } } + + /// Splits [SpiDmaBus] back into [SpiDma], [DmaRxBuf] and [DmaTxBuf]. + pub fn split(mut self) -> (SpiDma<'d, M, T>, DmaRxBuf, DmaTxBuf) { + self.wait_for_idle(); + (self.spi_dma, self.rx_buf, self.tx_buf) + } } impl InterruptConfigurable for SpiDmaBus<'_, Blocking, T>