Skip to main content

DbufRead

Struct DbufRead 

Source
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>

Source

pub fn m0_dma_addr(&self) -> DmaAddr

DMA bus address of the M0 bank (stable for the typestate’s lifetime).

Source

pub fn m1_dma_addr(&self) -> DmaAddr

DMA bus address of the M1 bank.

Source

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).

Source

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.

Auto Trait Implementations§

§

impl<'a, 'b, T, const N: usize> !RefUnwindSafe for DbufRead<'a, 'b, T, N>

§

impl<'a, 'b, T, const N: usize> !UnwindSafe for DbufRead<'a, 'b, T, N>

§

impl<'a, 'b, T, const N: usize> Freeze for DbufRead<'a, 'b, T, N>

§

impl<'a, 'b, T, const N: usize> Send for DbufRead<'a, 'b, T, N>
where T: Send,

§

impl<'a, 'b, T, const N: usize> Sync for DbufRead<'a, 'b, T, N>
where T: Send,

§

impl<'a, 'b, T, const N: usize> Unpin for DbufRead<'a, 'b, T, N>

§

impl<'a, 'b, T, const N: usize> UnsafeUnpin for DbufRead<'a, 'b, T, N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.