fdt-rs
A Flattened Device Tree parser for embedded no-std environments
Usage
Add this to your Cargo.toml
:
[]
= "0.4"
and this to your crate root:
extern crate fdt_rs;
Features
This crate can be used without the standard library (#![no_std]
) by disabling
the default std
feature. Use this in Cargo.toml
:
[]
= "0.4"
= false
Example
The following example stashes a flattened device tree in memory, parses that
device tree into a fdt_rs::DevTree
object, searches the device tree for
"ns16550a" compatible nodes, and (if found) prints each nodes' name.
extern crate fdt_rs;
use *;
use *;
// Place a device tree image into the rust binary and
// align it to a 32-byte boundary by using a wrapper struct.
;
pub const FDT: & = &_Wrapper.0;
Also check out fdtdump for an example implementation of the fdtdump Device Tree utility using this library.