pub enum ConversionCycle {
Ms15_5,
Ms125,
Ms250,
Ms500,
S1,
S4,
S8,
S16,
}Expand description
The nominal conversion cycle in continuous mode (configuration bits 9:7, CONV).
The names give the cycle with no averaging; with averaging the cycle is never
shorter than the conversions take, see cycle_micros.
Variants§
Ms15_5
15.5 ms (code 000).
Ms125
125 ms (code 001).
Ms250
250 ms (code 010).
Ms500
500 ms (code 011).
S1
1 s (code 100, the default).
S4
4 s (code 101).
S8
8 s (code 110).
S16
16 s (code 111).
Implementations§
Source§impl ConversionCycle
impl ConversionCycle
Sourcepub fn from_code(code: u8) -> ConversionCycle
pub fn from_code(code: u8) -> ConversionCycle
Builds a cycle setting from a 3-bit field code.
Sourcepub fn nominal_micros(self) -> u32
pub fn nominal_micros(self) -> u32
Returns the nominal cycle in microseconds, with no averaging.
Sourcepub fn cycle_micros(self, averaging: Averaging) -> u32
pub fn cycle_micros(self, averaging: Averaging) -> u32
Returns the actual continuous-mode cycle in microseconds for an averaging setting, per the datasheet’s conversion cycle table.
When the averaged conversions take longer than the nominal cycle there is no standby time and the cycle stretches to the conversion time.
§Arguments
averaging- the averaging setting in force.
§Returns
The time between result updates, in microseconds.
Trait Implementations§
Source§impl Clone for ConversionCycle
impl Clone for ConversionCycle
Source§fn clone(&self) -> ConversionCycle
fn clone(&self) -> ConversionCycle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ConversionCycle
Source§impl Debug for ConversionCycle
impl Debug for ConversionCycle
impl Eq for ConversionCycle
Source§impl PartialEq for ConversionCycle
impl PartialEq for ConversionCycle
Source§fn eq(&self, other: &ConversionCycle) -> bool
fn eq(&self, other: &ConversionCycle) -> bool
self and other values to be equal, and is used by ==.