@@ -58,6 +58,7 @@ use core::marker::PhantomData;
58
58
59
59
use crate :: pac;
60
60
use crate :: rcc:: Rcc ;
61
+ pub mod alt;
61
62
mod convert;
62
63
pub use convert:: PinMode ;
63
64
mod partially_erased;
@@ -172,6 +173,8 @@ pub(crate) mod marker {
172
173
/// Marker trait for active pin modes
173
174
pub trait Active { }
174
175
/// Marker trait for all pin modes except alternate
176
+ pub trait NotAlt { }
177
+ /// Marker trait for pins with alternate function `A` mapping
175
178
pub trait IntoAf < const A : u8 > { }
176
179
}
177
180
@@ -186,6 +189,9 @@ impl<Otype> marker::OutputSpeed for Output<Otype> {}
186
189
impl < const A : u8 , Otype > marker:: OutputSpeed for Alternate < A , Otype > { }
187
190
impl < Otype > marker:: Active for Output < Otype > { }
188
191
impl < 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 { }
189
195
190
196
/// GPIO Pin speed selection
191
197
#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
@@ -623,9 +629,13 @@ const fn gpiox<const P: char>() -> *const crate::pac::gpioa::RegisterBlock {
623
629
'A' => crate :: pac:: GPIOA :: ptr ( ) ,
624
630
'B' => crate :: pac:: GPIOB :: ptr ( ) as _ ,
625
631
'C' => crate :: pac:: GPIOC :: ptr ( ) as _ ,
632
+ #[ cfg( feature = "gpiod" ) ]
626
633
'D' => crate :: pac:: GPIOD :: ptr ( ) as _ ,
634
+ #[ cfg( feature = "gpioe" ) ]
627
635
'E' => crate :: pac:: GPIOE :: ptr ( ) as _ ,
636
+ #[ cfg( feature = "gpiof" ) ]
628
637
'F' => crate :: pac:: GPIOF :: ptr ( ) as _ ,
638
+ #[ cfg( feature = "gpiog" ) ]
629
639
'G' => crate :: pac:: GPIOG :: ptr ( ) as _ ,
630
640
_ => panic ! ( "Unknown GPIO port" ) ,
631
641
}
0 commit comments