Adc

Struct Adc 

Source
pub struct Adc<ADC> {
    pub rb: ADC,
    /* private fields */
}
Expand description

Analog Digital Converter Peripheral

Fields§

§rb: ADC

ADC Register

Implementations§

Source§

impl Adc<ADC1>

Source

pub fn adc1( rb: ADC1, adc_common: &mut ADC1_2, ahb: &mut AHB, ckmode: CkMode, clocks: Clocks, ) -> Self

Init a new ADC

Enables the clock, performs a calibration and enables the ADC

§Panics

If one of the following occurs:

  • the clocksetting is not well defined.
  • the clock was already enabled with a different setting
Source

pub fn setup_oneshot(&mut self)

sets up adc in one shot mode for a single channel

Source§

impl Adc<ADC2>

Source

pub fn adc2( rb: ADC2, adc_common: &mut ADC1_2, ahb: &mut AHB, ckmode: CkMode, clocks: Clocks, ) -> Self

Init a new ADC

Enables the clock, performs a calibration and enables the ADC

§Panics

If one of the following occurs:

  • the clocksetting is not well defined.
  • the clock was already enabled with a different setting
Source

pub fn setup_oneshot(&mut self)

sets up adc in one shot mode for a single channel

Source§

impl Adc<ADC3>

Source

pub fn adc3( rb: ADC3, adc_common: &mut ADC3_4, ahb: &mut AHB, ckmode: CkMode, clocks: Clocks, ) -> Self

Init a new ADC

Enables the clock, performs a calibration and enables the ADC

§Panics

If one of the following occurs:

  • the clocksetting is not well defined.
  • the clock was already enabled with a different setting
Source

pub fn setup_oneshot(&mut self)

sets up adc in one shot mode for a single channel

Source§

impl Adc<ADC4>

Source

pub fn adc4( rb: ADC4, adc_common: &mut ADC3_4, ahb: &mut AHB, ckmode: CkMode, clocks: Clocks, ) -> Self

Init a new ADC

Enables the clock, performs a calibration and enables the ADC

§Panics

If one of the following occurs:

  • the clocksetting is not well defined.
  • the clock was already enabled with a different setting
Source

pub fn setup_oneshot(&mut self)

sets up adc in one shot mode for a single channel

Trait Implementations§

Source§

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

Source§

type Error = ()

Error type returned by ADC methods
Source§

fn read(&mut self, _pin: &mut PIN) -> Result<WORD, Self::Error>

Request that the ADC begin a conversion on the specified pin Read more
Source§

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

Source§

type Error = ()

Error type returned by ADC methods
Source§

fn read(&mut self, _pin: &mut PIN) -> Result<WORD, Self::Error>

Request that the ADC begin a conversion on the specified pin Read more
Source§

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

Source§

type Error = ()

Error type returned by ADC methods
Source§

fn read(&mut self, _pin: &mut PIN) -> Result<WORD, Self::Error>

Request that the ADC begin a conversion on the specified pin Read more
Source§

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

Source§

type Error = ()

Error type returned by ADC methods
Source§

fn read(&mut self, _pin: &mut PIN) -> Result<WORD, Self::Error>

Request that the ADC begin a conversion on the specified pin Read more

Auto Trait Implementations§

§

impl<ADC> Freeze for Adc<ADC>
where ADC: Freeze,

§

impl<ADC> RefUnwindSafe for Adc<ADC>
where ADC: RefUnwindSafe,

§

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

§

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

§

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

§

impl<ADC> UnwindSafe for Adc<ADC>
where ADC: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.