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

Required Methods§

source

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

Writes bytes to slave with address addr in non-blocking mode

Arguments
  • addr - slave address
  • 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<I2C, TX_STREAM, const TX_CH: u8, RX_TRANSFER> I2CMasterWriteDMA for I2CMasterDma<I2C, TxDMA<I2C, TX_STREAM, TX_CH>, RX_TRANSFER>
where I2C: Instance, TX_STREAM: Stream, ChannelX<TX_CH>: Channel, Tx<I2C>: DMASet<TX_STREAM, TX_CH, MemoryToPeripheral>, RX_TRANSFER: DMATransfer<&'static mut [u8]>,