stm32/adc: move convert resolution from PAC to version-specific mod.

This commit is contained in:
Dario Nieuwenhuis
2023-12-08 20:07:06 +01:00
parent 35f16c6003
commit 881cb16d28
2 changed files with 6 additions and 17 deletions

View File

@ -175,7 +175,12 @@ impl<'d, T: Instance> Adc<'d, T> {
}
pub fn resolution(&self) -> Resolution {
T::regs().cr1().read().res().into()
match T::regs().cr1().read().res() {
crate::pac::adc::vals::Res::TWELVEBIT => Resolution::TwelveBit,
crate::pac::adc::vals::Res::TENBIT => Resolution::TenBit,
crate::pac::adc::vals::Res::EIGHTBIT => Resolution::EightBit,
crate::pac::adc::vals::Res::SIXBIT => Resolution::SixBit,
}
}
pub fn enable_vref(&self) -> Vref<T> {