@@ -155,7 +155,7 @@ pub(crate) fn connect_input_signal(
155155}
156156
157157fn connect_pin_to_input_signal (
158- pin : & mut AnyPin ,
158+ pin : & AnyPin ,
159159 signal : gpio:: InputSignal ,
160160 is_inverted : bool ,
161161 force_gpio : bool ,
@@ -176,7 +176,7 @@ fn connect_pin_to_input_signal(
176176}
177177
178178fn connect_peripheral_to_output (
179- pin : & mut AnyPin ,
179+ pin : & AnyPin ,
180180 signal : gpio:: OutputSignal ,
181181 is_inverted : bool ,
182182 force_gpio : bool ,
@@ -217,7 +217,7 @@ fn connect_peripheral_to_output(
217217 } ) ;
218218}
219219
220- fn disconnect_peripheral_output_from_pin ( pin : & mut AnyPin , signal : gpio:: OutputSignal ) {
220+ fn disconnect_peripheral_output_from_pin ( pin : & AnyPin , signal : gpio:: OutputSignal ) {
221221 pin. set_alternate_function ( GPIO_FUNCTION ) ;
222222
223223 GPIO :: regs ( )
@@ -307,8 +307,8 @@ impl InputSignal {
307307 /// Since there can only be one input signal connected to a peripheral at a
308308 /// time, this function will disconnect any previously connected input
309309 /// signals.
310- fn connect_input_to_peripheral ( & mut self , signal : gpio:: InputSignal ) {
311- connect_pin_to_input_signal ( & mut self . pin , signal, self . is_inverted , true ) ;
310+ fn connect_input_to_peripheral ( & self , signal : gpio:: InputSignal ) {
311+ connect_pin_to_input_signal ( & self . pin , signal, self . is_inverted , true ) ;
312312 }
313313
314314 delegate:: delegate! {
@@ -318,7 +318,7 @@ impl InputSignal {
318318 pub fn input_signals( & self , _internal: private:: Internal ) -> & ' static [ ( AlternateFunction , gpio:: InputSignal ) ] ;
319319 pub fn init_input( & self , pull: Pull ) ;
320320 pub fn is_input_high( & self ) -> bool ;
321- pub fn enable_input( & mut self , on: bool ) ;
321+ pub fn enable_input( & self , on: bool ) ;
322322 }
323323 }
324324}
@@ -346,8 +346,8 @@ impl DirectInputSignal {
346346 /// Since there can only be one input signal connected to a peripheral at a
347347 /// time, this function will disconnect any previously connected input
348348 /// signals.
349- fn connect_input_to_peripheral ( & mut self , signal : gpio:: InputSignal ) {
350- connect_pin_to_input_signal ( & mut self . pin , signal, false , false ) ;
349+ fn connect_input_to_peripheral ( & self , signal : gpio:: InputSignal ) {
350+ connect_pin_to_input_signal ( & self . pin , signal, false , false ) ;
351351 }
352352
353353 delegate:: delegate! {
@@ -356,7 +356,7 @@ impl DirectInputSignal {
356356 fn input_signals( & self , _internal: private:: Internal ) -> & ' static [ ( AlternateFunction , gpio:: InputSignal ) ] ;
357357 fn init_input( & self , pull: Pull ) ;
358358 fn is_input_high( & self ) -> bool ;
359- fn enable_input( & mut self , on: bool ) ;
359+ fn enable_input( & self , on: bool ) ;
360360 }
361361 }
362362}
@@ -428,17 +428,17 @@ impl OutputSignal {
428428 }
429429
430430 /// Connect the pin to a peripheral output signal.
431- fn connect_peripheral_to_output ( & mut self , signal : gpio:: OutputSignal ) {
432- connect_peripheral_to_output ( & mut self . pin , signal, self . is_inverted , true , true , false ) ;
431+ fn connect_peripheral_to_output ( & self , signal : gpio:: OutputSignal ) {
432+ connect_peripheral_to_output ( & self . pin , signal, self . is_inverted , true , true , false ) ;
433433 }
434434
435435 /// Remove this output pin from a connected [signal](`gpio::OutputSignal`).
436436 ///
437437 /// Clears the entry in the GPIO matrix / Io mux that associates this output
438438 /// pin with a previously connected [signal](`gpio::OutputSignal`). Any
439439 /// other outputs connected to the peripheral remain intact.
440- fn disconnect_from_peripheral_output ( & mut self , signal : gpio:: OutputSignal ) {
441- disconnect_peripheral_output_from_pin ( & mut self . pin , signal) ;
440+ fn disconnect_from_peripheral_output ( & self , signal : gpio:: OutputSignal ) {
441+ disconnect_peripheral_output_from_pin ( & self . pin , signal) ;
442442 }
443443
444444 delegate:: delegate! {
@@ -448,15 +448,15 @@ impl OutputSignal {
448448 pub fn input_signals( & self , _internal: private:: Internal ) -> & ' static [ ( AlternateFunction , gpio:: InputSignal ) ] ;
449449 pub fn init_input( & self , pull: Pull ) ;
450450 pub fn is_input_high( & self ) -> bool ;
451- pub fn enable_input( & mut self , on: bool ) ;
451+ pub fn enable_input( & self , on: bool ) ;
452452
453453 pub fn output_signals( & self , _internal: private:: Internal ) -> & ' static [ ( AlternateFunction , gpio:: OutputSignal ) ] ;
454- pub fn set_to_open_drain_output( & mut self ) ;
455- pub fn set_to_push_pull_output( & mut self ) ;
456- pub fn enable_output( & mut self , on: bool ) ;
457- pub fn set_output_high( & mut self , on: bool ) ;
458- pub fn set_drive_strength( & mut self , strength: gpio:: DriveStrength ) ;
459- pub fn enable_open_drain( & mut self , on: bool ) ;
454+ pub fn set_to_open_drain_output( & self ) ;
455+ pub fn set_to_push_pull_output( & self ) ;
456+ pub fn enable_output( & self , on: bool ) ;
457+ pub fn set_output_high( & self , on: bool ) ;
458+ pub fn set_drive_strength( & self , strength: gpio:: DriveStrength ) ;
459+ pub fn enable_open_drain( & self , on: bool ) ;
460460 pub fn is_set_high( & self ) -> bool ;
461461 }
462462 }
@@ -475,17 +475,17 @@ impl DirectOutputSignal {
475475 }
476476
477477 /// Connect the pin to a peripheral output signal.
478- fn connect_peripheral_to_output ( & mut self , signal : gpio:: OutputSignal ) {
479- connect_peripheral_to_output ( & mut self . pin , signal, false , false , true , false ) ;
478+ fn connect_peripheral_to_output ( & self , signal : gpio:: OutputSignal ) {
479+ connect_peripheral_to_output ( & self . pin , signal, false , false , true , false ) ;
480480 }
481481
482482 /// Remove this output pin from a connected [signal](`gpio::OutputSignal`).
483483 ///
484484 /// Clears the entry in the GPIO matrix / Io mux that associates this output
485485 /// pin with a previously connected [signal](`gpio::OutputSignal`). Any
486486 /// other outputs connected to the peripheral remain intact.
487- fn disconnect_from_peripheral_output ( & mut self , signal : gpio:: OutputSignal ) {
488- disconnect_peripheral_output_from_pin ( & mut self . pin , signal) ;
487+ fn disconnect_from_peripheral_output ( & self , signal : gpio:: OutputSignal ) {
488+ disconnect_peripheral_output_from_pin ( & self . pin , signal) ;
489489 }
490490
491491 delegate:: delegate! {
@@ -494,15 +494,15 @@ impl DirectOutputSignal {
494494 fn input_signals( & self , _internal: private:: Internal ) -> & ' static [ ( AlternateFunction , gpio:: InputSignal ) ] ;
495495 fn init_input( & self , pull: Pull ) ;
496496 fn is_input_high( & self ) -> bool ;
497- fn enable_input( & mut self , on: bool ) ;
497+ fn enable_input( & self , on: bool ) ;
498498
499499 fn output_signals( & self , _internal: private:: Internal ) -> & ' static [ ( AlternateFunction , gpio:: OutputSignal ) ] ;
500- fn set_to_open_drain_output( & mut self ) ;
501- fn set_to_push_pull_output( & mut self ) ;
502- fn enable_output( & mut self , on: bool ) ;
503- fn set_output_high( & mut self , on: bool ) ;
504- fn set_drive_strength( & mut self , strength: gpio:: DriveStrength ) ;
505- fn enable_open_drain( & mut self , on: bool ) ;
500+ fn set_to_open_drain_output( & self ) ;
501+ fn set_to_push_pull_output( & self ) ;
502+ fn enable_output( & self , on: bool ) ;
503+ fn set_output_high( & self , on: bool ) ;
504+ fn set_drive_strength( & self , strength: gpio:: DriveStrength ) ;
505+ fn enable_open_drain( & self , on: bool ) ;
506506 fn is_set_high( & self ) -> bool ;
507507 }
508508 }
@@ -605,18 +605,10 @@ impl InputConnection {
605605 pub fn init_input( & self , pull: Pull ) ;
606606 pub fn is_input_high( & self ) -> bool ;
607607 pub fn input_signals( & self , _internal: private:: Internal ) -> & ' static [ ( AlternateFunction , gpio:: InputSignal ) ] ;
608- }
609-
610- #[ instability:: unstable]
611- to match & mut self . 0 {
612- InputConnectionInner :: Input ( pin) => pin,
613- InputConnectionInner :: DirectInput ( pin) => pin,
614- InputConnectionInner :: Constant ( level) => level,
615- } {
616- pub fn enable_input( & mut self , on: bool ) ;
608+ pub fn enable_input( & self , on: bool ) ;
617609
618610 // This doesn't need to be public, the intended way is `connect_to` and `disconnect_from`
619- fn connect_input_to_peripheral( & mut self , signal: gpio:: InputSignal ) ;
611+ fn connect_input_to_peripheral( & self , signal: gpio:: InputSignal ) ;
620612 }
621613 }
622614}
@@ -702,27 +694,20 @@ impl OutputConnection {
702694
703695 pub fn is_set_high( & self ) -> bool ;
704696 pub fn output_signals( & self , _internal: private:: Internal ) -> & ' static [ ( AlternateFunction , gpio:: OutputSignal ) ] ;
705- }
706- #[ instability:: unstable]
707- to match & mut self . 0 {
708- OutputConnectionInner :: Output ( pin) => pin,
709- OutputConnectionInner :: DirectOutput ( pin) => pin,
710- OutputConnectionInner :: Constant ( level) => level,
711- } {
712- pub fn pull_direction( & mut self , pull: Pull ) ;
713- pub fn init_input( & mut self , pull: Pull ) ;
714- pub fn enable_input( & mut self , on: bool ) ;
697+ pub fn pull_direction( & self , pull: Pull ) ;
698+ pub fn init_input( & self , pull: Pull ) ;
699+ pub fn enable_input( & self , on: bool ) ;
715700
716- pub fn set_to_open_drain_output( & mut self ) ;
717- pub fn set_to_push_pull_output( & mut self ) ;
718- pub fn enable_output( & mut self , on: bool ) ;
719- pub fn set_output_high( & mut self , on: bool ) ;
720- pub fn set_drive_strength( & mut self , strength: gpio:: DriveStrength ) ;
721- pub fn enable_open_drain( & mut self , on: bool ) ;
701+ pub fn set_to_open_drain_output( & self ) ;
702+ pub fn set_to_push_pull_output( & self ) ;
703+ pub fn enable_output( & self , on: bool ) ;
704+ pub fn set_output_high( & self , on: bool ) ;
705+ pub fn set_drive_strength( & self , strength: gpio:: DriveStrength ) ;
706+ pub fn enable_open_drain( & self , on: bool ) ;
722707
723708 // These don't need to be public, the intended way is `connect_to` and `disconnect_from`
724- fn connect_peripheral_to_output( & mut self , signal: gpio:: OutputSignal ) ;
725- fn disconnect_from_peripheral_output( & mut self , signal: gpio:: OutputSignal ) ;
709+ fn connect_peripheral_to_output( & self , signal: gpio:: OutputSignal ) ;
710+ fn disconnect_from_peripheral_output( & self , signal: gpio:: OutputSignal ) ;
726711 }
727712 }
728713
0 commit comments