1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! Basic device tree parsing utils that operate directly on the FDT.
//!
//! # Overview
//!
//! This module provides basic utilities which can operate on a FDT through in-order parsing.
//! These utilites will simply parse the device tree on the fly.
//!
//! See the [`crate::index`] module for more advanced and performant utilites.
//!
//! # Examples
//!
//! ## Initialization
//!
//! ```
//! # use fdt_rs::doctest::FDT;
//! use fdt_rs::prelude::*;
//! use fdt_rs::base::*;
//!
//! // Get access to a flattened device tree buffer.
//! let fdt: &[u8] = FDT;
//!
//! // Create the device tree parser
//! let devtree = unsafe { DevTree::new(fdt) }
//! .expect("Buffer does not contain a device tree.");
//! ```
//!
//! ## Compatible Search
//!
//! Find all [`DevTreeNode`] objects which have their `compatible` property defined as
//! `"ns16550a"`:
//! ```
//! # use fdt_rs::doctest::*;
//! # let (index, _) = doctest_index();
//! // Get the compatible node iterator
//! let mut iter = index.compatible_nodes("ns16550a");
//!
//! // Get a signle node from that iterator
//! let node = iter.next().expect("No node found!");
//!
//! // Iterate through all remaining nodes
//! for node in iter {
//! println!{"Found node: {}", node.name().unwrap()};
//! }
//! ```
//!
//! ## Custom Search
//!
//! Find all [`DevTreeNode`] objects which have their `compatible` property defined as
//! `"ns16550a"`:
//! ```
//! # use fdt_rs::doctest::*;
//! # let (index, _) = doctest_index();
//! // Get the compatible node iterator
//! let mut iter = index.compatible_nodes("ns16550a");
//!
//! // Get a signle node from that iterator
//! let node = iter.next().expect("No node found!");
//!
//! // Iterate through all remaining nodes
//! for node in iter {
//! println!{"Found node: {}", node.name().unwrap()};
//! }
//! ```
pub use *;
pub use *;
pub use *;
pub use *;