7 releases

new 0.1.6 Apr 17, 2025
0.1.5 Apr 15, 2025
0.1.4 Mar 12, 2025
0.1.0 Feb 24, 2025

#4 in #initialized

Download history 104/week @ 2025-02-19 101/week @ 2025-02-26 269/week @ 2025-03-05 203/week @ 2025-03-12 59/week @ 2025-04-09

62 downloads per month

Apache-2.0

63KB
1.5K SLoC

mu_lib

A library providing essential functionality for the XCENA system. This library is designed to work with both C++ and Rust, providing a safe and efficient interface for system operations.

Features

  • Safe Rust bindings for all system operations
  • Thread-safe atomic operations
  • Comprehensive logging system
  • Task management utilities
  • System clock access
  • Message passing capabilities

Modules

  • assert: Provides condition checking and program termination functions
  • atomic: Provides thread-safe atomic operations
  • clock: Provides system clock functionality
  • logger: Provides logging functionality with various log levels
  • message: Provides synchronous and asynchronous message handling functions
  • print: Provides output functionality for UART, host, and general printing
  • task: Provides task management functionality

Examples

use mu_lib::print::uart_println;
use mu_lib::logger::{LogLevel, log_print_with_level};

// Print to UART
uart_println!("Hello from Rust!");

// Log with level
log_print_with_level!(LogLevel::Info, "System initialized");

Safety

This library contains unsafe code that interfaces with the system. While the Rust interface provides safe abstractions, users should be aware of the underlying system requirements and constraints.


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.

Requirements

The MU Rust compiler is based on rustc 1.79.0, so it is recommended to use this version.

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

Build

cargo build

No runtime deps

~0–1.9MB
~38K SLoC