device_tree 1.1.0

Reads and parses Linux device tree images
Documentation
  • Coverage
  • 42.5%
    17 out of 40 items documented0 out of 19 items with examples
  • Size
  • Source code size: 24.31 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 46.74 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Documentation
  • mbr/device_tree-rs
    16 12 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mbr

Parse flattened linux device trees

Device trees are used to describe a lot of hardware, especially in the ARM embedded world and are also used to boot Linux on these device. A device tree describes addresses and other attributes for many parts on these boards

This library allows parsing the so-called flattened device trees, which are the compiled binary forms of these trees.

To read more about device trees, check out the kernel docs. Some example device trees to try out are [the Raspberry Pi ones] (https://github.com/raspberrypi/firmware/tree/master/boot).

The library does not use std, just core.

Examples

fn main() {
    // read file into memory
    let mut input = fs::File::open("sample.dtb").unwrap();
    let mut buf = Vec::new();
    input.read_to_end(&mut buf).unwrap();

    let dt = device_tree::DeviceTree::load(buf.as_slice ()).unwrap();
    println!("{:?}", dt);
}