embassy-stm32

Crates

git

Versions

stm32n647l0

Flavors

Skip to main content

EpochBlock

Struct EpochBlock 

Source
pub struct EpochBlock<'a> {
    pub start: Option<fn()>,
    pub end: Option<fn()>,
    pub blob: Option<&'a [u64]>,
    pub streng_mask: u16,
}
Expand description

One entry of a network’s epoch list — the Rust equivalent of the generated EpochBlock_ItemTypeDef.

start runs before an epoch-controller blob (typically MCU/NPU cache maintenance for the epoch’s inputs) and is the pre-op of a streaming-engine epoch. end runs after the epoch completes: cache invalidation, the generated post-op, or the body of a pure software epoch.

Fields§

§start: Option<fn()>

Called before an epoch-controller blob, or the pre-op of a streaming-engine epoch. Npu::run_streaming_epoch calls it only after the completion wait is armed.

§end: Option<fn()>

Called after the epoch completes.

§blob: Option<&'a [u64]>

Epoch controller blob to execute. None for a streaming-engine epoch or a pure software epoch.

§streng_mask: u16

Output streaming engines that signal completion of a streaming-engine epoch. Bit n is engine n. 0 for epoch-controller and software epochs.

Implementations§

Source§

impl<'a> EpochBlock<'a>

Source

pub const fn hw(blob: &'a [u64]) -> Self

A hardware epoch executing blob on the epoch controller.

Source

pub const fn hw_with( blob: &'a [u64], start: Option<fn()>, end: Option<fn()>, ) -> Self

A hardware epoch with cache-maintenance/trace callbacks.

Source

pub const fn streaming(start: fn(), end: Option<fn()>, streng_mask: u16) -> Self

A streaming-engine epoch.

start is the generated pre-op (LL_ATON_Start_EpochBlock_*). It programs the units and enables the output streaming engines named by streng_mask. Npu::run_network calls it after arming the wait, so the engines must be enabled from start and not before. end is the generated post-op (LL_ATON_End_EpochBlock_*): it disables those units and performs cache maintenance. It runs only after every engine in streng_mask has completed.

streng_mask is the generated epoch’s output-engine wait mask. Bit 0 is streaming engine 0, and only bits 0 through 9 are valid. An empty mask or a higher bit makes Npu::run_streaming_epoch return Error::InvalidWaitMask.

Source

pub const fn sw(start: Option<fn()>, end: Option<fn()>) -> Self

A pure software epoch: start/end run on the CPU, no hardware use.

Trait Implementations§

Source§

impl<'a> Clone for EpochBlock<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for EpochBlock<'a>

Auto Trait Implementations§

§

impl<'a> Forget for EpochBlock<'a>

§

impl<'a> Freeze for EpochBlock<'a>

§

impl<'a> Move for EpochBlock<'a>

§

impl<'a> RefUnwindSafe for EpochBlock<'a>

§

impl<'a> Send for EpochBlock<'a>

§

impl<'a> Sync for EpochBlock<'a>

§

impl<'a> Unpin for EpochBlock<'a>

§

impl<'a> UnsafeUnpin for EpochBlock<'a>

§

impl<'a> UnwindSafe for EpochBlock<'a>

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, I> Binding<I, NoHandler<I>> for T
where T: Copy, I: Interrupt,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.