Adc

Struct Adc 

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

Generic ADC wrapper over a PAC ADCx peripheral.

Implementations§

Source§

impl<ADC> Adc<ADC>

Source

pub fn free(self) -> ADC

Source§

impl Adc<ADC1>

Source

pub fn adc1(adc1: ADC1) -> Self

Create and initialize ADC1.

Source§

impl Adc<ADC2>

Source

pub fn adc2(adc2: ADC2) -> Self

Create and initialize ADC2.

Source§

impl Adc<ADC3>

Source

pub fn adc3(adc3: ADC3) -> Self

Create and initialize ADC3.

Source§

impl Adc<ADC1>

Source

pub fn read(&self, channel: u8) -> u16

Read a single channel.

Source§

impl Adc<ADC2>

Source

pub fn read(&self, channel: u8) -> u16

Read a single channel.

Source§

impl Adc<ADC3>

Source

pub fn read(&self, channel: u8) -> u16

Read a single channel.

Source§

impl<ADC> Adc<ADC>
where Adc<ADC>: AdcRead,

Source

pub fn make_reader<'a>( adc_ref: &'a RefCell<Self>, channel: u8, ) -> impl FnMut() -> u16 + 'a

Create a closure that reads the given channel from the ADC reference.

Trait Implementations§

Source§

impl AdcRead for Adc<ADC1>

Source§

fn read_channel(&mut self, ch: u8) -> u16

Source§

impl AdcRead for Adc<ADC2>

Source§

fn read_channel(&mut self, ch: u8) -> u16

Source§

impl AdcRead for Adc<ADC3>

Source§

fn read_channel(&mut self, ch: u8) -> u16

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, 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.