Struct VoltageInternalReference

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

Internal voltage reference, which is also used for calibration.

Implementations§

Source§

impl<Common> VoltageInternalReference<Common>
where Common: CommonInstance,

Source

pub fn new( common_adc: &mut CommonAdc<Common>, _adcs: &mut <Common as CommonInstance>::Childs, ) -> Self

Creating a type associated with the special ADC sensor, which implements the embedded_hal::adc::Channel trait.

§Example

Imagine you’d like to measure the core temperature via ADC1.

In that case this function takes both the common ADC, e.g. pac::ADC1_2, as well as both associated ADCs, e.g. pac::ADC1 & pac::ADC2 to ensure, that these ADCs are still disabled, because the internal ADC sensor can only be enabled, if these ADCs are disabled, see RM0316 15.6.2.

Code example can be seen in examples/adc.rs.

Trait Implementations§

Source§

impl Channel<ADC1> for VoltageInternalReference<<ADC1 as Instance>::SharedInstance>

Source§

type ID = Id

Channel ID type Read more
Source§

fn channel() -> Self::ID

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
Source§

impl Channel<ADC2> for VoltageInternalReference<<ADC2 as Instance>::SharedInstance>

Source§

type ID = Id

Channel ID type Read more
Source§

fn channel() -> Self::ID

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
Source§

impl Channel<ADC3> for VoltageInternalReference<<ADC3 as Instance>::SharedInstance>

Source§

type ID = Id

Channel ID type Read more
Source§

fn channel() -> Self::ID

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
Source§

impl Channel<ADC4> for VoltageInternalReference<<ADC4 as Instance>::SharedInstance>

Source§

type ID = Id

Channel ID type Read more
Source§

fn channel() -> Self::ID

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
Source§

impl<ADC: Debug> Debug for VoltageInternalReference<ADC>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<ADC> Freeze for VoltageInternalReference<ADC>

§

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

§

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

§

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

§

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

§

impl<ADC> UnwindSafe for VoltageInternalReference<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.