Skip to main content

AdcConfiguration

Struct AdcConfiguration 

Source
pub struct AdcConfiguration { /* private fields */ }
Expand description

ADC configuration

Implementations§

Source§

impl AdcConfiguration

Source

pub fn conversion_trigger( &mut self, conversion_trigger: ConversionTrigger, ) -> &mut Self

Set the conversion trigger. Panics if the a a value outside 1…, 31 is indicated for auto conversion

Source

pub fn auto_sample(&mut self, auto_sample: bool) -> &mut Self

Activate or deactivate automatic sampling

Source

pub fn voltage_reference( &mut self, voltage_reference: VoltageReference, ) -> &mut Self

Configure the voltage reference sources

Source

pub fn offset_calibration(&mut self, offset_calibration: bool) -> &mut Self

Activate or deactivate the offset calibration mode

Source

pub fn conversions_per_irq(&mut self, conversions_per_irq: u8) -> &mut Self

Set the number of conversions per IRQ. The value must be between 1 and 16; otherwise, this method will panic.

Source

pub fn alt_sample_mode(&mut self, alt_sample_mode: bool) -> &mut Self

Activate or deactivate the Alternate Sample Mode

Source

pub fn result_buffer_mode( &mut self, result_buffer_mode: ResultBufferMode, ) -> &mut Self

Set result buffer mode

Source

pub fn conversion_clock( &mut self, conversion_clock: ConversionClock, ) -> &mut Self

Set the conversion clock

Trait Implementations§

Source§

impl Default for AdcConfiguration

Source§

fn default() -> Self

Create a configuration for manually sampling a single channel

Auto Trait Implementations§

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.