[][src]Struct stm32f1xx_hal::adc::Adc

pub struct Adc<ADC> { /* fields omitted */ }

ADC configuration

Methods

impl Adc<ADC1>[src]

pub fn adc1(adc: ADC1, apb2: &mut APB2) -> Self[src]

Init a new Adc

Sets all configurable parameters to one-shot defaults, performs a boot-time calibration.

pub fn save_cfg(&mut self) -> StoredConfig[src]

Save current ADC config

pub fn restore_cfg(&mut self, cfg: StoredConfig)[src]

Restore saved ADC config

pub fn default_cfg(&mut self) -> StoredConfig[src]

Reset the ADC config to default, return existing config

pub fn set_sample_time(&mut self, t_samp: AdcSampleTime)[src]

Set ADC sampling time

Options can be found in AdcSampleTime.

pub fn set_align(&mut self, align: AdcAlign)[src]

Set the Adc result alignment

Options can be found in AdcAlign.

pub fn max_sample(&self) -> u16[src]

Returns the largest possible sample value for the current settings

impl Adc<ADC2>[src]

pub fn adc2(adc: ADC2, apb2: &mut APB2) -> Self[src]

Init a new Adc

Sets all configurable parameters to one-shot defaults, performs a boot-time calibration.

pub fn save_cfg(&mut self) -> StoredConfig[src]

Save current ADC config

pub fn restore_cfg(&mut self, cfg: StoredConfig)[src]

Restore saved ADC config

pub fn default_cfg(&mut self) -> StoredConfig[src]

Reset the ADC config to default, return existing config

pub fn set_sample_time(&mut self, t_samp: AdcSampleTime)[src]

Set ADC sampling time

Options can be found in AdcSampleTime.

pub fn set_align(&mut self, align: AdcAlign)[src]

Set the Adc result alignment

Options can be found in AdcAlign.

pub fn max_sample(&self) -> u16[src]

Returns the largest possible sample value for the current settings

Trait Implementations

impl<WORD, PIN> OneShot<ADC1, WORD, PIN> for Adc<ADC1> where
    WORD: From<u16>,
    PIN: Channel<ADC1, ID = u8>, 
[src]

type Error = ()

Error type returned by ADC methods

impl<WORD, PIN> OneShot<ADC2, WORD, PIN> for Adc<ADC2> where
    WORD: From<u16>,
    PIN: Channel<ADC2, ID = u8>, 
[src]

type Error = ()

Error type returned by ADC methods

Auto Trait Implementations

impl<ADC> Send for Adc<ADC> where
    ADC: Send

impl<ADC> Sync for Adc<ADC> where
    ADC: Sync

Blanket Implementations

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> From for T[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self