Crate mu_lib

Source
Expand description

§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.

Modules§

assert
Assertion module providing condition checking functionality
atomic
Atomic operations module providing thread-safe operations
bindings
clock
Clock module providing system clock functionality
logger
Logger module providing logging functionality
message
Message handling module providing synchronous and asynchronous message operations
print
Print module providing output functionality
task
Task module providing task management functionality

Macros§

host_print
Macro for printing a single string to the host
host_println
Macro for printing a single string to the host followed by a newline
log_print
Macro for logging output
log_print_with_level
Macro for logging output with a specified level
uart_print
Macro for printing a single string to UART
uart_println
Macro for printing a single string to UART followed by a newline