Struct esp_idf_svc::hal::adc::continuous::AdcDriver

source ·
pub struct AdcDriver<'d> { /* private fields */ }

Implementations§

source§

impl<'d> AdcDriver<'d>

source

pub fn new<A>( adc: impl Peripheral<P = A> + 'd, config: &Config, channels: impl AdcChannels<Adc = A> + 'd, ) -> Result<AdcDriver<'d>, EspError>
where A: Adc,

source

pub fn handle(&self) -> *mut adc_continuous_ctx_t

source

pub fn unit(&self) -> u32

source

pub fn start(&mut self) -> Result<(), EspError>

source

pub fn stop(&mut self) -> Result<(), EspError>

source

pub fn read( &mut self, buf: &mut [AdcMeasurement], timeout: u32, ) -> Result<usize, EspError>

source

pub fn read_bytes( &mut self, buf: &mut [u8], timeout: u32, ) -> Result<usize, EspError>

source

pub async fn read_async( &mut self, buf: &mut [AdcMeasurement], ) -> Result<usize, EspError>

source

pub async fn read_bytes_async( &mut self, buf: &mut [u8], ) -> Result<usize, EspError>

Trait Implementations§

source§

impl<'d> Drop for AdcDriver<'d>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'d> ErrorType for AdcDriver<'d>

§

type Error = EspIOError

Error type of all the IO operations on this type.
source§

impl<'d> Read for AdcDriver<'d>

source§

fn read( &mut self, buf: &mut [u8], ) -> Result<usize, <AdcDriver<'d> as ErrorType>::Error>

Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
source§

fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>

Read the exact number of bytes required to fill buf. Read more
source§

impl<'d> Read for AdcDriver<'d>

source§

async fn read( &mut self, buf: &mut [u8], ) -> Result<usize, <AdcDriver<'d> as ErrorType>::Error>

Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
source§

async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>

Read the exact number of bytes required to fill buf. Read more
source§

impl<'d> Send for AdcDriver<'d>

Auto Trait Implementations§

§

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

§

impl<'d> RefUnwindSafe for AdcDriver<'d>

§

impl<'d> !Sync for AdcDriver<'d>

§

impl<'d> Unpin for AdcDriver<'d>

§

impl<'d> UnwindSafe for AdcDriver<'d>

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.