Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeaurivage committed Nov 25, 2024
1 parent 82dca2f commit e79628b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions hal/src/peripherals/eic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ pub trait ChId {
const ID: usize;
}

/// Marker struct that represents an EXTINT channel capable of doing async operations.
/// Marker struct that represents an EXTINT channel capable of doing async
/// operations.
#[cfg(feature = "async")]
pub enum EicFuture {}

Expand Down Expand Up @@ -82,16 +83,17 @@ where

/// EIC channel.
///
/// Use this struct to create an [`ExtInt`](pins::ExtInt) by calling [`with_pin`](Self::with_pin).
/// Use this struct to create an [`ExtInt`](pins::ExtInt) by calling
/// [`with_pin`](Self::with_pin).
pub struct Channel<Id: ChId, F = NoneT> {
eic: core::mem::ManuallyDrop<pac::Eic>,
_id: PhantomData<Id>,
_irqs: PhantomData<F>,
}

impl<Id: ChId, F> Channel<Id, F> {
/// Assign a pin to this [`Channel`], and turn it into an [`ExtInt`], which is capable of sensing
/// state changes on the pin.
/// Assign a pin to this [`Channel`], and turn it into an [`ExtInt`], which
/// is capable of sensing state changes on the pin.
pub fn with_pin<P: EicPin<ChId = Id>>(self, pin: P) -> ExtInt<P, Id, F> {
ExtInt::new(pin, self)
}
Expand All @@ -115,7 +117,9 @@ impl<Id: ChId, F> Channel<Id, F> {
}
}

/// External Interrupt Controller. Use [`split`](Self::split) to split the struct into individual channels, whcih can be used to create [`ExtInt`]s.
/// External Interrupt Controller. Use [`split`](Self::split) to split the
/// struct into individual channels, which can then be used to create
/// [`ExtInt`]s, by calling [`Channel::with_pin`].
pub struct Eic<I = NoneT> {
eic: pac::Eic,
_irqs: PhantomData<I>,
Expand Down

0 comments on commit e79628b

Please sign in to comment.