cortex_m_interrupt/exception.rs
1use crate::InterruptRegistration;
2
3/// A handle that can be used to configure the occupation of an interrupt caused by an exception.
4///
5/// The proc-macro [`take_exception`] should be used to create an implementor of this trait.
6///
7/// [`take_exception`]: super::take_exception
8pub trait ExceptionRegistration: InterruptRegistration {
9 const EXCEPTION: crate::cortex_m::peripheral::scb::Exception;
10
11 /// The [`Exception`] that this [`ExceptionRegistration`] is associated with.
12 ///
13 /// [`Exception`]: cortex_m::peripheral::scb::Exception
14 fn exception(&self) -> crate::cortex_m::peripheral::scb::Exception {
15 Self::EXCEPTION
16 }
17}