pub struct ExtiGroupMask(/* private fields */);Expand description
Pre-computed bitmask for clearing multiple EXTI interrupt lines at once.
This type is intended for use with shared EXTI IRQ handlers
(for example EXTI15_10 or EXTI9_5), where multiple pins share
a single interrupt vector.
Instead of checking and clearing each pin individually in your interrupt handler, you can pre-compute a mask during initialization and use it to clear all pending flags with a single register write.
Implementations§
Source§impl ExtiGroupMask
impl ExtiGroupMask
Sourcepub fn new(inputs: &[&ExtiInput<'_, Blocking>]) -> Self
pub fn new(inputs: &[&ExtiInput<'_, Blocking>]) -> Self
Creates a new EXTI group mask from a list of inputs.
The mask is computed once and can be reused inside an interrupt handler for fast clearing of pending flags.
§Benefits
- Reduced verbosity: Clear all grouped pins with a single call instead of checking and clearing each pin individually.
- Performance: Clears all pending flags in one register write rather than multiple critical sections.
§Parameters
inputs- Slice of references toExtiInput<Blocking>instances that belong to the same EXTI IRQ group.
§Safety Notes
- All inputs must map to the same EXTI IRQ group (for instance all pins
in the range 10–15 for
EXTI15_10handler). - Mixing pins from different IRQ groups will cause
clear()to incorrectly clear pending flags belonging to other interrupt vectors, potentially causing missed interrupts. - Consult your STM32 reference manual for the EXTI line to IRQ vector mapping for your specific chip.
Auto Trait Implementations§
impl Freeze for ExtiGroupMask
impl RefUnwindSafe for ExtiGroupMask
impl Send for ExtiGroupMask
impl Sync for ExtiGroupMask
impl Unpin for ExtiGroupMask
impl UnwindSafe for ExtiGroupMask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more