Skip to main content

AdcDriver

Struct AdcDriver 

Source
pub struct AdcDriver<'d, U> { /* private fields */ }

Implementations§

Source§

impl<'d, U> AdcDriver<'d, U>
where U: AdcUnit + 'd,

Source

pub fn new<ADC: Adc<AdcUnit = U> + 'd>(_adc: ADC) -> Result<Self, EspError>

Source

pub fn read<C, M>( &self, channel: &mut AdcChannelDriver<'d, C, M>, ) -> Result<u16, EspError>
where C: AdcChannel<AdcUnit = U>, M: Borrow<AdcDriver<'d, U>>,

Source

pub fn read_raw<C, M>( &self, _channel: &mut AdcChannelDriver<'d, C, M>, ) -> Result<u16, EspError>
where C: AdcChannel<AdcUnit = U>, M: Borrow<AdcDriver<'d, U>>,

Source

pub fn raw_to_mv<C, M>( &self, channel: &AdcChannelDriver<'d, C, M>, raw: u16, ) -> Result<u16, EspError>
where C: AdcChannel<AdcUnit = U>, M: Borrow<AdcDriver<'d, U>>,

Trait Implementations§

Source§

impl<U> Drop for AdcDriver<'_, U>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'d, C, M> OneShot<<C as AdcChannel>::AdcUnit, u16, AdcChannelDriver<'d, C, M>> for AdcDriver<'d, C::AdcUnit>
where C: AdcChannel, M: Borrow<AdcDriver<'d, C::AdcUnit>>,

Source§

type Error = EspError

Error type returned by ADC methods
Source§

fn read( &mut self, pin: &mut AdcChannelDriver<'d, C, M>, ) -> Result<u16, Self::Error>

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

impl<U: AdcUnit> Send for AdcDriver<'_, U>

Source§

impl<U: AdcUnit> Sync for AdcDriver<'_, U>

Auto Trait Implementations§

§

impl<'d, U> Freeze for AdcDriver<'d, U>

§

impl<'d, U> RefUnwindSafe for AdcDriver<'d, U>
where U: RefUnwindSafe,

§

impl<'d, U> Unpin for AdcDriver<'d, U>
where U: Unpin,

§

impl<'d, U> UnsafeUnpin for AdcDriver<'d, U>

§

impl<'d, U> !UnwindSafe for AdcDriver<'d, U>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where 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>

Performs the conversion.