pub struct OrientationConfig {
pub upside_down_enabled: bool,
pub mode: OrientationMode,
pub blocking: FeatureBlockingMode,
pub theta: u8,
pub hold_time: u8,
pub slope_threshold: u8,
pub hysteresis: u8,
pub report_mode: EventReportMode,
pub interrupt_hold: u8,
}Expand description
Configuration for the BMI323 orientation-detection feature.
Fields§
§upside_down_enabled: boolWhether upside-down orientation detection is enabled.
mode: OrientationModePortrait/landscape spread mode.
blocking: FeatureBlockingModeBlocking behavior to suppress orientation changes during large movement.
theta: u8Maximum allowed tilt angle for orientation classification.
Unit: degrees Encoding: nonlinear Field width: 6 bits
The datasheet interpretation is (tan(theta)^2) * 64.
hold_time: u8Minimum time the device must remain in the new orientation before an event is asserted.
Unit: seconds
Scaling: raw / 50
Range: 0 ..= 31, corresponding to approximately 0.0s ..= 0.62s
slope_threshold: u8Minimum slope between consecutive acceleration samples used for blocking orientation changes during large movement.
Unit: g
Scaling: raw / 512
Range: 0 ..= 255, corresponding to approximately 0.0g ..= 0.498g
hysteresis: u8Hysteresis of acceleration for orientation change detection.
Unit: g
Scaling: raw / 512
Range: 0 ..= 255, corresponding to approximately 0.0g ..= 0.498g
report_mode: EventReportModeEvent reporting behavior shared across feature-engine interrupts.
interrupt_hold: u8Shared feature-engine interrupt hold-time exponent.
Implementations§
Source§impl OrientationConfig
impl OrientationConfig
Sourcepub fn hold_time_from_seconds(seconds: f32) -> u8
pub fn hold_time_from_seconds(seconds: f32) -> u8
Convert a hold time in seconds to the BMI323 field encoding.
Sourcepub fn hold_time_to_seconds(raw: u8) -> f32
pub fn hold_time_to_seconds(raw: u8) -> f32
Convert a raw hold-time field value back to seconds.
Sourcepub fn slope_threshold_from_g(g: f32) -> u8
pub fn slope_threshold_from_g(g: f32) -> u8
Convert a slope threshold in g to the BMI323 field encoding.
Sourcepub fn slope_threshold_to_g(raw: u8) -> f32
pub fn slope_threshold_to_g(raw: u8) -> f32
Convert a raw slope-threshold field value back to g.
Sourcepub fn hysteresis_from_g(g: f32) -> u8
pub fn hysteresis_from_g(g: f32) -> u8
Convert a hysteresis in g to the BMI323 field encoding.
Sourcepub fn hysteresis_to_g(raw: u8) -> f32
pub fn hysteresis_to_g(raw: u8) -> f32
Convert a raw hysteresis field value back to g.
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 OrientationConfig
impl Clone for OrientationConfig
Source§fn clone(&self) -> OrientationConfig
fn clone(&self) -> OrientationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more