cortex-m-interrupt 0.2.0

Function-like, trait-based interrupt handler registration.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::InterruptRegistration;

/// A handle that can be used to configure the occupation of an interrupt caused by an exception.
///
/// The proc-macro [`take_exception`] should be used to create an implementor of this trait.
///
/// [`take_exception`]: super::take_exception
pub trait ExceptionRegistration: InterruptRegistration {
    const EXCEPTION: crate::cortex_m::peripheral::scb::Exception;

    /// The [`Exception`] that this [`ExceptionRegistration`] is associated with.
    ///
    /// [`Exception`]: cortex_m::peripheral::scb::Exception
    fn exception(&self) -> crate::cortex_m::peripheral::scb::Exception {
        Self::EXCEPTION
    }
}