Add STM32L5 support.

This commit is contained in:
Dario Nieuwenhuis
2022-04-08 02:57:48 +02:00
parent 37da84129d
commit 50ff63ab88
8 changed files with 497 additions and 5 deletions

View File

@ -14,7 +14,7 @@ fn enable() {
crate::pac::RCC.apb2enr().modify(|w| w.set_adcen(true));
#[cfg(stm32g0)]
crate::pac::RCC.apbenr2().modify(|w| w.set_adcen(true));
#[cfg(any(stm32l4, stm32wb))]
#[cfg(any(stm32l4, stm32l5, stm32wb))]
crate::pac::RCC.ahb2enr().modify(|w| w.set_adcen(true));
});
}
@ -286,6 +286,9 @@ impl<'d, T: Instance> Adc<'d, T> {
#[cfg(not(stm32g0))] // TODO is this supposed to be public?
#[allow(unused)] // TODO is this supposed to be public?
fn calibrate(&mut self, vref: &mut Vref) {
#[cfg(stm32l5)]
let vref_cal: u32 = todo!();
#[cfg(not(stm32l5))]
let vref_cal = unsafe { crate::pac::VREFINTCAL.data().read().value() };
let old_sample_time = self.sample_time;