embassy-stm32

Crates

git

Versions

stm32l552me

Flavors

Icache

Struct Icache 

Source
pub struct Icache<'d> { /* private fields */ }
Expand description

Instruction cache driver.

Implementations§

Source§

impl<'d> Icache<'d>

Source

pub fn enable_remap_region( &mut self, region: u8, config: RegionConfig, ) -> Result<(), RegionError>

Configure and enable a memory-remap region.

region must be less than REGION_COUNT (this panics otherwise). The cache must be disabled, and the region must not already be enabled.

Source

pub fn disable_remap_region(&mut self, region: u8) -> Result<(), RegionError>

Disable a memory-remap region.

region must be less than REGION_COUNT (this panics otherwise). The cache must be disabled.

Source§

impl<'d> Icache<'d>

Source

pub fn new(_peri: Peri<'d, ICACHE>) -> Self

Create a new instruction cache driver. The cache is left disabled; call Self::enable() to turn it on.

Source

pub fn enable(&mut self)

Enable the cache.

This always succeeds even if a cache maintenance operation is ongoing: the cache is bypassed until it completes.

Source

pub fn disable(&mut self)

Disable the cache.

Disabling automatically triggers a full cache invalidation; this waits for EN to read back as cleared, but not for that invalidation to finish (call Self::invalidate() afterwards if you need that guarantee).

Source

pub fn is_enabled(&self) -> bool

Returns whether the cache is currently enabled.

Source

pub fn set_associativity(&mut self, assoc: Associativity) -> bool

Set the cache set-associativity.

Only possible while the cache is disabled. Returns false (and does nothing) if the cache is currently enabled.

Source

pub fn invalidate(&mut self)

Invalidate the entire cache content, blocking until the operation completes.

Can be called whether the cache is enabled or disabled.

Source

pub fn start_monitors(&mut self, monitor: Monitor)

Start the given performance counter(s). Use Self::reset_monitors() first if you want them to start counting from zero.

Source

pub fn stop_monitors(&mut self, monitor: Monitor)

Stop the given performance counter(s). Their counts are retained.

Source

pub fn reset_monitors(&mut self, monitor: Monitor)

Reset the given performance counter(s) to zero.

Source

pub fn hit_count(&self) -> u32

Current cache hit count. Saturates (does not wrap) at 0xFFFF_FFFF.

Source

pub fn miss_count(&self) -> u16

Current cache miss count. Saturates (does not wrap) at 0xFFFF.

Source

pub fn take_error(&mut self) -> bool

Returns true and clears the flag if a cache error (invalid maintenance operation) has occurred since the last call.

Auto Trait Implementations§

§

impl<'d> Freeze for Icache<'d>

§

impl<'d> RefUnwindSafe for Icache<'d>

§

impl<'d> Send for Icache<'d>

§

impl<'d> Sync for Icache<'d>

§

impl<'d> Unpin for Icache<'d>

§

impl<'d> !UnwindSafe for Icache<'d>

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.