Struct CommonAdc

Source
pub struct CommonAdc<ADC> { /* private fields */ }
Expand description

The common ADC peripheral, which is shared between different concrete ADC peripheral.

For example CommonAdc<ADC1_2> shares control over pac::ADC1 and pac::ADC2.

This peripheral can control different parts, like enabling internal sensors (like temperature sensor) or enable dual channel mode (which is not supported yet.)

Implementations§

Source§

impl<ADC> CommonAdc<ADC>
where ADC: CommonInstance,

Source

pub fn new(common_adc: ADC, clocks: &Clocks, ahb: &mut AHB) -> Self

Create a CommonAdc instance, consuming the pac’s ADC (e.g. pac::ADC1_2.

Source

pub unsafe fn peripheral(&mut self) -> &mut ADC

Get access to the underlying register block.

§Safety

This function is not memory unsafe per se, but does not guarantee anything about assumptions of invariants made in this implementation.

Changing specific options can lead to un-expected behavior and nothing is guaranteed.

Source§

impl<ADC> CommonAdc<ADC>
where ADC: CommonInstance + Enable,

Source

pub fn free(self, _adcs: &<ADC as CommonInstance>::Childs) -> ADC

Releases the common ADC peripheral

Auto Trait Implementations§

§

impl<ADC> Freeze for CommonAdc<ADC>
where ADC: Freeze,

§

impl<ADC> RefUnwindSafe for CommonAdc<ADC>
where ADC: RefUnwindSafe,

§

impl<ADC> Send for CommonAdc<ADC>
where ADC: Send,

§

impl<ADC> Sync for CommonAdc<ADC>
where ADC: Sync,

§

impl<ADC> Unpin for CommonAdc<ADC>
where ADC: Unpin,

§

impl<ADC> UnwindSafe for CommonAdc<ADC>
where ADC: 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.