atsamd_hal::async_hal::interrupts

Trait Interrupt

Source
pub trait Interrupt: Sealed {
    const IRQ: Interrupt;

    // Provided methods
    unsafe fn enable() { ... }
    fn disable() { ... }
    fn is_enabled() -> bool { ... }
    fn is_pending() -> bool { ... }
    fn pend() { ... }
    fn unpend() { ... }
    fn get_priority() -> Priority { ... }
    fn set_priority(prio: Priority) { ... }
    fn set_priority_with_cs(cs: CriticalSection<'_>, prio: Priority) { ... }
}
Expand description

Type-level interrupt.

This trait is implemented for all typelevel single interrupt types defined in this module. May not be implemented outside of this HAL.

Required Associated Constants§

Source

const IRQ: Interrupt

Interrupt enum variant.

This allows going from typelevel interrupts (one type per interrupt, defined in this module) to non-typelevel interrupts (a single Interrupt enum type, with one variant per interrupt).

Provided Methods§

Source

unsafe fn enable()

Enable the interrupt.

§Safety

Do not enable any interrupt inside a critical section.

Source

fn disable()

Disable the interrupt.

Source

fn is_enabled() -> bool

Check if interrupt is enabled.

Source

fn is_pending() -> bool

Check if interrupt is pending.

Source

fn pend()

Set interrupt pending.

Source

fn unpend()

Unset interrupt pending.

Source

fn get_priority() -> Priority

Get the priority of the interrupt.

Source

fn set_priority(prio: Priority)

Set the interrupt priority.

Source

fn set_priority_with_cs(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§

Source§

impl Interrupt for DMAC

Source§

const IRQ: Interrupt = crate::pac::Interrupt::DMAC

Source§

impl Interrupt for EIC

Source§

const IRQ: Interrupt = crate::pac::Interrupt::EIC

Source§

impl Interrupt for SERCOM0

Source§

const IRQ: Interrupt = crate::pac::Interrupt::SERCOM0

Source§

impl Interrupt for SERCOM1

Source§

const IRQ: Interrupt = crate::pac::Interrupt::SERCOM1

Source§

impl Interrupt for TC1

Source§

const IRQ: Interrupt = crate::pac::Interrupt::TC1

Source§

impl Interrupt for TC2

Source§

const IRQ: Interrupt = crate::pac::Interrupt::TC2