pub fn read_received_data(&self, mut buf: &mut [u8]) -> usize {
        // Note that due to an ESP32 quirk, the last received descriptor may not get
        // updated.
        let capacity = buf.len();
        for chunk in self.received_data() {
            if buf.is_empty() {
                break;
            }
            let to_fill;
            (to_fill, buf) = buf.split_at_mut(chunk.len());
            to_fill.copy_from_slice(chunk);
        }

        capacity - buf.len()
    }
Reads the received data into the provided `buf`.

If `buf.len()` is less than the amount of received data then only the
first `buf.len()` bytes of received data is written into `buf`.

Returns the number of bytes in written to `buf`.
esp-hal/src/dma/buffers.rs