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

        // Stop the DMA as it doesn't know that the camera has stopped.
        self.camera.rx_channel.stop_transfer();

        // Note: There is no "done" interrupt to clear.

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

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

        (result, camera, BUF::from_view(view))
    }
Waits for the transfer to stop and returns the peripheral and buffer.

Note: The camera doesn't really "finish" its transfer, so what you're
really waiting for here is a DMA Error. You typically just want to
call [Self::stop] once you have the data you need.
esp-hal/src/lcd_cam/cam.rs