Devicetree View¶
The Devicetree View is one of the default Sidebar Views. It lists the devicetree contexts for your selected build configuration and takes the name of the board you created the configuration for.
Devicetree contexts¶
The configuration included in the board and overlay files is summarized in devicetree contexts. Each context corresponds to a single compiled devicetree file that goes into a build. See the Devicetree and Kconfig support guide page for more information.
The following devicetree contexts are available in the extension.
Board¶
This is a list of information related to your connected board. It includes the name, architecture, supported features, and supported toolchains.
GPIO¶
This is a list of all known GPIO controllers, which are determined by the gpio-controller
property. Each GPIO controller presents a list of the allocated pins and their owners, taken from gpios
properties, -pins
properties, and pinctrl
properties.
The pin icon to the left of each GPIO pin indicates whether a pin is connected. A filled-in icon indicates a connected pin, and an empty icon indicates an unconnected pin.
Flash¶
This is a list of all flash controllers, or nodes, based on the soc-nv-flash
type binding. If the flash controllers contain a fixed-partitions
node, each partition is listed with their size and address. Any unallocated space in the flash area is also listed.
Interrupts¶
This is a list of all interrupt controllers determined by the interrupt-controller
property. It lists the allocated interrupts on the controller and their users, as well as any other available information, such as their priority and index.
Buses¶
This is a list of all known buses on the device determined by the bus
entry in the node's type binding. It lists important properties of the bus, such as clock speed and flow control, as well each node on the bus and their address if the bus has an address space. If the bus is an SPI bus, the chip select configuration of each node is also listed if it is known.
ADCs¶
This is a list of all ADC controllers on the device, or nodes, based on the adc-controller
type binding. Each ADC controller contains a list of all allocated channels based on references made to the ADC instances using the io-channels
property.
Devictree View interaction options¶
The View offers several interaction options.
Access to the Devicetree Visual Editor¶
Click the context devicetree file name to open it in the Editor. You can then access the Devicetree Visual Editor using the Show Visual Editor button, highlighted in the following image.
Tip
You can use the workbench.editorAssociations
parameter in the Visual Studio Code Settings to set the Devicetree Visual Editor to show by default instead of the Text Editor when you open .dts
or .overlay
files.
Compiled output preview¶
Click the Show Compiled Devicetree Output button to view the compiled devicetree output file. A new screen opens with the compiled output in one file. Click on any context item in the View and the compiled output will jump to that section in the code.
Definition source file info¶
Selecting a line from the compiled devicetree output file lets you see the source of that definition at the end of that line.
Option to Copy C Identifier of Node¶
You can copy references to a node or property from a devicetree file and paste them into your C code directly from the Devicetree View. The Copy C Identifier of Node option is available in the More actions... menu. See How to copy C identifiers for more information.