pub struct DbufRead<'a, 'b, T: Copy, const N: usize> { /* private fields */ }Expand description
Continuous DMA-read typestate handle for double-buffer mode.
The DMA engine reads M0 and M1 alternately in continuous transfer.
The CPU is the producer and may fill the inactive bank through a
BankGuard<Read, _, _> obtained from DbufRead::bank_guard.
Implementations§
Source§impl<'a, 'b, T: Copy, const N: usize> DbufRead<'a, 'b, T, N>
impl<'a, 'b, T: Copy, const N: usize> DbufRead<'a, 'b, T, N>
Sourcepub fn m0_dma_addr(&self) -> DmaAddr
pub fn m0_dma_addr(&self) -> DmaAddr
DMA bus address of the M0 bank (stable for the typestate’s lifetime).
Sourcepub fn m1_dma_addr(&self) -> DmaAddr
pub fn m1_dma_addr(&self) -> DmaAddr
DMA bus address of the M1 bank.
Sourcepub fn bank_guard<'g, C: DcaCache>(
&'g mut self,
_ctx: &mut DcaCacheCtx<'_, C>,
current_target: Bank,
) -> BankGuard<'g, Read, T, N>
pub fn bank_guard<'g, C: DcaCache>( &'g mut self, _ctx: &mut DcaCacheCtx<'_, C>, current_target: Bank, ) -> BankGuard<'g, Read, T, N>
Acquire a guard over the inactive bank.
current_target names the bank the engine is currently
servicing (read from the stream’s CT bit). The guard exposes
the opposite bank.
No cache op is emitted at construction. Per DCB-00 §5
(DCB-01b-A 2026-05-03 amendment), the Read direction’s
cache op fires at release — the CPU is about to write
new data via the guard’s slice, so cleaning now would
publish stale data. The clean at release publishes the
just-completed CPU writes before the engine flips back to
this bank.
_ctx is unused at construction for Read direction (kept
for symmetry with DbufWrite::bank_guard, which uses it
for the entry-side invalidate).
Sourcepub fn stop_double_buffer<C: DcaCache>(
self,
ctx: &mut DcaCacheCtx<'_, C>,
) -> DbufCpu<'a, 'b, T, N>
pub fn stop_double_buffer<C: DcaCache>( self, ctx: &mut DcaCacheCtx<'_, C>, ) -> DbufCpu<'a, 'b, T, N>
Stop the double-buffer transfer and transition back to
DbufCpu.
Caller MUST stop the engine before calling. Cache op:
DcaCache::clean over both banks.