Skip to content

Commit 30a974d

Browse files
committed
From
1 parent 08f4511 commit 30a974d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/gpio/alt.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,18 @@ macro_rules! pin {
7878
pub enum $name {
7979
$(
8080
$(#[$attr])*
81-
$PX(gpio::$PX),
81+
$PX(gpio::$PX<Alternate<$A $(, $Otype)?>>),
8282
)*
8383
}
84+
85+
$(
86+
$(#[$attr])*
87+
impl<MODE: PinMode> From<gpio::$PX<MODE>> for $name {
88+
fn from(p: gpio::$PX<MODE>) -> Self {
89+
Self::$PX(p.into_mode())
90+
}
91+
}
92+
)*
8493
)*
8594
};
8695
}

0 commit comments

Comments
 (0)