File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,30 @@ mod tests {
7575 assert ! ( pin. is_low( ) ) ;
7676 assert ! ( is_pax_low( pin_num) ) ;
7777 }
78+
79+ #[ test]
80+ fn gpio_settings ( ) {
81+ use super :: * ;
82+
83+ let ( gpioa, _) = init ( ) ;
84+ let pin = gpioa. pa8 ;
85+
86+ let mut pin = pin. into_floating_input ( ) ;
87+
88+ pin. set_internal_resistor ( Pull :: Up ) ;
89+
90+ pin. set_internal_resistor ( Pull :: Down ) ;
91+
92+ let pin = pin. into_analog ( ) ;
93+ let pin = pin. into_push_pull_output ( ) ;
94+ let pin = pin. into_open_drain_output ( ) ;
95+ let pin: gpio:: Pin < 'A' , 8 , gpio:: Alternate < 7 > > = pin. into_alternate ( ) ;
96+ let mut pin: gpio:: Pin < 'A' , 8 , gpio:: Alternate < 15 > > =
97+ pin. into_alternate ( ) ;
98+
99+ pin. set_speed ( gpio:: Speed :: Low ) ;
100+ pin. set_speed ( gpio:: Speed :: VeryHigh ) ;
101+ }
78102}
79103
80104fn init ( ) -> ( gpio:: gpioa:: Parts , Delay ) {
You can’t perform that action at this time.
0 commit comments