AdcBuffered

Struct AdcBuffered 

Source
pub struct AdcBuffered<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> AdcBuffered<'a>

Creates a new instance of AdcBuffered with the specified channel and optional configuration flags.

§Arguments

  • ch - The ADC channel to initialize.
  • data - A reference to the ADC channel data.
  • flags - Optional configuration flags for the ADC initialization.

§Returns

A new AdcBuffered instance ready for buffered conversion operations.

Source

pub fn new(ch: AdcChannel, data: &'a AdcChData, flags: Option<u32>) -> Self

Source

pub fn set_buf(&self, buffer: &mut [u16])

Sets the buffer for storing conversion results.

§Arguments
  • buffer - The mutable buffer to be used for storing conversion results.
Source

pub fn start(&self)

Starts the ADC conversion process.

Source

pub fn stop(&self)

Stops the ADC conversion process.

Source

pub fn read(&self) -> Option<AdcDataType>

Reads a single conversion result from the ADC data buffer.

§Returns

An Option<AdcDataType> containing the conversion result if available, or None otherwise.

Source

pub fn read_multiple(&self, buf: &mut [AdcDataType]) -> usize

Reads multiple conversion results from the ADC data buffer into the provided buffer.

§Arguments
  • buf - The buffer to store the conversion results.
§Returns

The number of conversion results read.

Trait Implementations§

Source§

impl<'a> Drop for AdcBuffered<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for AdcBuffered<'a>

§

impl<'a> RefUnwindSafe for AdcBuffered<'a>

§

impl<'a> Send for AdcBuffered<'a>

§

impl<'a> Sync for AdcBuffered<'a>

§

impl<'a> Unpin for AdcBuffered<'a>

§

impl<'a> UnwindSafe for AdcBuffered<'a>

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.