mu_lib 0.2.2

XCENA mu Library
Documentation

MU Library - Rust Bindings

This Rust library provides a safe and idiomatic interface to the core MU Library, which is written in C++. It includes essential functionalities for developing with Rust in the MU programming environment.

Overview

rust mu_lib wraps various hardware and system features of the MU system, making them easily accessible from Rust code. It aims to enhance development productivity by ensuring memory safety and leveraging Rust's type system and error handling mechanisms.

This library is designed as a no_std crate and provides default global allocator and panic handler implementations out of the box.

Requirements

This library requires the MU Rust toolchain which is based on rustc 1.86.0. It is required to use this specific version for compatibility.

Key Features

  • Safe Rust bindings for all system operations
  • Thread-safe atomic operations
  • Comprehensive logging system
  • Task management utilities
  • System clock access
  • Message passing capabilities
  • no_std compatible
  • Default global allocator implementation
  • Default panic handler implementation

Build

cargo +nightly-1.86.0-x86_64-unknown-linux-gnu build ${build_profile} -Z build-std=core,alloc --target=${path_to_target}/riscv64imfdxmetis-unknown-none-elf.json

Feature Flags

By default, this library provides both global allocator and panic handler implementations. If you want to use your own implementations instead, you can disable the defaults and selectively enable specific features in your Cargo.toml:

[dependencies]
mu_lib = { version = "0.1.11", default-features = false, features = ["default_global_allocator"] }
[dependencies]
mu_lib = { version = "0.1.11", default-features = false, features = ["default_panic_handler"] }