3 stable releases
Uses new Rust 2024
| 2.0.0 | Jan 27, 2026 |
|---|---|
| 1.0.1 | Aug 20, 2025 |
| 1.0.0 | Jul 31, 2025 |
#2038 in Embedded development
206 downloads per month
Used in 17 crates
13KB
234 lines
st-mems-bus
The st-mems-bus Library provides a unified and consistent API for accessing different types of communication buses. Currently, it supports both SPI and I2C buses, offering various modes for managing bus ownership and access.
Access Modes
- shared:
This mode usesRefCellinternally and callsborrow_mut()to ensure exclusive mutable access to the bus at runtime. While this introduces some overhead, it provides a simple mechanism to safely share the bus. More advanced sharing techniques are left to the user to implement as needed.
Usage
Add the library to your dependencies in Cargo.toml:
[dependencies]
st-mems-bus = { path = "path_to_bus" }
Features
To keep the library lightweight, you can enable support for each bus type individually. By default, all bus types are included. Available features:
- spi - Enable support for SPI bus.
- i2c - Enable support for I2C bus.
More information: http://www.st.com
Copyright © 2025 STMicroelectronics
Dependencies
~85KB