dvcdbg is a compact logging and debugging library designed specifically for embedded Rust development. It operates efficiently in no_std environments and offers features such as UART and I2C logging, along with an I2C scanner for enhanced debugging. Its ease of use and powerful utilities make it an essential tool for embedded developers.
dvcdbg is an efficient logging and debugging library tailored for embedded Rust development, fully compatible with no_std environments. Designed to cater to the unique requirements of embedded applications, this library facilitates log output through various interfaces, including UART and I2C.
debug_log as needed.Integrating dvcdbg into a Rust project is simple. Update the Cargo.toml with the following dependency:
# Cargo.toml
[dependencies]
dvcdbg = { git = "https://github.com/p14c31355/dvcdbg", features = ["debug_log"] }
Here’s a quick example of how to implement logging in an Arduino environment:
use arduino_hal::default_serial;
use dvcdbg::logger::SerialLogger;
let dp = arduino_hal::Peripherals::take().unwrap();
let pins = arduino_hal::pins!(dp);
let mut serial = default_serial!(dp, pins, 57600);
let mut logger = SerialLogger::new(&mut serial);
logger.log("Init I2C bus...");
// Use `log!` macro (requires debug_log feature)
log!(logger, "Formatted number: {}", 42);
Comprehensive API documentation is available for further insights and examples:
no_std: Fully compatible with embedded development without the standard library.Contributions are encouraged! For those interested in contributing, please review the contribution guidelines for reporting bugs, suggesting features, or submitting pull requests.
No comments yet.
Sign in to be the first to comment.