Skip to main content

LtdcScan

Struct LtdcScan 

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

Continuous-read typestate handle for fixed-rate pixel-stream consumers (LTDC, DCMI display-out, parallel RGB).

Distinguished from CircRead:

  • the consumer never pauses (no half-rotation; same buffer is read continuously),
  • the CPU paints in place between consumer reads rather than producing into an inactive half,
  • per-frame ordering is enforced by LtdcScan::present (clean plus DSB) at checkpoints chosen by the caller, not by an engine-side completion flag.

The DIR parameter is deliberately omitted — the CPU is always producer for this family. The inverse direction (camera frame-grab via DCMI) would be a separate LtdcGrab family; not in scope here, would ratify in a future §15 amendment with a named first user.

Implementations§

Source§

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

Source

pub fn dma_addr(&self) -> DmaAddr

DMA bus address of the buffer (stable for the typestate’s lifetime; equal to the address returned during the start_ltdc_scan transition). Pass to the consumer engine’s frame-buffer base register (e.g. LTDC CFBAR).

Source

pub fn paint_full(&mut self) -> &mut [T; N]

In-place CPU access to the full buffer.

Returns a &mut [T; N] valid until the next call that borrows self mutably (LtdcScan::present / LtdcScan::stop_scan). The borrow checker rejects concurrent paint_full / present calls.

No cache op is emitted here; ordering between the CPU’s writes and the consumer’s reads is enforced at present (DCB-00 §5 transition table).

Source

pub fn present<C: DcaCache>(&mut self, ctx: &mut DcaCacheCtx<'_, C>)

Per-frame checkpoint: publish CPU writes to RAM for the consumer’s next read.

Per DCB-00 §6 INV-D16 emits both DcaCache::clean over the full padded extent AND DcaCache::barrier (DSB-equivalent). Does not transition the typestate — the consumer engine is still reading; only the ordering between CPU writes and consumer reads is checkpointed.

Source

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

Transition back to Cpu.

Caller MUST stop the consumer engine before calling. Per DCB-00 §5: emits a final DcaCache::clean + DcaCache::barrier over the full padded extent so the next phase’s CPU read sees the buffer’s terminal state.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

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