Struct stm32g0xx_hal::analog::adc::Adc [−][src]
Analog to Digital converter interface
Implementations
impl Adc
[src]
pub fn new(adc: ADC, rcc: &mut Rcc) -> Self
[src]
pub fn set_clock_source(&mut self, clock_source: ClockSource)
[src]
pub fn calibrate(&mut self)
[src]
Runs the calibration routine on the ADC
Wait for tADCVREG_SETUP (20us on STM32G071x8) after calling Self::new()
before calibrating, to wait for the
ADC voltage regulator to stabilize.
Do not call if an ADC reading is ongoing.
pub fn get_calibration(&self) -> CalibrationFactor
[src]
Returns the calibration factors used by the ADC
The ADC does not have a factory-stored calibration, Self::calibrate()
must be run before calling this
for the returned value to be useful.
The ADC loses its calibration factors when Standby or Vbat mode is entered. Saving and restoring the calibration factors can be used to recalibrate the ADC after waking up from sleep more quickly than re-running calibraiton. Note that VDDA changes and to a lesser extent temperature changes affect the ADC operating conditions and calibration should be run again for the best accuracy.
pub fn set_calibration(&mut self, calfact: CalibrationFactor)
[src]
Writes the calibration factors used by the ADC
Do not call if an ADC reading is ongoing.
pub fn set_sample_time(&mut self, t_samp: SampleTime)
[src]
Set the Adc sampling time
pub fn set_align(&mut self, align: Align)
[src]
Set the Adc result alignment
pub fn set_precision(&mut self, precision: Precision)
[src]
Set the Adc precision
pub fn release(self) -> ADC
[src]
Trait Implementations
impl Channel<Adc> for VTemp
[src]
impl Channel<Adc> for VRef
[src]
impl Channel<Adc> for PA7<Analog>
[src]
impl Channel<Adc> for PB0<Analog>
[src]
impl Channel<Adc> for PB1<Analog>
[src]
impl Channel<Adc> for PB2<Analog>
[src]
impl Channel<Adc> for PB10<Analog>
[src]
impl Channel<Adc> for PB11<Analog>
[src]
impl Channel<Adc> for PB12<Analog>
[src]
impl Channel<Adc> for PC4<Analog>
[src]
impl Channel<Adc> for PC5<Analog>
[src]
impl Channel<Adc> for VBat
[src]
impl Channel<Adc> for PA0<Analog>
[src]
impl Channel<Adc> for PA1<Analog>
[src]
impl Channel<Adc> for PA2<Analog>
[src]
impl Channel<Adc> for PA3<Analog>
[src]
impl Channel<Adc> for PA4<Analog>
[src]
impl Channel<Adc> for PA5<Analog>
[src]
impl Channel<Adc> for PA6<Analog>
[src]
impl<WORD, PIN> OneShot<Adc, WORD, PIN> for Adc where
WORD: From<u16>,
PIN: Channel<Adc, ID = u8>,
[src]
WORD: From<u16>,
PIN: Channel<Adc, ID = u8>,
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,