@@ -18,34 +18,43 @@ pub trait GpioExt {
1818}
1919
2020/// Input mode (type state)
21+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
2122pub struct Input < MODE > {
2223 _mode : PhantomData < MODE > ,
2324}
2425
2526/// Floating input (type state)
27+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
2628pub struct Floating ;
2729
2830/// Pulled down input (type state)
31+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
2932pub struct PullDown ;
3033
3134/// Pulled up input (type state)
35+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
3236pub struct PullUp ;
3337
3438/// Open drain input or output (type state)
39+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
3540pub struct OpenDrain ;
3641
3742/// Analog mode (type state)
43+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
3844pub struct Analog ;
3945
4046/// Output mode (type state)
47+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
4148pub struct Output < MODE > {
4249 _mode : PhantomData < MODE > ,
4350}
4451
4552/// Push pull output (type state)
53+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
4654pub struct PushPull ;
4755
4856/// GPIO Pin speed selection
57+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
4958pub enum Speed {
5059 Low = 0 ,
5160 Medium = 1 ,
@@ -54,14 +63,17 @@ pub enum Speed {
5463}
5564
5665/// Trigger edgw
66+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
5767pub enum SignalEdge {
5868 Rising ,
5969 Falling ,
6070 RisingFalling ,
6171}
6272
6373/// Altername Mode (type state)
74+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
6475pub struct Alternate < const A : u8 > ;
76+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
6577pub struct AlternateOD < const A : u8 > ;
6678
6779pub const AF0 : u8 = 0 ;
@@ -267,6 +279,7 @@ macro_rules! gpio {
267279 }
268280
269281 /// Partially erased pin
282+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
270283 pub struct $PXx<MODE > {
271284 i: u8 ,
272285 _mode: PhantomData <MODE >,
@@ -338,6 +351,7 @@ macro_rules! gpio {
338351 exti_erased!( $PXx<Input <MODE >>, $Pxn) ;
339352
340353 $(
354+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
341355 pub struct $PXi<MODE > {
342356 _mode: PhantomData <MODE >,
343357 }
0 commit comments