@@ -58,6 +58,7 @@ use core::marker::PhantomData;
5858
5959use crate :: pac;
6060use crate :: rcc:: Rcc ;
61+ pub mod alt;
6162mod convert;
6263pub use convert:: PinMode ;
6364mod partially_erased;
@@ -172,6 +173,8 @@ pub(crate) mod marker {
172173 /// Marker trait for active pin modes
173174 pub trait Active { }
174175 /// Marker trait for all pin modes except alternate
176+ pub trait NotAlt { }
177+ /// Marker trait for pins with alternate function `A` mapping
175178 pub trait IntoAf < const A : u8 > { }
176179}
177180
@@ -186,6 +189,9 @@ impl<Otype> marker::OutputSpeed for Output<Otype> {}
186189impl < const A : u8 , Otype > marker:: OutputSpeed for Alternate < A , Otype > { }
187190impl < Otype > marker:: Active for Output < Otype > { }
188191impl < const A : u8 , Otype > marker:: Active for Alternate < A , Otype > { }
192+ impl marker:: NotAlt for Input { }
193+ impl < Otype > marker:: NotAlt for Output < Otype > { }
194+ impl marker:: NotAlt for Analog { }
189195
190196/// GPIO Pin speed selection
191197#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
@@ -623,9 +629,13 @@ const fn gpiox<const P: char>() -> *const crate::pac::gpioa::RegisterBlock {
623629 'A' => crate :: pac:: GPIOA :: ptr ( ) ,
624630 'B' => crate :: pac:: GPIOB :: ptr ( ) as _ ,
625631 'C' => crate :: pac:: GPIOC :: ptr ( ) as _ ,
632+ #[ cfg( feature = "gpiod" ) ]
626633 'D' => crate :: pac:: GPIOD :: ptr ( ) as _ ,
634+ #[ cfg( feature = "gpioe" ) ]
627635 'E' => crate :: pac:: GPIOE :: ptr ( ) as _ ,
636+ #[ cfg( feature = "gpiof" ) ]
628637 'F' => crate :: pac:: GPIOF :: ptr ( ) as _ ,
638+ #[ cfg( feature = "gpiog" ) ]
629639 'G' => crate :: pac:: GPIOG :: ptr ( ) as _ ,
630640 _ => panic ! ( "Unknown GPIO port" ) ,
631641 }
0 commit comments