pub struct Npu<'d, T: Instance> { /* private fields */ }Expand description
Neural-ART NPU driver.
Implementations§
Source§impl<'d, T: Instance> Npu<'d, T>
impl<'d, T: Instance> Npu<'d, T>
Sourcepub fn new(
peri: Peri<'d, T>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
) -> Self
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()).
Sourcepub async fn run_epoch_blob(&mut self, blob: &[u64]) -> Result<(), Error>
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.
Sourcepub async fn run_network(
&mut self,
epochs: &[EpochBlock<'_>],
) -> Result<(), Error>
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.