Trait SerialReadDMA

Source
pub trait SerialReadDMA {
    // Required method
    unsafe fn read_dma(
        &mut self,
        buf: &mut [u8],
        callback: Option<SerialCompleteCallback>,
    ) -> Result<(), Error>;
}

Required Methods§

Source

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 written
  • callback - 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.

Implementors§

Source§

impl<Serial_: Instance, TX_TRANSFER, RX_STREAM, const RX_CH: u8> SerialReadDMA for SerialDma<Serial_, TX_TRANSFER, RxDMA<Serial_, RX_STREAM, RX_CH>>
where RX_STREAM: Stream, ChannelX<RX_CH>: Channel, Rx<Serial_>: DMASet<RX_STREAM, RX_CH, PeripheralToMemory>, TX_TRANSFER: DMATransfer<&'static [u8]>,