pub trait SerialReadDMA {
// Required method
unsafe fn read_dma(
&mut self,
buf: &mut [u8],
callback: Option<SerialCompleteCallback>,
) -> Result<(), Error>;
}Required Methods§
Sourceunsafe fn read_dma(
&mut self,
buf: &mut [u8],
callback: Option<SerialCompleteCallback>,
) -> Result<(), Error>
unsafe fn read_dma( &mut self, buf: &mut [u8], callback: Option<SerialCompleteCallback>, ) -> Result<(), Error>
Reads bytes from the serial interface in non-blocking mode and writes these bytes in buf
§Arguments
buf- 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.