pub struct TiltConfig {
pub segment_size: u8,
pub min_tilt_angle: u8,
pub beta_acc_mean: u16,
pub report_mode: EventReportMode,
pub interrupt_hold: u8,
}Expand description
Configuration for the BMI323 tilt-detection feature (§6.2.2, Registers (0x21-0x22) tilt_1/tilt_2; §5.8.9).
Fields§
§segment_size: u8Averaging duration of the acceleration reference vector.
Unit: seconds
Scaling: raw / 50
Range: 0 ..= 255, corresponding to approximately 0.0s ..= 5.10s
min_tilt_angle: u8Minimum tilt angle raw field.
Unit: degrees Encoding: nonlinear Field width: 8 bits
The datasheet interpretation is cos(angle) * 256. The raw value is
exposed directly to avoid adding a floating-point math dependency in
this no_std crate.
beta_acc_mean: u16Exponential smoothing coefficient for the low-pass mean of the acceleration vector.
This is the raw beta_acc_mean field from the datasheet.
report_mode: EventReportModeEvent reporting behavior shared across feature-engine interrupts.
interrupt_hold: u8Shared feature-engine interrupt hold-time exponent.
Implementations§
Source§impl TiltConfig
impl TiltConfig
Sourcepub fn segment_size_from_seconds(seconds: f32) -> u8
pub fn segment_size_from_seconds(seconds: f32) -> u8
Convert a reference-vector averaging duration in seconds to the BMI323 field encoding.
Sourcepub fn segment_size_to_seconds(raw: u8) -> f32
pub fn segment_size_to_seconds(raw: u8) -> f32
Convert a raw segment-size field value back to seconds.
Sourcepub fn interrupt_hold_from_millis(millis: f32) -> u8
pub fn interrupt_hold_from_millis(millis: f32) -> u8
Convert an interrupt hold time in milliseconds to the BMI323 field encoding.
Sourcepub fn interrupt_hold_to_millis(raw: u8) -> f32
pub fn interrupt_hold_to_millis(raw: u8) -> f32
Convert a raw interrupt-hold field value back to milliseconds.
Trait Implementations§
Source§impl Clone for TiltConfig
impl Clone for TiltConfig
Source§fn clone(&self) -> TiltConfig
fn clone(&self) -> TiltConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TiltConfig
impl Debug for TiltConfig
Source§impl Format for TiltConfigwhere
EventReportMode: Format,
impl Format for TiltConfigwhere
EventReportMode: Format,
Source§impl PartialEq for TiltConfig
impl PartialEq for TiltConfig
Source§fn eq(&self, other: &TiltConfig) -> bool
fn eq(&self, other: &TiltConfig) -> bool
self and other values to be equal, and is used by ==.