pub fn write_read<A: Into<I2cAddress>>(
        &mut self,
        address: A,
        write_buffer: &[u8],
        read_buffer: &mut [u8],
    ) -> Result<(), Error> {
        self.transaction(
            address,
            &mut [Operation::Write(write_buffer), Operation::Read(read_buffer)],
        )
    }
# use esp_hal::i2c::master::{Config, I2c};
# let mut i2c = I2c::new(
#   peripherals.I2C0,
#   Config::default(),
# )?;
# const DEVICE_ADDR: u8 = 0x77;
let mut data = [0u8; 22];
i2c.write_read(DEVICE_ADDR, &[0xaa], &mut data)?;
# Ok(())
# }
```

# Errors

The corresponding error variant from [`Error`] will be returned if the passed buffer has zero length.
esp-hal/src/i2c/master/mod.rs