pub struct TapConfig {Show 15 fields
pub axis: TapAxis,
pub reporting_mode: TapReportingMode,
pub max_peaks_for_tap: u8,
pub mode: TapDetectionMode,
pub single_tap_enabled: bool,
pub double_tap_enabled: bool,
pub triple_tap_enabled: bool,
pub tap_peak_threshold: u16,
pub max_gesture_duration: u8,
pub max_duration_between_peaks: u8,
pub tap_shock_settling_duration: u8,
pub min_quiet_duration_between_taps: u8,
pub quiet_time_after_gesture: u8,
pub report_mode: EventReportMode,
pub interrupt_hold: u8,
}Expand description
Configuration for the BMI323 tap-detection feature.
Fields§
§axis: TapAxisDominant axis used for tap detection.
reporting_mode: TapReportingModeWhether tap gestures should be reported immediately or only after timeout-based confirmation.
max_peaks_for_tap: u8Maximum number of threshold crossings expected around a tap.
Range: 0 ..= 7
mode: TapDetectionModeTap detection profile.
single_tap_enabled: boolWhether single-tap reporting is enabled.
double_tap_enabled: boolWhether double-tap reporting is enabled.
triple_tap_enabled: boolWhether triple-tap reporting is enabled.
tap_peak_threshold: u16Minimum peak threshold caused by the tap.
Unit: g
Scaling: raw / 512
Range: 0 ..= 1023, corresponding to approximately 0.0g ..= 1.998g
max_gesture_duration: u8Maximum duration from the first tap until the second and/or third tap is expected.
Unit: seconds
Scaling: raw / 25
Range: 0 ..= 63, corresponding to approximately 0.0s ..= 2.52s
max_duration_between_peaks: u8Maximum duration between positive and negative peaks belonging to a tap.
Unit: seconds
Scaling: raw / 200
Range: 0 ..= 15, corresponding to approximately 0.0s ..= 0.075s
tap_shock_settling_duration: u8Maximum duration for which the tap impact is observed.
Unit: seconds
Scaling: raw / 200
Range: 0 ..= 15, corresponding to approximately 0.0s ..= 0.075s
min_quiet_duration_between_taps: u8Minimum quiet duration between consecutive tap impacts.
Unit: seconds
Scaling: raw / 200
Range: 0 ..= 15, corresponding to approximately 0.0s ..= 0.075s
quiet_time_after_gesture: u8Minimum quiet duration between two gestures.
Unit: seconds
Scaling: raw / 25
Range: 0 ..= 15, corresponding to approximately 0.0s ..= 0.6s
report_mode: EventReportModeEvent reporting behavior shared across feature-engine interrupts.
interrupt_hold: u8Shared feature-engine interrupt hold-time exponent.
Note: the BMI323 datasheet warns that tap detection must not use the 5ms hold-time setting unless Bosch’s enhanced flexibility configuration has been applied externally.
Implementations§
Source§impl TapConfig
impl TapConfig
Sourcepub fn tap_peak_threshold_from_g(g: f32) -> u16
pub fn tap_peak_threshold_from_g(g: f32) -> u16
Convert a tap threshold in g to the BMI323 field encoding.
Sourcepub fn tap_peak_threshold_to_g(raw: u16) -> f32
pub fn tap_peak_threshold_to_g(raw: u16) -> f32
Convert a raw tap-threshold field value back to g.
Sourcepub fn max_gesture_duration_from_seconds(seconds: f32) -> u8
pub fn max_gesture_duration_from_seconds(seconds: f32) -> u8
Convert a gesture duration in seconds to the BMI323 field encoding.
Sourcepub fn max_gesture_duration_to_seconds(raw: u8) -> f32
pub fn max_gesture_duration_to_seconds(raw: u8) -> f32
Convert a raw gesture-duration field value back to seconds.
Sourcepub fn short_duration_from_seconds(seconds: f32) -> u8
pub fn short_duration_from_seconds(seconds: f32) -> u8
Convert a short tap timing parameter in seconds to the BMI323 field
encoding used by max_duration_between_peaks,
tap_shock_settling_duration, and min_quiet_duration_between_taps.
Sourcepub fn short_duration_to_seconds(raw: u8) -> f32
pub fn short_duration_to_seconds(raw: u8) -> f32
Convert a raw short-duration field value back to seconds.
Sourcepub fn quiet_time_after_gesture_from_seconds(seconds: f32) -> u8
pub fn quiet_time_after_gesture_from_seconds(seconds: f32) -> u8
Convert a post-gesture quiet time in seconds to the BMI323 field encoding.
Sourcepub fn quiet_time_after_gesture_to_seconds(raw: u8) -> f32
pub fn quiet_time_after_gesture_to_seconds(raw: u8) -> f32
Convert a raw post-gesture quiet-time 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.