#[non_exhaustive]pub struct DmaTransferRxCircular<'a, I>where
I: DmaSupportRx,{ /* private fields */ }
Available on crate feature
unstable
only.Expand description
DMA transaction for RX only circular transfers
§Safety
Never use [core::mem::forget] on an in-progress transfer
Implementations§
Source§impl<'a, I> DmaTransferRxCircular<'a, I>where
I: DmaSupportRx,
impl<'a, I> DmaTransferRxCircular<'a, I>where
I: DmaSupportRx,
Sourcepub fn available(&mut self) -> Result<usize, DmaError>
pub fn available(&mut self) -> Result<usize, DmaError>
Amount of bytes which can be popped.
It’s expected to call this before trying to DmaTransferRxCircular::pop data.
Sourcepub fn pop(&mut self, data: &mut [u8]) -> Result<usize, DmaError>
pub fn pop(&mut self, data: &mut [u8]) -> Result<usize, DmaError>
Get available data.
It’s expected that the amount of available data is checked before by calling DmaTransferRxCircular::available and that the buffer can hold all available data.
Fails with DmaError::BufferTooSmall if the given buffer is too small to hold all available data