Trait stm32f4xx_hal::i2c::dma::I2CMasterReadDMA
source · [−]pub trait I2CMasterReadDMA {
unsafe fn read_dma(
&mut self,
addr: u8,
buf: &mut [u8],
callback: Option<I2cCompleteCallback>
) -> Result<(), Error>;
}
Required Methods
sourceunsafe fn read_dma(
&mut self,
addr: u8,
buf: &mut [u8],
callback: Option<I2cCompleteCallback>
) -> Result<(), Error>
unsafe fn read_dma(
&mut self,
addr: u8,
buf: &mut [u8],
callback: Option<I2cCompleteCallback>
) -> Result<(), Error>
Reads bytes from slave device with address addr
in non-blocking mode and writes these bytes in buf
Arguments
addr
- slave addressbuf
- byte slice where received bytes will be writtencallback
- callback that will be called on completion
Safety
This function relies on supplied slice buf
until callback
called. So the slice must live until that moment.
Warning
callback
may be called before function returns value. It happens on errors in preparation stages.