@@ -20,10 +20,10 @@ use crate::{
2020} ;
2121use core:: fmt;
2222use core:: marker:: PhantomData ;
23- use embedded_hal :: {
23+ use embedded_hal_old :: {
2424 adc:: { Channel , OneShot } ,
25- blocking:: delay:: DelayUs ,
2625} ;
26+ use embedded_hal:: delay:: DelayNs ;
2727
2828use self :: config:: ExternalTrigger12 ;
2929
@@ -168,7 +168,7 @@ macro_rules! adc_op_follower {
168168
169169/// Contains types related to ADC configuration
170170pub mod config {
171- use embedded_hal :: adc:: Channel ;
171+ use embedded_hal_old :: adc:: Channel ;
172172
173173 /// The place in the sequence a given channel should be captured
174174 #[ derive( Debug , PartialEq , PartialOrd , Copy , Clone ) ]
@@ -1381,7 +1381,7 @@ pub trait AdcClaim<TYPE: TriggerType> {
13811381 self ,
13821382 cs : ClockSource ,
13831383 rcc : & Rcc ,
1384- delay : & mut impl DelayUs < u8 > ,
1384+ delay : & mut impl DelayNs ,
13851385 reset : bool ,
13861386 ) -> Adc < TYPE , Disabled > ;
13871387
@@ -1391,7 +1391,7 @@ pub trait AdcClaim<TYPE: TriggerType> {
13911391 cs : ClockSource ,
13921392 rcc : & Rcc ,
13931393 config : config:: AdcConfig < TYPE :: ExternalTrigger > ,
1394- delay : & mut impl DelayUs < u8 > ,
1394+ delay : & mut impl DelayNs ,
13951395 reset : bool ,
13961396 ) -> Adc < TYPE , Configured > ;
13971397}
@@ -1583,7 +1583,7 @@ macro_rules! adc {
15831583
15841584 /// Powers-up an powered-down Adc
15851585 #[ inline( always) ]
1586- pub fn power_up( & mut self , delay: & mut impl DelayUs < u8 > ) {
1586+ pub fn power_up( & mut self , delay: & mut impl DelayNs ) {
15871587 if self . is_deeppwd_enabled( ) {
15881588 self . disable_deeppwd_down( ) ;
15891589 }
@@ -1616,7 +1616,7 @@ macro_rules! adc {
16161616
16171617 /// Enables the Voltage Regulator
16181618 #[ inline( always) ]
1619- pub fn enable_vreg( & mut self , delay: & mut impl DelayUs < u8 > ) {
1619+ pub fn enable_vreg( & mut self , delay: & mut impl DelayNs ) {
16201620 self . adc_reg. cr. modify( |_, w| w. advregen( ) . set_bit( ) ) ;
16211621 while !self . adc_reg. cr. read( ) . advregen( ) . bit_is_set( ) { }
16221622
@@ -2124,7 +2124,7 @@ macro_rules! adc {
21242124 /// * `reset` - should a reset be performed. This is provided because on some devices multiple ADCs share the same common reset
21252125 /// TODO: fix needing SYST
21262126 #[ inline( always) ]
2127- fn claim( self , cs: ClockSource , rcc: & Rcc , delay: & mut impl DelayUs < u8 > , reset: bool ) -> Adc <stm32:: $adc_type, Disabled > {
2127+ fn claim( self , cs: ClockSource , rcc: & Rcc , delay: & mut impl DelayNs , reset: bool ) -> Adc <stm32:: $adc_type, Disabled > {
21282128 unsafe {
21292129 let rcc_ptr = & ( * stm32:: RCC :: ptr( ) ) ;
21302130 stm32:: $adc_type:: enable( rcc_ptr) ;
@@ -2148,7 +2148,7 @@ macro_rules! adc {
21482148
21492149 /// claims and configures the Adc
21502150 #[ inline( always) ]
2151- fn claim_and_configure( self , cs: ClockSource , rcc: & Rcc , config: config:: AdcConfig <$trigger_type>, delay: & mut impl DelayUs < u8 > , reset : bool ) -> Adc <stm32:: $adc_type, Configured > {
2151+ fn claim_and_configure( self , cs: ClockSource , rcc: & Rcc , config: config:: AdcConfig <$trigger_type>, delay: & mut impl DelayNs , reset : bool ) -> Adc <stm32:: $adc_type, Configured > {
21522152 let mut adc = self . claim( cs, rcc, delay, reset) ;
21532153 adc. adc. config = config;
21542154
@@ -2172,7 +2172,7 @@ macro_rules! adc {
21722172 impl Adc <stm32:: $adc_type, PoweredDown > {
21732173 /// Powers-up an powered-down Adc
21742174 #[ inline( always) ]
2175- pub fn power_up( mut self , delay: & mut impl DelayUs < u8 > ) -> Adc <stm32:: $adc_type, Disabled > {
2175+ pub fn power_up( mut self , delay: & mut impl DelayNs ) -> Adc <stm32:: $adc_type, Disabled > {
21762176 self . adc. power_up( delay) ;
21772177
21782178 Adc {
0 commit comments