[][src]Struct stm32h7xx_hal::adc::Adc

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

Methods

impl Adc<ADC1, Disabled>[src]

pub fn adc1(adc: ADC1, delay: &mut Delay, ccdr: &mut Ccdr) -> Self[src]

Initialise ADC

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

pub fn power_up(&mut self, delay: &mut Delay)[src]

Disables Deeppowerdown-mode and enables voltage regulator

Note: After power-up, a [calibration]: #method.calibrate shall be run

pub fn power_down(&mut self)[src]

Enables Deeppowerdown-mode and disables voltage regulator

Note: This resets the [calibration]: #method.calibrate of the ADC

pub fn calibrate(&mut self)[src]

Calibrates the ADC in single channel mode

Note: The ADC must be disabled

pub fn enable(self) -> Adc<ADC1, Enabled>[src]

Enable ADC

impl Adc<ADC1, Enabled>[src]

pub fn disable(self) -> Adc<ADC1, Disabled>[src]

Disable ADC

impl<ED> Adc<ADC1, ED>[src]

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 get_sample_time(&self) -> AdcSampleTime[src]

Get ADC samping time

pub fn get_resolution(&self) -> Resolution[src]

Get ADC sampling resolution

pub fn get_lshift(&self) -> AdcLshift[src]

Get ADC lshift value

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

Set ADC sampling time

Options can be found in AdcSampleTime.

pub fn set_resolution(&mut self, res: Resolution)[src]

Set ADC sampling resolution

pub fn set_lshift(&mut self, lshift: AdcLshift)[src]

Set ADC lshift

LSHIFT[3:0] must be in range of 0..=15

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

Returns the largest possible sample value for the current settings

pub fn read_offset_calibration_value(&self) -> AdcCalOffset[src]

Returns the offset calibration value for single ended channel

pub fn read_linear_calibration_values(&mut self) -> AdcCalLinear[src]

Returns the linear calibration values stored in an array in the following order: LINCALRDYW1 -> result[0] ... LINCALRDYW6 -> result[5]

impl Adc<ADC2, Disabled>[src]

pub fn adc2(adc: ADC2, delay: &mut Delay, ccdr: &mut Ccdr) -> Self[src]

Initialise ADC

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

pub fn power_up(&mut self, delay: &mut Delay)[src]

Disables Deeppowerdown-mode and enables voltage regulator

Note: After power-up, a [calibration]: #method.calibrate shall be run

pub fn power_down(&mut self)[src]

Enables Deeppowerdown-mode and disables voltage regulator

Note: This resets the [calibration]: #method.calibrate of the ADC

pub fn calibrate(&mut self)[src]

Calibrates the ADC in single channel mode

Note: The ADC must be disabled

pub fn enable(self) -> Adc<ADC2, Enabled>[src]

Enable ADC

impl Adc<ADC2, Enabled>[src]

pub fn disable(self) -> Adc<ADC2, Disabled>[src]

Disable ADC

impl<ED> Adc<ADC2, ED>[src]

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 get_sample_time(&self) -> AdcSampleTime[src]

Get ADC samping time

pub fn get_resolution(&self) -> Resolution[src]

Get ADC sampling resolution

pub fn get_lshift(&self) -> AdcLshift[src]

Get ADC lshift value

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

Set ADC sampling time

Options can be found in AdcSampleTime.

pub fn set_resolution(&mut self, res: Resolution)[src]

Set ADC sampling resolution

pub fn set_lshift(&mut self, lshift: AdcLshift)[src]

Set ADC lshift

LSHIFT[3:0] must be in range of 0..=15

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

Returns the largest possible sample value for the current settings

pub fn read_offset_calibration_value(&self) -> AdcCalOffset[src]

Returns the offset calibration value for single ended channel

pub fn read_linear_calibration_values(&mut self) -> AdcCalLinear[src]

Returns the linear calibration values stored in an array in the following order: LINCALRDYW1 -> result[0] ... LINCALRDYW6 -> result[5]

impl Adc<ADC3, Disabled>[src]

pub fn adc3(adc: ADC3, delay: &mut Delay, ccdr: &mut Ccdr) -> Self[src]

Initialise ADC

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

pub fn power_up(&mut self, delay: &mut Delay)[src]

Disables Deeppowerdown-mode and enables voltage regulator

Note: After power-up, a [calibration]: #method.calibrate shall be run

pub fn power_down(&mut self)[src]

Enables Deeppowerdown-mode and disables voltage regulator

Note: This resets the [calibration]: #method.calibrate of the ADC

pub fn calibrate(&mut self)[src]

Calibrates the ADC in single channel mode

Note: The ADC must be disabled

pub fn enable(self) -> Adc<ADC3, Enabled>[src]

Enable ADC

impl Adc<ADC3, Enabled>[src]

pub fn disable(self) -> Adc<ADC3, Disabled>[src]

Disable ADC

impl<ED> Adc<ADC3, ED>[src]

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 get_sample_time(&self) -> AdcSampleTime[src]

Get ADC samping time

pub fn get_resolution(&self) -> Resolution[src]

Get ADC sampling resolution

pub fn get_lshift(&self) -> AdcLshift[src]

Get ADC lshift value

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

Set ADC sampling time

Options can be found in AdcSampleTime.

pub fn set_resolution(&mut self, res: Resolution)[src]

Set ADC sampling resolution

pub fn set_lshift(&mut self, lshift: AdcLshift)[src]

Set ADC lshift

LSHIFT[3:0] must be in range of 0..=15

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

Returns the largest possible sample value for the current settings

pub fn read_offset_calibration_value(&self) -> AdcCalOffset[src]

Returns the offset calibration value for single ended channel

pub fn read_linear_calibration_values(&mut self) -> AdcCalLinear[src]

Returns the linear calibration values stored in an array in the following order: LINCALRDYW1 -> result[0] ... LINCALRDYW6 -> result[5]

Trait Implementations

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

type Error = ()

Error type returned by ADC methods

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

type Error = ()

Error type returned by ADC methods

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

type Error = ()

Error type returned by ADC methods

Auto Trait Implementations

impl<ADC, ED> Unpin for Adc<ADC, ED> where
    ADC: Unpin,
    ED: Unpin

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

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

Blanket Implementations

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self