@@ -30,7 +30,7 @@ use crate::{
3030 pac:: { self , adc1, Interrupt } ,
3131 rcc:: { Clocks , Enable , AHB } ,
3232 time:: { duration:: Microseconds , fixed_point:: FixedPoint , rate:: Hertz } ,
33- Toggle ,
33+ Switch ,
3434} ;
3535
3636use crate :: pac:: { adc1_2, adc1_2:: ccr:: CKMODE_A } ;
@@ -493,7 +493,7 @@ where
493493 // TODO(Sh3Rm4n): Would about concurrent calibrations between related ADCs?
494494 // int_ref: &mut VoltageInternalReference<ADC>,
495495 ) {
496- self . configure_voltage_regulator ( Toggle :: On , clocks) ;
496+ self . configure_voltage_regulator ( Switch :: On , clocks) ;
497497
498498 self . reg
499499 . cr
@@ -512,21 +512,21 @@ where
512512 asm:: delay ( cpu_cycles) ;
513513
514514 // When the internal voltage regulator is disabled, the internal analog calibration is kept
515- self . configure_voltage_regulator ( Toggle :: Off , clocks) ;
515+ self . configure_voltage_regulator ( Switch :: Off , clocks) ;
516516 }
517517
518518 /// Enable the interal voltage generator Blocks until regulator is enabled.
519- fn configure_voltage_regulator ( & mut self , toggle : impl Into < Toggle > , clocks : & Clocks ) {
519+ fn configure_voltage_regulator ( & mut self , toggle : impl Into < Switch > , clocks : & Clocks ) {
520520 let already_on = self . reg . cr . read ( ) . advregen ( ) . is_enabled ( ) ;
521521 let toggle = toggle. into ( ) ;
522522 self . reg . cr . modify ( |_, w| w. advregen ( ) . intermediate ( ) ) ;
523523 self . reg . cr . modify ( |_, w| {
524524 w. advregen ( ) . variant ( match toggle {
525- Toggle :: On => adc1:: cr:: ADVREGEN_A :: Enabled ,
526- Toggle :: Off => adc1:: cr:: ADVREGEN_A :: Disabled ,
525+ Switch :: On => adc1:: cr:: ADVREGEN_A :: Enabled ,
526+ Switch :: Off => adc1:: cr:: ADVREGEN_A :: Disabled ,
527527 } )
528528 } ) ;
529- if toggle == Toggle :: On && !already_on {
529+ if toggle == Switch :: On && !already_on {
530530 let wait = MAX_ADVREGEN_STARTUP . integer ( )
531531 * clocks. sysclk ( ) . integer ( )
532532 * <Microseconds as FixedPoint >:: SCALING_FACTOR ;
@@ -1103,20 +1103,20 @@ where
11031103 /// Enable the interrupt for the specified [`Event`].
11041104 #[ inline]
11051105 pub fn enable_interrupt ( & mut self , event : Event ) {
1106- self . configure_interrupt ( event, Toggle :: On ) ;
1106+ self . configure_interrupt ( event, Switch :: On ) ;
11071107 }
11081108
11091109 /// Disable the interrupt for the specified [`Event`].
11101110 #[ inline]
11111111 pub fn disable_interrupt ( & mut self , event : Event ) {
1112- self . configure_interrupt ( event, Toggle :: Off ) ;
1112+ self . configure_interrupt ( event, Switch :: Off ) ;
11131113 }
11141114
11151115 /// Enable or disable the interrupt for the specified [`Event`].
11161116 #[ inline]
1117- pub fn configure_interrupt ( & mut self , event : Event , enable : impl Into < Toggle > ) {
1118- // Do a round way trip to be convert Into<Toggle > -> bool
1119- let enable: Toggle = enable. into ( ) ;
1117+ pub fn configure_interrupt ( & mut self , event : Event , enable : impl Into < Switch > ) {
1118+ // Do a round way trip to be convert Into<Switch > -> bool
1119+ let enable: Switch = enable. into ( ) ;
11201120 let enable: bool = enable. into ( ) ;
11211121 match event {
11221122 Event :: AdcReady => self . reg . ier . modify ( |_, w| w. adrdyie ( ) . bit ( enable) ) ,
0 commit comments