svd_generator/tree.rs
1use fdt::Fdt;
2
3mod compatible;
4mod node;
5
6pub use compatible::*;
7pub use node::*;
8
9/// Represents a DeviceTree loaded from an FDT description.
10pub struct Tree<'a> {
11 dt: Fdt<'a>,
12}
13
14impl<'a> Tree<'a> {
15 /// Gets a reference to the inner [`DeviceTree`].
16 pub const fn device_tree(&self) -> &Fdt {
17 &self.dt
18 }
19}
20
21impl<'a> From<Fdt<'a>> for Tree<'a> {
22 fn from(val: Fdt<'a>) -> Self {
23 Self { dt: val }
24 }
25}