pub enum Accumulation {
Single(AdcResolution),
Average(SampleCount),
Summed(SampleCount),
}
Expand description
Result accumulation strategy for the ADC
Variants§
Single(AdcResolution)
The ADC will read once and then the result is ready.
The result will be in the users chosen bitwidth
Average(SampleCount)
The ADC will read SampleCount samples, average them out and then the result is ready.
The result will be in the range of 0-4095 (12bit)
Summed(SampleCount)
The ADC will read SampleCount samples, sum them into a 16 bit wide value, and then the result is ready.
The result will be in the range of 0-65535 (16bit), but will consist of the sum of multiple 12bit reads
Implementations§
Source§impl Accumulation
impl Accumulation
Sourcepub const fn single(res: AdcResolution) -> Self
pub const fn single(res: AdcResolution) -> Self
Read the ADC once
Sourcepub const fn average(count: SampleCount) -> Self
pub const fn average(count: SampleCount) -> Self
Accumulate multiple samples and average together
Sourcepub const fn summed(count: SampleCount) -> Self
pub const fn summed(count: SampleCount) -> Self
Accumulate multiple samples and add them together
Trait Implementations§
Source§impl Clone for Accumulation
impl Clone for Accumulation
Source§fn clone(&self) -> Accumulation
fn clone(&self) -> Accumulation
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl PartialEq for Accumulation
impl PartialEq for Accumulation
impl Copy for Accumulation
impl Eq for Accumulation
impl StructuralPartialEq for Accumulation
Auto Trait Implementations§
impl Freeze for Accumulation
impl RefUnwindSafe for Accumulation
impl Send for Accumulation
impl Sync for Accumulation
impl Unpin for Accumulation
impl UnwindSafe for Accumulation
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