Cargo Features

embedded-hal-bus has no features set by default.

[dependencies]
embedded-hal-bus = { version = "0.3.0", features = ["std", "portable-atomic", "async", "defmt-03", "alloc"] }
std = alloc

Enable shared bus implementations using std::sync::Mutex

portable-atomic

Use portable-atomic to enable atomic-device on devices without native atomic CAS

portable-atomic emulates atomic CAS functionality, allowing embedded-hal-bus to use atomic-device on hardware that does not natively support atomic CAS. If you enable this, you must also add portable-atomic to your crate with a feature flag such as unsafe-assume-single-core or critical-section to choose how atomic CAS is implemented. See https://docs.rs/portable-atomic/1.7.0/portable_atomic/#optional-features for more info.

Enables portable-atomic

Affects util::AtomicCell

async

Enable embedded-hal-async support.

Enables embedded-hal-async

defmt-03

Derive defmt::Format from defmt 0.3 for enums and structs. See https://github.com/knurling-rs/defmt for more info

Enables defmt, defmt-03 of embedded-hal and optional embedded-hal-async

alloc std?

Enables additional utilities requiring a global allocator.