AdcPin

Struct AdcPin 

Source
pub struct AdcPin<P>
where P: AnyPin,
{ /* private fields */ }
Expand description

A pin locked in use with the ADC.

Implementations§

Source§

impl<P> AdcPin<P>
where P: AnyPin,

Source

pub fn new(pin: P) -> Result<AdcPin<P>, InvalidPinError>

Captures the pin to be used with an ADC and disables its digital circuitry.

Source

pub fn release(self) -> P

Release the pin and restore its digital circuitry’s state.

Source

pub fn channel(&self) -> u8

Returns the ADC channel of this AdcPin.

Trait Implementations§

Source§

impl<P> AdcChannel for AdcPin<P>
where P: AnyPin,

Source§

fn channel(&self) -> u8

Get the channel id used to configure the ADC peripheral.
Source§

impl<F, M> Channel<Adc> for AdcPin<Pin<DynPinId, F, M>>

Source§

type ID = ()

Channel ID type Read more
Source§

fn channel()

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
Source§

impl<F, M> Channel<Adc> for AdcPin<Pin<Gpio26, F, M>>

Source§

type ID = u8

Channel ID type Read more
Source§

fn channel() -> u8

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
Source§

impl<F, M> Channel<Adc> for AdcPin<Pin<Gpio27, F, M>>

Source§

type ID = u8

Channel ID type Read more
Source§

fn channel() -> u8

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
Source§

impl<F, M> Channel<Adc> for AdcPin<Pin<Gpio28, F, M>>

Source§

type ID = u8

Channel ID type Read more
Source§

fn channel() -> u8

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
Source§

impl<F, M> Channel<Adc> for AdcPin<Pin<Gpio29, F, M>>

Source§

type ID = u8

Channel ID type Read more
Source§

fn channel() -> u8

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
Source§

impl<WORD, F, M> OneShot<Adc, WORD, AdcPin<Pin<DynPinId, F, M>>> for Adc
where WORD: From<u16>, F: Function, M: PullType, DynPinId: ValidFunction<F>, AdcPin<Pin<DynPinId, F, M>>: Channel<Adc, ID = ()>,

Source§

type Error = Infallible

Error type returned by ADC methods
Source§

fn read( &mut self, pin: &mut AdcPin<Pin<DynPinId, F, M>>, ) -> Result<WORD, Error<<Adc as OneShot<Adc, WORD, AdcPin<Pin<DynPinId, F, M>>>>::Error>>

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

Auto Trait Implementations§

§

impl<P> Freeze for AdcPin<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for AdcPin<P>
where P: RefUnwindSafe,

§

impl<P> Send for AdcPin<P>
where P: Send,

§

impl<P> Sync for AdcPin<P>
where P: Sync,

§

impl<P> Unpin for AdcPin<P>
where P: Unpin,

§

impl<P> UnwindSafe for AdcPin<P>
where P: 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<Choices> CoproductSubsetter<CNil, HNil> for Choices

Source§

type Remainder = Choices

Source§

fn subset( self, ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Is for T
where T: Sealed + Borrow<T> + BorrowMut<T>,

Source§

type Type = T

Source§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

Source§

fn lift_into(self) -> U

Performs the indexed conversion.
Source§

impl<Source> Sculptor<HNil, HNil> for Source

Source§

type Remainder = Source

Source§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
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.