pub struct TriggeredFrames<'a, W: Word, const N: usize> { /* private fields */ }Expand description
A stream of triggered frames. Dropping it stops the stream and restores the Spi.
Implementations§
Source§impl<'a, W: Word, const N: usize> TriggeredFrames<'a, W, N>
impl<'a, W: Word, const N: usize> TriggeredFrames<'a, W, N>
Sourcepub fn new<T: InterruptInstance>(
spi: &'a mut Spi<'_, Async, Master>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'a,
rearm: &'a mut Channel<'_>,
config: Config,
descriptors: &'a mut Descriptors<N>,
ring: &'a mut [W],
tx_frame: &'a [W],
) -> Self
pub fn new<T: InterruptInstance>( spi: &'a mut Spi<'_, Async, Master>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'a, rearm: &'a mut Channel<'_>, config: Config, descriptors: &'a mut Descriptors<N>, ring: &'a mut [W], tx_frame: &'a [W], ) -> Self
Start streaming: every edge of config.trigger runs one frame.
spi: instanceT, with both DMA channels; its mode and frequency apply to the frames.rearm: a third channel of the same DMA controller.tx_frame: sent each frame; its length is the frame length, at most 65535 words.ring:Nblocks of whole frames, at mostMAX_FRAMES_PER_BLOCKframes and 65535 bytes per block.
The trigger source is set up separately (e.g. ExtiInput::enable_event). The first
block may hold frames from before the call.
Sourcepub async fn next_block(&mut self) -> Result<Block<'_, W>, Error>
pub async fn next_block(&mut self) -> Result<Block<'_, W>, Error>
The next block, read in place. Error::Overrun if the consumer fell a ring behind, also
while it held the previous block.
Sourcepub fn take_missed_trigger(&mut self) -> bool
pub fn take_missed_trigger(&mut self) -> bool
Whether a trigger was lost because the previous one was still being served. Clears it.
Sourcepub fn crc_errors(&self) -> u32
pub fn crc_errors(&self) -> u32
Frames that failed their CRC since the stream started.
Sourcepub fn frames_per_block(&self) -> usize
pub fn frames_per_block(&self) -> usize
Frames per block.
Trait Implementations§
Auto Trait Implementations§
impl<'a, W, const N: usize> !RefUnwindSafe for TriggeredFrames<'a, W, N>
impl<'a, W, const N: usize> !Send for TriggeredFrames<'a, W, N>
impl<'a, W, const N: usize> !Sync for TriggeredFrames<'a, W, N>
impl<'a, W, const N: usize> !UnwindSafe for TriggeredFrames<'a, W, N>
impl<'a, W, const N: usize> Freeze for TriggeredFrames<'a, W, N>
impl<'a, W, const N: usize> Unpin for TriggeredFrames<'a, W, N>
impl<'a, W, const N: usize> UnsafeUnpin for TriggeredFrames<'a, W, N>where
*const W: UnsafeUnpin,
&'a [[Atomic<u32>; 2]; N]: UnsafeUnpin,
PhantomData<&'a mut [W]>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more