make I2c::write_async take an iterator
There's no other iterator async API right now.
This commit is contained in:
parent
1ee4bb22de
commit
09afece93d
@ -406,9 +406,9 @@ impl<'d, T: Instance> I2c<'d, T, Async> {
|
|||||||
self.read_async_internal(buffer, false, true).await
|
self.read_async_internal(buffer, false, true).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn write_async(&mut self, addr: u16, buffer: &[u8]) -> Result<(), Error> {
|
pub async fn write_async(&mut self, addr: u16, bytes : impl IntoIterator<Item = u8>) -> Result<(), Error> {
|
||||||
Self::setup(addr)?;
|
Self::setup(addr)?;
|
||||||
self.write_async_internal(buffer.iter().copied(), true).await
|
self.write_async_internal(bytes, true).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user