embassy-stm32

Crates

git

Versions

stm32n645i0

Flavors

Skip to main content

Npu

Struct Npu 

Source
pub struct Npu<'d, T: Instance> { /* private fields */ }
Expand description

Neural-ART NPU driver.

Implementations§

Source§

impl<'d, T: Instance> Npu<'d, T>

Source

pub fn new( peri: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Self

Enable and initialize the NPU.

Enables the NPU kernel clock, resets the IP, ungates all ATON-internal unit clocks, enables the bus interfaces and configures the interrupt controller (the equivalent of LL_ATON_RT_RuntimeInit()).

Source

pub async fn run_epoch_blob(&mut self, blob: &[u64]) -> Result<(), Error>

Execute one epoch controller blob and wait for its completion.

blob must contain a loaded blob — magic word, length, instructions — as produced by ecloader::EcBinary::load_blob (or a fully linked blob straight from <network>_ecblobs.h). The slice’s 8-byte alignment satisfies the epoch controller’s address requirement.

If the blob (or any data it reads) was written by the CPU into MCU-cacheable memory, clean the MCU cache first (see cache).

The future completes when the epoch controller raises its end-of-epoch interrupt. No hardware timeout is applied; wrap the future in embassy_time::with_timeout if needed.

Source

pub async fn run_network( &mut self, epochs: &[EpochBlock<'_>], ) -> Result<(), Error>

Run a network: execute a list of epoch blocks in order, awaiting each hardware blob and invoking the software callbacks in between — the equivalent of looping LL_ATON_RT_RunEpochBlock() until LL_ATON_RT_DONE.

Stops at the first hardware error.

Trait Implementations§

Source§

impl<'d, T: Instance> Drop for Npu<'d, T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'d, T> !UnwindSafe for Npu<'d, T>

§

impl<'d, T> Freeze for Npu<'d, T>
where T: Freeze,

§

impl<'d, T> RefUnwindSafe for Npu<'d, T>
where T: RefUnwindSafe,

§

impl<'d, T> Send for Npu<'d, T>

§

impl<'d, T> Sync for Npu<'d, T>
where T: Sync,

§

impl<'d, T> Unpin for Npu<'d, T>
where T: Unpin,

§

impl<'d, T> UnsafeUnpin for Npu<'d, T>
where T: UnsafeUnpin,

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.