Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32U5: Add ADC drivers #3688

Merged
merged 17 commits into from
Dec 31, 2024
Prev Previous commit
Next Next commit
fix warnings
  • Loading branch information
klownfish committed Sep 25, 2024
commit 7b45577704c43465587f611da125d86cb3c85207
10 changes: 1 addition & 9 deletions embassy-stm32/src/adc/u5_adc4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ pub trait Instance: SealedInstance + crate::Peripheral<P = Self> + crate::rcc::R
}

pub struct Adc4<'d, T: Instance> {
#[allow(unused)]
adc: crate::PeripheralRef<'d, T>,
}

Expand Down Expand Up @@ -372,13 +373,4 @@ impl<'d, T: Instance> Adc4<'d, T> {
let ret = self.convert();
ret
}

fn cancel_conversions() {
if T::regs().cr().read().adstart() && !T::regs().cr().read().addis() {
T::regs().cr().modify(|reg| {
reg.set_adstp(true);
});
while T::regs().cr().read().adstart() {}
}
}
}