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, supc: &mut Supc) -> f32
pub fn read_cpu_temperature(&mut self, supc: &mut Supc) -> f32
Reads the CPU temperature in degrees C.
n.b. Microchip’s errata document for SAM D5x/E5x states:
Both internal temperature sensors, TSENSP and TSENSC, are not supported and should not be used.
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.