Module interrupts

Source
Expand description

§Async interrupts

This module provides APIs specific to working with interrupts in an async peripheral context.

Asynchronous programming relies on tasks that can be paused and resumed without blocking the entire program. When an async task is waiting for a particular event, such as data from a peripheral, it enters a suspended state. It is crucial that the task is properly woken up when the expected event occurs to resume its execution.

By having peripherals take interrupts, they can signal the occurrence of relevant events, effectively waking up the associated async tasks. This ensures that the async runtime can schedule and resume tasks in a timely manner, providing the responsiveness required in embedded systems.

§Typelevel and enum-level interrupts

There are two main ways of representing interrupts in the HAL: either by using pac::Interrupt, where each interrupt is represented as an enum variant, or by using the typelevel interrupts defined in this module. Each interrupt source that is usable with async peripherals is declared as a struct with the same name of the corresponsing pac::Interrupt variant. Therefore, two distinct traits are needed to perform basic tasks on interrupt types:

  • Use Interrupt when dealing with the typelevel interrupt types defined in this module;
  • Use InterruptExt when dealing with enum-level interrupt types defined in pac.

Re-exports§

pub use crate::interrupt::*;

Enums§

DMAC
EIC_EXTINT_0
EIC_EXTINT_0 typelevel interrupt.
EIC_EXTINT_1
EIC_EXTINT_1 typelevel interrupt.
EIC_EXTINT_2
EIC_EXTINT_2 typelevel interrupt.
EIC_EXTINT_3
EIC_EXTINT_3 typelevel interrupt.
EIC_EXTINT_4
EIC_EXTINT_4 typelevel interrupt.
EIC_EXTINT_5
EIC_EXTINT_5 typelevel interrupt.
EIC_EXTINT_6
EIC_EXTINT_6 typelevel interrupt.
EIC_EXTINT_7
EIC_EXTINT_7 typelevel interrupt.
EIC_EXTINT_8
EIC_EXTINT_8 typelevel interrupt.
EIC_EXTINT_9
EIC_EXTINT_9 typelevel interrupt.
EIC_EXTINT_10
EIC_EXTINT_10 typelevel interrupt.
EIC_EXTINT_11
EIC_EXTINT_11 typelevel interrupt.
EIC_EXTINT_12
EIC_EXTINT_12 typelevel interrupt.
EIC_EXTINT_13
EIC_EXTINT_13 typelevel interrupt.
EIC_EXTINT_14
EIC_EXTINT_14 typelevel interrupt.
EIC_EXTINT_15
EIC_EXTINT_15 typelevel interrupt.
SERCOM0
SERCOM1
SERCOM2
SERCOM3
SERCOM4
SERCOM5
TC0
TC0 typelevel interrupt.
TC1
TC1 typelevel interrupt.
TC2
TC2 typelevel interrupt.
TC3
TC3 typelevel interrupt.

Traits§

Binding
Compile-time assertion that an interrupt has been bound to a handler.
Handler
Interrupt handler.
Interrupt
Type-level interrupt.
InterruptSource
An interrupt source that may have one or many interrupt bindings.
MultipleInterruptSources
Marker trait indicating that an interrupt source has multiple bindings and handlers.
SingleInterruptSource
Marker trait indicating that an interrupt source has one binding and one handler.