pub async fn read_exact_async(&mut self, mut buf: &mut [u8]) -> Result<(), RxError> {
        while !buf.is_empty() {
            // No point in listening for timeouts, as we're waiting for an exact amount of
            // data. On ESP32 and S2, the timeout interrupt can't be cleared unless the FIFO
            // is empty, so listening could cause an infinite loop here.
            self.wait_for_buffered_data(buf.len(), buf.len(), false)
                .await?;

            let read = self.uart.info().read_buffered(buf)?;
            buf = &mut buf[read..];
        }

        Ok(())
    }
Fill buffer asynchronously.

This function reads data into the provided buffer. If the internal FIFO
does not contain enough data, the function waits asynchronously for data
to become available, or for an error to occur.

Note that this function may ignore the `rx_fifo_full_threshold` setting
to ensure that it does not wait for more data than the buffer can hold.

## Cancellation

This function is **not** cancellation safe. If the future is dropped
before it resolves, or if an error occurs during the read operation,
previously read data may be lost.
esp-hal/src/uart.rs