pub trait AdcCalScheme<ADCX>: Sized + Sealed {
// Required method
fn new_cal(atten: Attenuation) -> Self;
// Provided methods
fn new_cal_with_channel(atten: Attenuation, _channel: u8) -> Self { ... }
fn adc_cal(&self) -> u16 { ... }
fn adc_val(&self, val: u16) -> u16 { ... }
}Expand description
A trait abstracting over calibration methods.
The methods in this trait are mostly for internal use. Call
enable_pin_with_cal with an implementor of this trait to get calibrated
ADC reads.
Required Methods§
Sourcefn new_cal(atten: Attenuation) -> Self
fn new_cal(atten: Attenuation) -> Self
Creates a new calibration scheme for the given attenuation.
Provided Methods§
Sourcefn new_cal_with_channel(atten: Attenuation, _channel: u8) -> Self
fn new_cal_with_channel(atten: Attenuation, _channel: u8) -> Self
Creates a new calibration scheme for the given attenuation and ADC channel.
The default implementation ignores channel and calls Self::new_cal.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<ADCX> AdcCalScheme<ADCX> for ()
Available on crate feature unstable only.
impl<ADCX> AdcCalScheme<ADCX> for ()
Available on crate feature
unstable only.fn new_cal(_atten: Attenuation) -> Self
Implementors§
impl<ADCX> AdcCalScheme<ADCX> for AdcCalLine<ADCX>where
ADCX: AdcHasLineCal,
Available on crate feature
unstable only.