Struct RegisterBlock

Source
#[repr(C)]
pub struct RegisterBlock {
Show 20 fields pub sr: u32, pub cr1: u32, pub cr2: u32, pub smpr1: u32, pub smpr2: u32, pub jofr1: u32, pub jofr2: u32, pub jofr3: u32, pub jofr4: u32, pub htr: u32, pub ltr: u32, pub sqr1: u32, pub sqr2: u32, pub sqr3: u32, pub jsqr: u32, pub jdr1: u32, pub jdr2: u32, pub jdr3: u32, pub jdr4: u32, pub dr: u32,
}

Fields§

§sr: u32§cr1: u32§cr2: u32§smpr1: u32§smpr2: u32§jofr1: u32§jofr2: u32§jofr3: u32§jofr4: u32§htr: u32§ltr: u32§sqr1: u32§sqr2: u32§sqr3: u32§jsqr: u32§jdr1: u32§jdr2: u32§jdr3: u32§jdr4: u32§dr: u32

Implementations§

Source§

impl RegisterBlock

Source

pub fn enable(&mut self)

Enable ADC

Source

pub fn disable(&mut self)

Disable ADC

Source

pub fn set_resolution(&mut self, resolution: AdcResolution)

Set ADC resolution

Source

pub fn enable_continuous(&mut self)

Enable continuous conversion mode

Source

pub fn disable_continuous(&mut self)

Disable continuous conversion mode

Source

pub fn start_conversion(&mut self)

Start software conversion

Source

pub fn is_conversion_complete(&self) -> bool

Check if conversion is complete

Source

pub fn clear_eoc_flag(&mut self)

Clear end of conversion flag

Source

pub fn read_data(&self) -> u16

Read conversion result

Source

pub fn set_sample_time_low(&mut self, channel: u8, sample_time: AdcSampleTime)

Set sample time for channel (0-9)

Source

pub fn set_sample_time_high(&mut self, channel: u8, sample_time: AdcSampleTime)

Set sample time for channel (10-18)

Source

pub fn set_regular_sequence_1(&mut self, channel: u8)

Set first regular sequence channel

Source

pub fn set_regular_sequence_length(&mut self, length: u8)

Set regular sequence length

Source

pub fn single_conversion(&mut self, channel: u8) -> u16

Perform single conversion on a 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.