diff --git a/Cargo.toml b/Cargo.toml index 68de36a..963767a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,8 @@ rust-version = "1.65" [features] default = [] +defmt-03 = ["dep:defmt"] + nightly = ["dep:embedded-hal-async"] config-builder = ["dep:typed-builder"] @@ -23,5 +25,8 @@ config-builder = ["dep:typed-builder"] embedded-hal = "0.2" embedded-hal-async = { version = "1.0.0-rc.3", optional = true } +defmt = { version = "0.3", optional = true } + num-traits = { version = "0.2", default-features = false, features = ["libm"] } + typed-builder = { version = "0.18", optional = true } diff --git a/src/lib.rs b/src/lib.rs index d58b890..aefa3cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -424,7 +424,7 @@ impl BMP388 { } } -///Error +/// Error pub struct Error { ///Fatal error pub fatal: bool, @@ -434,7 +434,7 @@ pub struct Error { pub config: bool, } -///Status +/// Status #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct Status { ///Indicates whether chip is ready for a command @@ -456,8 +456,9 @@ impl Status { } } -#[derive(Debug, Copy, Clone)] /// Sensor data +#[derive(Debug, Copy, Clone)] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] pub struct SensorData { ///The measured pressure: Pascals (Pa) pub pressure: f64, @@ -527,7 +528,8 @@ impl Default for PowerControl { } } } -///Output mode for interrupt pin + +/// Output mode for interrupt pin #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum OutputMode { ///Push-pull output mode