Struct Intc

Source
pub struct Intc { /* private fields */ }

Implementations§

Source§

impl Intc

Source

pub const fn new(base: StaticRef<IntcRegisters>) -> Self

Source

pub fn map_interrupts(&self)

The ESP32C3 is interesting. It allows interrupts to be mapped on the fly by setting the intr_map registers. This feature is completely undocumented. The ESP32 HAL and projects that use that (like Zephyr) call into the ROM code to enable interrupts which maps the interrupts. In Tock we map them ourselves so we don’t need to call into the ROM.

Source

pub fn clear_all_pending(&self)

Clear all pending interrupts.

Source

pub fn enable_all(&self)

Enable all interrupts.

Source

pub fn disable(&self, irq: u32)

Disable interrupt.

Source

pub fn disable_all(&self)

Disable all interrupts.

Source

pub fn next_pending(&self) -> Option<u32>

Get the index (0-256) of the lowest number pending interrupt, or None if none is pending. RISC-V Intc has a “claim” register which makes it easy to grab the highest priority pending interrupt.

Source

pub unsafe fn save_interrupt(&self, irq: u32)

Save the current interrupt to be handled later This will save the interrupt at index internally to be handled later. Interrupts must be disabled before this is called. Saved interrupts can be retrieved by calling get_saved_interrupts(). Saved interrupts are cleared when 'complete() is called.

Source

pub fn get_saved_interrupts(&self) -> Option<u32>

The next_pending() function will only return enabled interrupts. This function will return a pending interrupt that has been disabled by save_interrupt().

Source

pub unsafe fn complete(&self, irq: u32)

Signal that an interrupt is finished being handled. In Tock, this should be called from the normal main loop (not the interrupt handler). Interrupts must be disabled before this is called.

Auto Trait Implementations§

§

impl !Freeze for Intc

§

impl !RefUnwindSafe for Intc

§

impl !Send for Intc

§

impl !Sync for Intc

§

impl Unpin for Intc

§

impl !UnwindSafe for Intc

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.