Skip to content

duanyu-yu/DeviceTree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeviceTree

Crates.io

The crate devicetree can be used for parsing Devicetree Blob (DTB), based on Devicetree Specification.

The crate devicetree is a #![no_std] crate written in Rust.

Example

use devicetree::DeviceTree;

fn main() {
    let mut dtb: &[u8] = include_bytes!("<path-to-*.dtb>");

    let tree = DeviceTree::from_bytes(&mut dtb).unwrap();

    println!("{}", tree);
}

Debug

devicetree uses Log Messages to log info, debug, or error messages to the console. More about Log Messages can be found here.

Set the RUST_LOG environment variable to print debug messages:

RUST_LOG=debug cargo run

TODO

  • convert property value corresponds property type
  • dtb writer
  • dynamic management of devicetree

About

A pure-Rust devicetree parsing tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages