pub struct StepCounterConfig {
pub watermark_level: u16,
pub reset_counter: bool,
}Expand description
Configuration for the BMI323 feature-engine step counter block.
The counter itself accumulates the total detected step count inside the sensor. This configuration controls two separate behaviors:
watermark_level: generates a step-counter interrupt whenever the number of newly counted steps since the last step-counter event reaches the programmed valuereset_counter: requests a reset of the accumulated internal step count
A watermark_level of 0 disables the step-counter interrupt source.
Fields§
§watermark_level: u16Step-counter interrupt watermark.
Unit: steps
Scaling: 1 LSB = 1 step event increment
Range: 0 ..= 1023
When this is nonzero, the BMI323 raises the StepCounter interrupt
each time this many additional steps have been accumulated since the
last step-counter event. A value of 0 disables the step-counter
interrupt.
reset_counter: boolReset request for the accumulated step count.
When set to true, the driver writes the feature-engine reset bit for
the step counter. This is useful when re-arming an application that
wants a fresh accumulated count after initialization or after reading a
previous session’s result.
Implementations§
Source§impl StepCounterConfig
impl StepCounterConfig
Sourcepub const fn disabled() -> Self
pub const fn disabled() -> Self
Create a configuration with the step-counter interrupt disabled.
Sourcepub const fn with_watermark(steps: u16) -> Self
pub const fn with_watermark(steps: u16) -> Self
Create a configuration that raises an interrupt every steps steps.
Values above 1023 are saturated to the BMI323 register field width.
Trait Implementations§
Source§impl Clone for StepCounterConfig
impl Clone for StepCounterConfig
Source§fn clone(&self) -> StepCounterConfig
fn clone(&self) -> StepCounterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more