remove unnecessary mod
This commit is contained in:
parent
e4f240823d
commit
6f0488cbe7
@ -71,12 +71,11 @@ impl<T: Instance> super::sealed::AdcPin<T> for Vbat {
|
||||
}
|
||||
}
|
||||
|
||||
mod sample_time {
|
||||
/// ADC sample time
|
||||
///
|
||||
/// The default setting is 3 ADC clock cycles.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)]
|
||||
pub enum SampleTime {
|
||||
/// ADC sample time
|
||||
///
|
||||
/// The default setting is 3 ADC clock cycles.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)]
|
||||
pub enum SampleTime {
|
||||
Cycles3 = 0b000,
|
||||
Cycles15 = 0b001,
|
||||
Cycles28 = 0b010,
|
||||
@ -85,9 +84,9 @@ mod sample_time {
|
||||
Cycles112 = 0b101,
|
||||
Cycles144 = 0b110,
|
||||
Cycles480 = 0b111,
|
||||
}
|
||||
}
|
||||
|
||||
impl SampleTime {
|
||||
impl SampleTime {
|
||||
pub(crate) fn sample_time(&self) -> crate::pac::adc::vals::Smp {
|
||||
match self {
|
||||
SampleTime::Cycles3 => crate::pac::adc::vals::Smp::CYCLES3,
|
||||
@ -100,17 +99,14 @@ mod sample_time {
|
||||
SampleTime::Cycles480 => crate::pac::adc::vals::Smp::CYCLES480,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for SampleTime {
|
||||
impl Default for SampleTime {
|
||||
fn default() -> Self {
|
||||
Self::Cycles3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub use sample_time::SampleTime;
|
||||
|
||||
pub struct Adc<'d, T: Instance> {
|
||||
sample_time: SampleTime,
|
||||
calibrated_vdda: u32,
|
||||
|
Loading…
Reference in New Issue
Block a user