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
// ABOUTME: Device tree parser library with zero-copy parsing and ergonomic APIs
// ABOUTME: Provides comprehensive DTB parsing for embedded systems and hardware discovery
//! # Device Tree Parser
//!
//! Parse Device Tree Blob (DTB) files with zero-copy performance and ergonomic APIs.
//! Designed for embedded systems with `no_std` compatibility.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! # use device_tree_parser::{DeviceTreeParser, DtbError};
//! # fn main() -> Result<(), DtbError> {
//! // Load your DTB data
//! let dtb_data = std::fs::read("path/to/your.dtb").unwrap();
//!
//! // Create parser and parse the device tree
//! let parser = DeviceTreeParser::new(&dtb_data);
//! let tree = parser.parse_tree()?;
//!
//! // Use ergonomic APIs (v0.3.0+)
//! for child in &tree {
//! println!("Node: {}", child.name);
//!
//! // Access properties using Index trait
//! if child.has_property("reg") {
//! println!("Register: {}", child["reg"].value);
//! }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Features
//!
//! - **Zero-copy parsing**: Borrows from original DTB buffer for performance
//! - **Ergonomic APIs**: Index traits, `IntoIterator`, `TryFrom` conversions
//! - **`no_std` compatible**: Works in embedded environments with `alloc`
//! - **Type-safe**: Strong typing for device tree structures and properties
//! - **Real-world tested**: Validated against QEMU-generated DTB files
//!
//! ## Main Types
//!
//! - [`DeviceTreeParser`] - Main parser interface
//! - [`DeviceTreeNode`] - Device tree nodes with ergonomic access
//! - [`Property`] - Device tree properties with type-safe values
//! - [`PropertyValue`] - Strongly-typed property values
//! - [`DtbHeader`] - DTB file header information
//! - [`MemoryReservation`] - Memory reservation entries
extern crate alloc;
// Re-export main types
pub use ;
// Re-export utility functions
pub use parse_address_from_bytes;