#i2c-spi #i2c #st #embedded-spi

no-std st-mems-bus

Wrapper for I2C and SPI buses, providing a unified API to the underlying bus

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

Download history 28/week @ 2025-11-01 28/week @ 2025-11-08 29/week @ 2025-11-15 33/week @ 2025-11-22 27/week @ 2025-11-29 23/week @ 2025-12-06 18/week @ 2025-12-13 36/week @ 2025-12-20 18/week @ 2025-12-27 28/week @ 2026-01-03 1/week @ 2026-01-10 34/week @ 2026-01-17 98/week @ 2026-01-24 74/week @ 2026-01-31 19/week @ 2026-02-07 13/week @ 2026-02-14

206 downloads per month
Used in 17 crates

BSD-3-Clause

13KB
234 lines

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

Dependencies

~85KB