autd3_core/common/
mod.rs

1mod angle;
2mod freq;
3
4use core::time::Duration;
5
6pub use core::f32::consts::PI;
7
8#[cfg(feature = "use_meter")]
9mod unit {
10    /// meter
11    pub const METER: f32 = 1.0;
12}
13#[cfg(not(feature = "use_meter"))]
14mod unit {
15    /// meter
16    pub const METER: f32 = 1000.0;
17}
18pub use unit::*;
19
20pub use angle::*;
21pub use freq::*;
22
23/// millimeter
24pub const MILLIMETER: f32 = METER / 1000.0;
25
26/// The absolute threshold of hearing in \[㎩\]
27pub const ABSOLUTE_THRESHOLD_OF_HEARING: f32 = 20e-6;
28
29/// The amplitude of T4010A1 in \[㎩*mm\]
30pub const T4010A1_AMPLITUDE: f32 = 275.574_25 * 200.0 * MILLIMETER; // [㎩*mm]
31
32/// The default timeout duration
33pub const DEFAULT_TIMEOUT: core::time::Duration = core::time::Duration::from_millis(200);
34
35/// The frequency of ultrasound
36pub const ULTRASOUND_FREQ: Freq<u32> = Freq { freq: 40000 };
37
38/// The period of ultrasound
39pub const ULTRASOUND_PERIOD: Duration = Duration::from_micros(25);
40
41#[doc(hidden)]
42pub const SILENCER_STEPS_INTENSITY_DEFAULT: u16 = 10;
43#[doc(hidden)]
44pub const SILENCER_STEPS_PHASE_DEFAULT: u16 = 40;
45
46/// \[㎜\]
47#[allow(non_upper_case_globals)]
48pub const mm: f32 = MILLIMETER;