Skip to main content

Adc

Struct Adc 

Source
pub struct Adc<F> { /* private fields */ }

Implementations§

Source§

impl Adc<Unsigned32>

Source

pub fn new_u32(adc: ADC, fractional: bool) -> Self

Create an Adc instance (unsigned 32-bit data format). fractional == true selects a fractional number format.

Source

pub fn read(&self, index: usize) -> u32

Read from the ADC buffer. index must be less than or equal to 15.

Source§

impl Adc<Signed32>

Source

pub fn new_i32(adc: ADC, fractional: bool) -> Self

Create an Adc instance (signed 32-bit data format). fractional == true selects a fractional number format.

Source

pub fn read(&self, index: usize) -> i32

Read from the ADC buffer. index must be less than or equal to 15.

Source§

impl Adc<Unsigned16>

Source

pub fn new_u16(adc: ADC, fractional: bool) -> Self

Create an Adc instance (unsigned 16-bit data format). fractional == true selects a fractional number format.

Source

pub fn read(&self, index: usize) -> u16

Read from the ADC buffer. index must be less than or equal to 15.

Source§

impl Adc<Signed16>

Source

pub fn new_i16(adc: ADC, fractional: bool) -> Self

Create an Adc instance (signed 16-bit data format). fractional == true selects a fractional number format.

Source

pub fn read(&self, index: usize) -> i16

Read from the ADC buffer. index must be less than or equal to 15.

Source§

impl<F> Adc<F>

Source

pub fn configure(&mut self, config: &AdcConfiguration)

configure and activate the ADC

Source

pub fn select_pos_input(&mut self, input: InputScan)

Select positive input for sample A

Source

pub fn select_neg_input(&mut self, input: NegativeInput)

Select negative input for sample A

Source

pub fn select_pos_alt_input(&mut self, input: u8)

Select positive input for sample B (alternate sample)

Source

pub fn select_neg_alt_input(&mut self, input: NegativeInput)

Select negative input for sample B (alternate sample)

Source

pub fn start_sampling(&mut self)

Manually start a sampling period. Use only when auto_sample is not active.

Source

pub fn start_conversion(&mut self)

Manually start a conversion period. Use only when the ConversionTrigger is Manual.

Source

pub fn done(&self) -> bool

Check if conversion is complete. To be used when sampling is stated manually.

Source

pub fn free(self) -> ADC

return the ADC consuming the Adc instance

Auto Trait Implementations§

§

impl<F> !Sync for Adc<F>

§

impl<F> Freeze for Adc<F>

§

impl<F> RefUnwindSafe for Adc<F>
where F: RefUnwindSafe,

§

impl<F> Send for Adc<F>
where F: Send,

§

impl<F> Unpin for Adc<F>
where F: Unpin,

§

impl<F> UnsafeUnpin for Adc<F>

§

impl<F> UnwindSafe for Adc<F>
where F: 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.