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
62 downloads per month
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 functionsatomic
: Provides thread-safe atomic operationsclock
: Provides system clock functionalitylogger
: Provides logging functionality with various log levelsmessage
: Provides synchronous and asynchronous message handling functionsprint
: Provides output functionality for UART, host, and general printingtask
: 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