@@ -168,6 +168,8 @@ mod marker {
168168 pub trait Active { }
169169 /// Marker trait for all pin modes except alternate
170170 pub trait NotAlt { }
171+ /// Marker trait for pins with alternate function `A` mapping
172+ pub trait IntoAf < const A : u8 > : super :: HL { }
171173}
172174
173175impl marker:: Readable for Input { }
@@ -230,9 +232,6 @@ pub trait HL {
230232 type Afr ;
231233}
232234
233- /// Marker trait for pins with alternate function `A` mapping
234- pub trait IntoAf < const A : u8 > : HL { }
235-
236235macro_rules! cr {
237236 ( $high: literal: [ $( $i: literal) ,+] ) => {
238237 $(
@@ -609,7 +608,7 @@ macro_rules! gpio {
609608 pub mod $gpiox {
610609 use crate :: pac:: $GPIOX;
611610 use crate :: rcc:: { Enable , Reset , AHB } ;
612- use super :: { Afr , Input , MODER , OTYPER , OSPEEDR , PUPDR , IntoAf } ;
611+ use super :: { Afr , MODER , OTYPER , OSPEEDR , PUPDR } ;
613612
614613 /// GPIO parts
615614 pub struct Parts {
@@ -660,10 +659,10 @@ macro_rules! gpio {
660659 $(
661660 #[ doc=stringify!( $PXi) ]
662661 #[ doc=" pin" ]
663- pub type $PXi<MODE = Input > = super :: Pin <$port_id, $i, MODE >;
662+ pub type $PXi<MODE = super :: Input > = super :: Pin <$port_id, $i, MODE >;
664663
665664 $(
666- impl <MODE > IntoAf <$A> for $PXi<MODE > { }
665+ impl <MODE > super :: marker :: IntoAf <$A> for $PXi<MODE > { }
667666 ) *
668667 ) +
669668
@@ -1197,7 +1196,7 @@ impl<const P: char> Gpio<P> {
11971196 'G' => crate :: pac:: GPIOG :: ptr ( ) as _ ,
11981197 #[ cfg( feature = "gpio-f303e" ) ]
11991198 'H' => crate :: pac:: GPIOH :: ptr ( ) as _ ,
1200- _ => crate :: pac :: GPIOA :: ptr ( ) ,
1199+ _ => panic ! ( "Unknown GPIO port" ) ,
12011200 }
12021201 }
12031202}
0 commit comments