Refactor: Factor out Adc struct declaration

This commit is contained in:
Grant Miller
2022-10-26 17:51:12 -05:00
parent f363f6ce92
commit 9c30d565b9
5 changed files with 10 additions and 24 deletions

View File

@ -3,7 +3,7 @@ use core::marker::PhantomData;
use embassy_hal_common::into_ref;
use embedded_hal_02::blocking::delay::DelayUs;
use crate::adc::{AdcPin, Instance, Resolution, SampleTime};
use crate::adc::{Adc, AdcPin, Instance, Resolution, SampleTime};
use crate::Peripheral;
/// Default VREF voltage used for sample conversion to millivolts.
@ -60,11 +60,6 @@ impl<T: Instance> super::sealed::AdcPin<T> for Vbat {
}
}
pub struct Adc<'d, T: Instance> {
sample_time: SampleTime,
phantom: PhantomData<&'d mut T>,
}
impl<'d, T: Instance> Adc<'d, T> {
pub fn new(_peri: impl Peripheral<P = T> + 'd, delay: &mut impl DelayUs<u32>) -> Self {
into_ref!(_peri);