[][src]Crate interrupture

Safe and "free of data races" interrupt system.

The interrupt system features are:

  • Ownership based interrupt management. The InterruptTable owns the nvic register and thus it is the only one that can access and change the interrupt controller.

  • Easy to use closure-based ISR registration. Closures can be registered as interrupt service routine.

  • Free of data races. Thanks to Rust Send and Sync concept, the interrupt system is free of data races. Shared mutable access on a variable must be synchronized with a PrimaskMutex, otherwise the compilation fails.

  • Scoped IRSs with access to the enviroment. It is guaranteed that the closure is unregistered at the end of the scope. Thus it is safe to access the parent stack in the interrupt service routine.

Structs

InterruptHandle

The InterruptHandle is used to access and configure an active interrupt.

InterruptTable

The InterruptTable guarantees safe and 'free of data races' use of interrupts.

Enums

Error

The error type that can occur when handling with interrupts.

Traits

InterruptController

A low level API for interrupts. Implement this API for your hardware in order to get access to the more convenient crossbeam-like API.

Nr

Interrupt number

Functions

handle_isr

Call this function from your #[exception] default handler in order to thread the interrupts through to this crate's handler code.

scope

Creates a new scope, to guarantee that the InterruptTable constructor is called.