I2CMasterWriteReadDMA

Trait I2CMasterWriteReadDMA 

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

Required Methods§

Source

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

Writes bytes to slave with address addr in non-blocking mode and then generate ReStart and receive a bytes from a same device

§Arguments
  • addr - slave address
  • bytes - byte slice that need to send
  • buf - byte slice where received bytes will be written
  • callback - callback that will be called on completion
§Safety

This function relies on supplied slices bytes and buf until callback called. So slices 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_STREAM, const RX_CH: u8> I2CMasterWriteReadDMA for I2CMasterDma<I2C, TxDMA<I2C, TX_STREAM, TX_CH>, RxDMA<I2C, RX_STREAM, RX_CH>>
where I2C: Instance, TX_STREAM: Stream, ChannelX<TX_CH>: Channel, Tx<I2C>: DMASet<TX_STREAM, TX_CH, MemoryToPeripheral>, RX_STREAM: Stream, ChannelX<RX_CH>: Channel, Rx<I2C>: DMASet<RX_STREAM, RX_CH, PeripheralToMemory>,