pub struct Adc<ADC> { /* private fields */ }
Expand description
Adc
encapsulates the device ADC
Implementations§
Source§impl 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> Freeze for Adc<ADC>where
ADC: Freeze,
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§
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