pub trait I2CMasterWriteReadDMA {
// Required method
unsafe fn write_read_dma(
&mut self,
addr: u8,
bytes: &[u8],
buf: &mut [u8],
callback: Option<I2cCompleteCallback>,
) -> Result<(), Error>;
}
Required Methods§
Sourceunsafe fn write_read_dma(
&mut self,
addr: u8,
bytes: &[u8],
buf: &mut [u8],
callback: Option<I2cCompleteCallback>,
) -> Result<(), Error>
unsafe fn write_read_dma( &mut self, addr: u8, bytes: &[u8], buf: &mut [u8], callback: Option<I2cCompleteCallback>, ) -> Result<(), Error>
Writes bytes
to slave with address addr
in non-blocking mode and then generate ReStart and receive a bytes from a same device
§Arguments
addr
- slave addressbytes
- byte slice that need to sendbuf
- byte slice where received bytes will be writtencallback
- callback that will be called on completion
§Safety
This function relies on supplied slices bytes
and buf
until callback
called. So slices must live until that moment.
§Warning
callback
may be called before function returns value. It happens on errors in preparation stages.