Skip to main content

CircWrite

Struct CircWrite 

Source
pub struct CircWrite<'a, T: Copy, const N: usize> { /* private fields */ }
Expand description

Continuous DMA-write typestate handle.

The DMA engine writes the buffer in circular mode. The CPU is the consumer and may drain the inactive half through a HalfGuard<Write, _, _> obtained from CircWrite::half_guard.

Implementations§

Source§

impl<'a, T: Copy, const N: usize> CircWrite<'a, T, N>

Source

pub fn dma_addr(&self) -> DmaAddr

DMA bus address of the buffer.

Source

pub fn half_guard<'b, C: DcaCache>( &'b mut self, ctx: &mut DcaCacheCtx<'_, C>, half: Half, ) -> HalfGuard<'b, Write, T, N>

Acquire a guard over the inactive half.

Cache op for Write direction: DcaCache::invalidate over the inactive half so the CPU’s next read of that half observes DMA-written data.

Source

pub fn stop_circular<C: DcaCache>( self, ctx: &mut DcaCacheCtx<'_, C>, ) -> Cpu<'a, T, N>

Stop the circular transfer and transition back to Cpu.

Caller MUST stop the engine before calling. Cache op: DcaCache::invalidate over the full padded extent so the CPU’s next read after release observes the final DMA-written state, not stale cache lines.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<'a, T, const N: usize> UnsafeUnpin for CircWrite<'a, 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.