@@ -150,7 +150,7 @@ pub trait Active {}
150150#[ derive( Default ) ]
151151pub struct Input < PULL = Floating > ( PhantomData < PULL > ) ;
152152
153- impl < MODE > Active for Input < MODE > { }
153+ impl < PULL > Active for Input < PULL > { }
154154
155155/// Used by the debugger (type state)
156156#[ derive( Default ) ]
@@ -986,6 +986,61 @@ where
986986 }
987987}
988988
989+ impl Analog {
990+ pub fn new < const P : char , const N : u8 , MODE > (
991+ pin : Pin < P , N , MODE > ,
992+ cr : & mut <Pin < P , N , MODE > as HL >:: Cr ,
993+ ) -> Pin < P , N , Self >
994+ where
995+ Pin < P , N , MODE > : HL ,
996+ Self : PinMode ,
997+ {
998+ pin. into_mode ( cr)
999+ }
1000+ }
1001+
1002+ impl < PULL > Input < PULL > {
1003+ pub fn new < const P : char , const N : u8 , MODE > (
1004+ pin : Pin < P , N , MODE > ,
1005+ cr : & mut <Pin < P , N , MODE > as HL >:: Cr ,
1006+ _pull : PULL ,
1007+ ) -> Pin < P , N , Self >
1008+ where
1009+ Pin < P , N , MODE > : HL ,
1010+ Self : PinMode ,
1011+ {
1012+ pin. into_mode ( cr)
1013+ }
1014+ }
1015+
1016+ impl < Otype > Output < Otype > {
1017+ pub fn new < const P : char , const N : u8 , MODE > (
1018+ mut pin : Pin < P , N , MODE > ,
1019+ cr : & mut <Pin < P , N , MODE > as HL >:: Cr ,
1020+ state : PinState ,
1021+ ) -> Pin < P , N , Self >
1022+ where
1023+ Pin < P , N , MODE > : HL ,
1024+ Self : PinMode ,
1025+ {
1026+ pin. _set_state ( state) ;
1027+ pin. into_mode ( cr)
1028+ }
1029+ }
1030+
1031+ impl < Otype > Alternate < Otype > {
1032+ pub fn new < const P : char , const N : u8 , MODE > (
1033+ pin : Pin < P , N , MODE > ,
1034+ cr : & mut <Pin < P , N , MODE > as HL >:: Cr ,
1035+ ) -> Pin < P , N , Self >
1036+ where
1037+ Pin < P , N , MODE > : HL ,
1038+ Self : PinMode ,
1039+ {
1040+ pin. into_mode ( cr)
1041+ }
1042+ }
1043+
9891044gpio ! ( GPIOA , gpioa, PAx , 'A' , [
9901045 PA0 : ( pa0, 0 ) ,
9911046 PA1 : ( pa1, 1 ) ,
0 commit comments