embassy-stm32

Crates

git

Versions

stm32f401vd

Flavors

ExtiGroupMask

Struct ExtiGroupMask 

Source
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

Source

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 to ExtiInput<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_10 handler).
  • 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.
Source

pub fn clear(&self)

Clears all pending EXTI interrupt flags contained in this mask.

This performs a single write to the EXTI pending register, making it suitable for use inside interrupt handlers.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.