[package]
name = "bmi323-driver"
version = "0.2.0"
edition = "2024"
rust-version = "1.85"
license = "MIT"
description = "Generic no_std driver for the Bosch Sensortec BMI323 IMU"
authors = ["Janne Snabb"]
readme = "README.md"
documentation = "https://docs.rs/bmi323-driver"
keywords = ["bmi323", "imu", "embedded-hal", "embassy", "sensor"]
categories = ["embedded", "hardware-support", "no-std"]
repository = "https://github.com/snabb/bmi323-driver"
include = [
    "/Cargo.toml",
    "/LICENSE",
    "/README.md",
    "/examples/*.rs",
    "/src/*.rs",
    "/tests/*.rs",
]

[package.metadata.docs.rs]
features = ["defmt"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
# Async (embedded-hal-async) is the default when no feature is specified.
# "async" may be listed explicitly for clarity; it acts as a no-op but is used
# as a required-feature guard for async examples and tests so that they are not
# compiled in blocking mode.
# "blocking" opts into the synchronous embedded-hal API.
# Enabling both simultaneously causes a compile error.
default = []
async = []
blocking = ["maybe-async/is_sync"]
defmt = ["dep:defmt"]

[dependencies]
defmt = { version = "1.0.1", optional = true }
embedded-hal = "1.0.0"
embedded-hal-async = "1.0.0"
maybe-async = "0.2.10"

[target.'cfg(not(target_os = "none"))'.dev-dependencies]
embedded-hal-mock = { version = "0.11.1", default-features = false, features = ["eh1", "embedded-hal-async"] }

[[test]]
name = "i2c_transactions_blocking"
path = "tests/i2c_transactions_blocking.rs"
required-features = ["blocking"]

[[test]]
name = "i2c_transactions_async"
path = "tests/i2c_transactions_async.rs"
required-features = ["async"]

[[test]]
name = "spi_transactions_blocking"
path = "tests/spi_transactions_blocking.rs"
required-features = ["blocking"]

[[test]]
name = "spi_transactions_async"
path = "tests/spi_transactions_async.rs"
required-features = ["async"]

[[example]]
name = "blocking_i2c_basic"
required-features = ["blocking"]

[[example]]
name = "async_i2c_basic"
required-features = ["async"]

[[example]]
name = "async_i2c_alt_config"
required-features = ["async"]

[[example]]
name = "async_i2c_flat"
required-features = ["async"]

[[example]]
name = "async_i2c_any_motion"
required-features = ["async"]

[[example]]
name = "async_i2c_no_motion"
required-features = ["async"]

[[example]]
name = "async_i2c_orientation"
required-features = ["async"]

[[example]]
name = "async_i2c_self_test"
required-features = ["async"]

[[example]]
name = "async_i2c_significant_motion"
required-features = ["async"]

[[example]]
name = "async_i2c_step_counter"
required-features = ["async"]

[[example]]
name = "async_i2c_tap"
required-features = ["async"]

[[example]]
name = "async_i2c_tilt"
required-features = ["async"]
