SerialWriteDMA

Trait SerialWriteDMA 

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

Required Methods§

Source

unsafe fn write_dma( &mut self, bytes: &[u8], callback: Option<SerialCompleteCallback>, ) -> Result<(), Error>

Writes bytes to the serial interface in non-blocking mode

§Arguments
  • bytes - byte slice that need to send
  • callback - callback that will be called on completion
§Safety

This function relies on supplied slice bytes 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_STREAM, const TX_CH: u8, RX_TRANSFER> SerialWriteDMA for SerialDma<Serial_, TxDMA<Serial_, TX_STREAM, TX_CH>, RX_TRANSFER>
where TX_STREAM: Stream, ChannelX<TX_CH>: Channel, Tx<Serial_>: DMASet<TX_STREAM, TX_CH, MemoryToPeripheral>, RX_TRANSFER: DMATransfer<&'static mut [u8]>,