pub struct Interrupt<I, P, State> { /* private fields */ }Expand description
API for controlling pin interrupts
Implementations§
Source§impl<I, OldPin, State> Interrupt<I, OldPin, State>where
I: Trait,
impl<I, OldPin, State> Interrupt<I, OldPin, State>where
I: Trait,
Sourcepub fn select<P>(
self,
interrupt_pin: &P,
_: &mut Handle,
) -> Interrupt<I, P, State>where
P: Trait,
pub fn select<P>(
self,
interrupt_pin: &P,
_: &mut Handle,
) -> Interrupt<I, P, State>where
P: Trait,
Select a pin as the source of this interrupt
Please be aware that this method allows you to do things that might or might not be valid things to do:
- You can select any pin, regardless of its current state.
- You can select the same pin for multiple interrupts.
The documentation isn’t totally clear about whether these are allowed, and no research has been done to verify it one way or the other. Please be careful, and make sure to open an issue, if you discover that this API allows you to do something that is not correct.
Please also be aware that the interrupt handler for various pin interrupts is reused for other purposes.
Source§impl<I, P> Interrupt<I, P, Enabled>
impl<I, P> Interrupt<I, P, Enabled>
Sourcepub fn clear_rising_edge_flag(&mut self) -> bool
pub fn clear_rising_edge_flag(&mut self) -> bool
Returns whether a rising edge has been detected and clears the flag
This method will work regardless of whether rising edge interrupts have been enabled or not.
You must call this handle while handling a rising edge interrupt. Otherwise, the interrupt will be fired again immediately, after the interrupt handler exits.
Sourcepub fn enable_rising_edge(&mut self)
pub fn enable_rising_edge(&mut self)
Fire interrupt on rising edge
Sourcepub fn disable_rising_edge(&mut self)
pub fn disable_rising_edge(&mut self)
Don’t fire interrupt on rising edge
Sourcepub fn clear_falling_edge_flag(&mut self) -> bool
pub fn clear_falling_edge_flag(&mut self) -> bool
Returns whether a falling edge has been detected and clears the flag
This method will work regardless of whether falling edge interrupts have been enabled or not.
You must call this handle while handling a falling edge interrupt. Otherwise, the interrupt will be fired again immediately, after the interrupt handler exits.
Sourcepub fn enable_falling_edge(&mut self)
pub fn enable_falling_edge(&mut self)
Fire interrupt on falling edge
Sourcepub fn disable_falling_edge(&mut self)
pub fn disable_falling_edge(&mut self)
Don’t fire interrupt on falling edge