4 stable releases

Uses old Rust 2015

1.1.0 Jun 28, 2016
1.0.3 Mar 20, 2016

#1262 in Hardware support

Download history 7283/week @ 2024-03-14 8037/week @ 2024-03-21 5892/week @ 2024-03-28 8104/week @ 2024-04-04 3862/week @ 2024-04-11 7456/week @ 2024-04-18 6929/week @ 2024-04-25 6434/week @ 2024-05-02 5713/week @ 2024-05-09 5134/week @ 2024-05-16 5274/week @ 2024-05-23 7031/week @ 2024-05-30 9741/week @ 2024-06-06 9147/week @ 2024-06-13 1833/week @ 2024-06-20 1569/week @ 2024-06-27

23,925 downloads per month
Used in dbs-boot

MIT license

13KB
257 lines

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);
}

Load a device tree from a memory buffer.

No runtime deps