pub fn wait(self) -> (Result<(), DmaError>, Mem2MemRx<'d, M>, BUF) {
        while !self.is_done() {}

        let (m2m, view) = self.release();

        let result = if m2m.channel.has_error() {
            Err(DmaError::DescriptorError)
        } else {
            Ok(())
        };

        (result, m2m, BUF::from_view(view))
    }
Waits for the transfer to stop and returns the peripheral and buffer.
esp-hal/src/dma/m2m.rs