fdt

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(root Node) ([]byte, error)

Build serializes the provided node tree into an FDT blob.

Types

type Node

type Node struct {
	Name       string              `json:"name"`
	Properties map[string]Property `json:"properties,omitempty"`
	Children   []Node              `json:"children,omitempty"`
}

Node describes a device-tree node using JSON-friendly structures.

type Property

type Property struct {
	Strings []string `json:"strings,omitempty"`
	U32     []uint32 `json:"u32,omitempty"`
	U64     []uint64 `json:"u64,omitempty"`
	Bytes   []byte   `json:"bytes,omitempty"`
	Flag    bool     `json:"flag,omitempty"`
}

Property describes a single device-tree property in a JSON-friendly form. Exactly one of the typed fields should be populated for a given property.

func (Property) DefinedCount

func (p Property) DefinedCount() int

DefinedCount reports how many distinct fields on the property are populated.

func (Property) Kind

func (p Property) Kind() string

Kind returns the name of the populated field or an empty string if none are set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL