Struct atsamd_hal::adc::Adc
source · [−]pub struct Adc<ADC> { /* private fields */ }
Expand description
Adc
encapsulates the device ADC
Implementations
sourceimpl Adc<ADC>
impl Adc<ADC>
sourcepub fn adc(adc: ADC, pm: &mut PM, clocks: &mut GenericClockController) -> Self
pub fn adc(adc: ADC, pm: &mut PM, clocks: &mut GenericClockController) -> Self
Create a new Adc
instance. The default configuration is:
- 1/32 prescaler
- 12 bit resolution
- 1 sample
- 1/2 gain
- 1/2 VDDANA reference voltage
sourcepub fn samples(&mut self, samples: SampleRate)
pub fn samples(&mut self, samples: SampleRate)
Set the sample rate
sourcepub fn prescaler(&mut self, prescaler: Prescaler)
pub fn prescaler(&mut self, prescaler: Prescaler)
Set the prescaler for adjusting the clock relative to the system clock
sourcepub fn resolution(&mut self, resolution: Resolution)
pub fn resolution(&mut self, resolution: Resolution)
Set the input resolution.
Trait Implementations
Auto Trait Implementations
impl<ADC> RefUnwindSafe for Adc<ADC>where
ADC: RefUnwindSafe,
impl<ADC> Send for Adc<ADC>where
ADC: Send,
impl<ADC> Sync for Adc<ADC>where
ADC: Sync,
impl<ADC> Unpin for Adc<ADC>where
ADC: Unpin,
impl<ADC> UnwindSafe for Adc<ADC>where
ADC: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more