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 enableatomic-device
on devices without native atomic CASportable-atomic
emulates atomic CAS functionality, allowingembedded-hal-bus
to useatomic-device
on hardware that does not natively support atomic CAS. If you enable this, you must also addportable-atomic
to your crate with a feature flag such asunsafe-assume-single-core
orcritical-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
fromdefmt
0.3 for enums and structs. See https://github.com/knurling-rs/defmt for more infoEnables defmt, defmt-03 of embedded-hal and optional embedded-hal-async
- alloc std?
-
Enables additional utilities requiring a global allocator.