pub struct Adc<I: AdcInstance> { /* private fields */ }
Expand description
ADC Instance
Implementations§
Source§impl<I: AdcInstance + PrimaryAdc> Adc<I>
impl<I: AdcInstance + PrimaryAdc> Adc<I>
Sourcepub fn read_cpu_temperature(&mut self, sysctrl: &mut Sysctrl) -> f32
pub fn read_cpu_temperature(&mut self, sysctrl: &mut Sysctrl) -> f32
Returns the CPU temperature in degrees C
NOTE: The temperature sensor is known to be out by up to ±10C, it therefore should not be relied on for critical temperature readings
pub fn read_cpu_voltage(&mut self, src: CpuVoltageSource) -> u16
Source§impl<I: AdcInstance> Adc<I>
impl<I: AdcInstance> Adc<I>
Sourcepub fn into_future<F>(self, irqs: F) -> FutureAdc<I, F>
pub fn into_future<F>(self, irqs: F) -> FutureAdc<I, F>
Switch the [‘Adc’] to [‘FutureAdc’], allowing for the use of async
reading methods. You are required to provide the struct created by
the bind_interrupts
macro to prove
that the interrupt sources have been correctly configured. This function
will automatically enable the relevant NVIC interrupt sources. However,
you are required to configure the desired interrupt priorities prior to
calling this method. Consult crate::async_hal::interrupts
module-level documentation for more information.
bind_interrupts
.
Source§impl<I: AdcInstance> Adc<I>
impl<I: AdcInstance> Adc<I>
Sourcepub fn read<P: AdcPin<I>>(&mut self, _pin: &mut P) -> u16
pub fn read<P: AdcPin<I>>(&mut self, _pin: &mut P) -> u16
Read a single value from the provided ADC pin.
pub fn check_read_discard(&mut self)
Auto Trait Implementations§
impl<I> Freeze for Adc<I>
impl<I> RefUnwindSafe for Adc<I>
impl<I> Send for Adc<I>
impl<I> Sync for Adc<I>
impl<I> Unpin for Adc<I>
impl<I> UnwindSafe for Adc<I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more