Skip to main content

esp_hal/analog/adc/calibration/line/
mod.rs

1#[cfg_attr(esp32, path = "esp32.rs")]
2#[cfg_attr(esp32s2, path = "s2.rs")]
3#[cfg_attr(not(any(esp32, esp32s2)), path = "one_point.rs")]
4mod line_impl;
5pub use line_impl::AdcCalLine;
6
7/// Marker trait for ADC units which support line fitting.
8pub trait AdcHasLineCal: crate::private::Sealed {
9    /// ADC unit index used by the eFuse calibration tables (0 = ADC1, 1 = ADC2).
10    const UNIT: u8;
11}
12
13#[cfg(soc_has_adc1)]
14impl AdcHasLineCal for crate::peripherals::ADC1<'_> {
15    const UNIT: u8 = 0;
16}
17
18#[cfg(soc_has_adc2)]
19impl AdcHasLineCal for crate::peripherals::ADC2<'_> {
20    const UNIT: u8 = 1;
21}