st-mems-bus

Crates.iost-mems-bus
lib.rsst-mems-bus
version1.0.1
created_at2025-07-31 09:29:16.366372+00
updated_at2025-08-20 12:56:28.213556+00
descriptionWrapper for I2C and SPI buses, providing a unified API to the underlying bus.
homepage
repositoryhttps://github.com/STMicroelectronics/st-mems-rust-drivers/tree/main/util/st-mems-bus
max_upload_size
id1774750
size13,596
Gioele Fiorenza (Gioelio)

documentation

README

st-mems-bus

Crates.io BSD 3-Clause licensed

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 uses RefCell internally and calls borrow_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

Commit count: 42

cargo fmt