[−][src]Struct stm32f1xx_hal::adc::Adc
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]
WORD: From<u16>,
PIN: Channel<ADC1, ID = u8>,
type Error = ()
Error type returned by ADC methods
fn read(&mut self, _pin: &mut PIN) -> Result<WORD, Self::Error>
[src]
impl<WORD, PIN> OneShot<ADC2, WORD, PIN> for Adc<ADC2> where
WORD: From<u16>,
PIN: Channel<ADC2, ID = u8>,
[src]
WORD: From<u16>,
PIN: Channel<ADC2, ID = u8>,
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self