Device Tree

class sdfgen.DeviceTree(data: bytes)

This class exists to allow other layers to be generic to boards or architectures by letting the user talk about hardware via the Device Tree.

class Node(device_tree: DeviceTree, node: str)
node(name: str) Node

Given a parsed DeviceTree, find the specific node based on the node names. Child nodes can be referenced by separating the parent and child node name by ‘/’.

Example:

dtb = DeviceTree(dtb_bytes)
dtb.node("soc/timer@13050000")

would be used to access the timer device on a Device Tree that looked like:

soc {
    timer@13050000 {
        ...
    };
};
property size: int