#[repr(u16)]pub enum GraphSampleRate {
Sps2 = 0,
Sps10 = 1,
Sps50 = 2,
Sps1000 = 3,
}Expand description
Sample rate for AdcQueue streaming mode
Used with StartGraph (0x0E) command to configure device sampling rate. The device expects the rate index directly (0-3).
Variants§
Sps2 = 0
2 samples per second
Sps10 = 1
10 samples per second
Sps50 = 2
50 samples per second
Sps1000 = 3
1000 samples per second
Implementations§
Source§impl GraphSampleRate
impl GraphSampleRate
Sourcepub const fn sequence_step(self) -> u16
pub const fn sequence_step(self) -> u16
Expected increment of the device’s 1000 Hz sequence counter.
Sourcepub fn frequency(self) -> Frequency
pub fn frequency(self) -> Frequency
Sampling frequency represented as a typed physical quantity.
Sourcepub fn sequence_counter_frequency() -> Frequency
pub fn sequence_counter_frequency() -> Frequency
Frequency of the wrapping sequence counter used by graph samples.
Sourcepub fn auxiliary_voltage_lsb(self) -> ElectricPotential
pub fn auxiliary_voltage_lsb(self) -> ElectricPotential
Voltage represented by one auxiliary-line raw count.
Recorded traffic and measurements against firmware 1.9.9 show that 2 SPS uses 0.1 mV units, while faster graph modes use 1 mV units.
Sourcepub const fn from_sequence_step(step: u16) -> Option<Self>
pub const fn from_sequence_step(step: u16) -> Option<Self>
Infer the configured rate from a contiguous sequence-counter step.
Sourcepub fn missing_samples(self, previous: u16, current: u16) -> u16
pub fn missing_samples(self, previous: u16, current: u16) -> u16
Number of samples missing between two sequence counter values.
Trait Implementations§
Source§impl Clone for GraphSampleRate
impl Clone for GraphSampleRate
impl Copy for GraphSampleRate
Source§impl Debug for GraphSampleRate
impl Debug for GraphSampleRate
Source§impl Display for GraphSampleRate
impl Display for GraphSampleRate
impl Eq for GraphSampleRate
Source§impl PartialEq for GraphSampleRate
impl PartialEq for GraphSampleRate
impl StructuralPartialEq for GraphSampleRate
Source§impl TryFrom<u16> for GraphSampleRate
impl TryFrom<u16> for GraphSampleRate
Source§type Error = TryFromPrimitiveError<GraphSampleRate>
type Error = TryFromPrimitiveError<GraphSampleRate>
The type returned in the event of a conversion error.
Source§impl TryFromPrimitive for GraphSampleRate
impl TryFromPrimitive for GraphSampleRate
const NAME: &'static str = "GraphSampleRate"
type Primitive = u16
type Error = TryFromPrimitiveError<GraphSampleRate>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
Auto Trait Implementations§
impl Freeze for GraphSampleRate
impl RefUnwindSafe for GraphSampleRate
impl Send for GraphSampleRate
impl Sync for GraphSampleRate
impl Unpin for GraphSampleRate
impl UnsafeUnpin for GraphSampleRate
impl UnwindSafe for GraphSampleRate
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