atsamd_hal::interrupt

Trait InterruptExt

Source
pub trait InterruptExt: InterruptNumber + Copy {
    // Provided methods
    unsafe fn enable(self) { ... }
    fn disable(self) { ... }
    fn is_enabled(self) -> bool { ... }
    fn is_pending(self) -> bool { ... }
    fn pend(self) { ... }
    fn unpend(self) { ... }
    fn get_priority(self) -> Priority { ... }
    fn set_priority(self, prio: Priority) { ... }
    fn set_priority_with_cs(self, _cs: CriticalSection<'_>, prio: Priority) { ... }
}
Expand description

An interrupt type that can be configured by the HAL to handle interrupts.

The PAC defined enum-level interrupts implement this trait.

Provided Methods§

Source

unsafe fn enable(self)

Enable the interrupt.

§Safety

Do not enable any interrupt inside a critical section.

Source

fn disable(self)

Disable the interrupt.

Source

fn is_enabled(self) -> bool

Check if interrupt is enabled.

Source

fn is_pending(self) -> bool

Check if interrupt is pending.

Source

fn pend(self)

Set interrupt pending.

Source

fn unpend(self)

Unset interrupt pending.

Source

fn get_priority(self) -> Priority

Get the priority of the interrupt.

Source

fn set_priority(self, prio: Priority)

Set the interrupt priority.

Source

fn set_priority_with_cs(self, _cs: CriticalSection<'_>, prio: Priority)

Set the interrupt priority with an already-acquired critical section.

Equivalent to set_priority, except you pass a [CriticalSection] to prove you’ve already acquired a critical section. This prevents acquiring another one, which saves code size.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§