[][src]Struct nucleo_f042k6::adc::Adc

pub struct Adc { /* fields omitted */ }

Analog to Digital converter interface

Methods

impl Adc
[src]

pub fn new(adc: ADC, rcc: &mut Rcc) -> Adc
[src]

Init a new Adc

Sets all configurable parameters to defaults, enables the HSI14 clock for the ADC if it is not already enabled and performs a boot time calibration. As such this method may take an appreciable time to run.

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

Saves a copy of the current ADC config

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

Restores a stored config

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

Resets the ADC config to default, returning the existing config as a stored config.

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

Set the 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 set_precision(&mut self, precision: AdcPrecision)
[src]

Set the Adc precision

Options can be found in AdcPrecision.

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

Returns the largest possible sample value for the current settings

pub fn read_abs_mv<PIN>(&mut self, pin: &mut PIN) -> u16 where
    PIN: Channel<Adc, ID = u8>, 
[src]

Read the value of a channel and converts the result to milli-volts

Trait Implementations

impl Channel<Adc> for PA6<Analog>
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for VTemp
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for PB0<Analog>
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for VBat
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for PA7<Analog>
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for PA4<Analog>
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for VRef
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for PA1<Analog>
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for PA2<Analog>
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for PB1<Analog>
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for PA0<Analog>
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for PA5<Analog>
[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc> for PA3<Analog>
[src]

type ID = u8

Channel ID type Read more

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

type Error = ()

Error type returned by ADC methods

Auto Trait Implementations

impl Send for Adc

impl !Sync for Adc

Blanket Implementations

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

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

🔬 This is a nightly-only experimental API. (try_from)

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]