@@ -168,6 +168,8 @@ mod marker {
168
168
pub trait Active { }
169
169
/// Marker trait for all pin modes except alternate
170
170
pub trait NotAlt { }
171
+ /// Marker trait for pins with alternate function `A` mapping
172
+ pub trait IntoAf < const A : u8 > : super :: HL { }
171
173
}
172
174
173
175
impl marker:: Readable for Input { }
@@ -230,9 +232,6 @@ pub trait HL {
230
232
type Afr ;
231
233
}
232
234
233
- /// Marker trait for pins with alternate function `A` mapping
234
- pub trait IntoAf < const A : u8 > : HL { }
235
-
236
235
macro_rules! cr {
237
236
( $high: literal: [ $( $i: literal) ,+] ) => {
238
237
$(
@@ -609,7 +608,7 @@ macro_rules! gpio {
609
608
pub mod $gpiox {
610
609
use crate :: pac:: $GPIOX;
611
610
use crate :: rcc:: { Enable , Reset , AHB } ;
612
- use super :: { Afr , Input , MODER , OTYPER , OSPEEDR , PUPDR , IntoAf } ;
611
+ use super :: { Afr , MODER , OTYPER , OSPEEDR , PUPDR } ;
613
612
614
613
/// GPIO parts
615
614
pub struct Parts {
@@ -660,10 +659,10 @@ macro_rules! gpio {
660
659
$(
661
660
#[ doc=stringify!( $PXi) ]
662
661
#[ 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 >;
664
663
665
664
$(
666
- impl <MODE > IntoAf <$A> for $PXi<MODE > { }
665
+ impl <MODE > super :: marker :: IntoAf <$A> for $PXi<MODE > { }
667
666
) *
668
667
) +
669
668
@@ -1197,7 +1196,7 @@ impl<const P: char> Gpio<P> {
1197
1196
'G' => crate :: pac:: GPIOG :: ptr ( ) as _ ,
1198
1197
#[ cfg( feature = "gpio-f303e" ) ]
1199
1198
'H' => crate :: pac:: GPIOH :: ptr ( ) as _ ,
1200
- _ => crate :: pac :: GPIOA :: ptr ( ) ,
1199
+ _ => panic ! ( "Unknown GPIO port" ) ,
1201
1200
}
1202
1201
}
1203
1202
}
0 commit comments