Module device_tree_source::parser [] [src]

This module's main focus is parse_dt which parses a DTS file and returns an unflattened device tree.

In addition there are a couple of utility C-style escaped strings and characters parsing functions.

Enums

ParseResult

Returned on a successful completion of parse_dt.

Functions

escape_c_char

Parse a slice of bytes as a ASCII character. The character may be described as a C-style escape code. All hexadecimal and octal escape codes work up to 0xff or x777, respectively, because they are not converted to chars.

escape_c_string

Parse a slice of bytes as a String, replacing escape codes with the appropriate character. Characters may be described as a C-style escape code. All hexadecimal and octal escape codes work up to 0x7f or x177, respectively. This is due to the conversion to chars. See parser::escape_c_char if a conversion of a character beyond this change is needed.

parse_dt

Parses the slice of u8s as ASCII characters and returns a device tree made of the first root node and a Vec of nodes defined after that. The nodes defined after the first root node may specify a node by label to modify or my start at the root node. These amendments to the root node can be merged into the device tree manually or by tree::apply_amends.