pub trait Control {
    type Registers: Debug + Display;

    // Required methods
    unsafe fn disable(&mut self);
    unsafe fn enable(&mut self);
    fn is_enabled(&self) -> bool;
    fn register_handlers<H>(&mut self) -> Result<(), RegistrationError>
       where H: Handlers<Self::Registers>;

    // Provided method
    fn enter_critical(&mut self) -> CriticalGuard<'_, Self> { ... }
}
Expand description

An interrupt controller for a platform.

Required Associated Types§

Required Methods§

source

unsafe fn disable(&mut self)

Disable all interrupts.

Safety

This may cause a fault if called when interrupts are already disabled (depending on the platform). It does not guarantee that interrupts will ever be unmasked.

source

unsafe fn enable(&mut self)

Enable all interrupts.

Safety

This may cause a fault if called when interrupts are already enabled (depending on the platform).

source

fn is_enabled(&self) -> bool

Returns true if interrupts are enabled.

source

fn register_handlers<H>(&mut self) -> Result<(), RegistrationError>
where H: Handlers<Self::Registers>,

Provided Methods§

source

fn enter_critical(&mut self) -> CriticalGuard<'_, Self>

Enter a critical section, returning a guard.

Object Safety§

This trait is not object safe.

Implementors§