DeviceTree for the Zephyr ProjectDeviceTree language support for the Zephyr project in VS Code. This extension is an independent community contribution, and is not part of the Zephyr Project. Features
Copy C identifiersWhile selecting a node, property or value in a DeviceTree file, right click and select "DeviceTree: Copy C identifier to clipboard" to copy the matching C identifier. If the selected symbol has a corresponding C macro, like Manage DeviceTree contextsIf you work with more than one application or board, you'll have multiple sets of DeviceTree contexts - one for each of your builds. Every time you open a new DeviceTree file, the extension will add a DeviceTree context (unless this file is already part of an existing context). Each context corresponds to a single compiled DeviceTree file that goes into a build, and consists of a board file and a list of overlay files. The DeviceTree contexts show up in the explorer sidebar: The DeviceTree contexts can be saved in a context file by pressing the Save button on the DeviceTree context explorer. This allows you to restore the contexts the next time you open the folder. The location of the context file can be changed by setting the "devicetree.ctxFile" configuration entry in the VS Code settings. It's possible to add shield files to the same context by pressing "DeviceTree: Add Shield..." on the context in the DeviceTree context explorer. Shield files will be processed ahead of the overlay file. DeviceTree overviewEach DeviceTree context presents an overview over common resources and their users. Each entry in the overview is linked with a specific node or property in the DeviceTree, and pressing them will go to the primary definition to the linked node or property. GPIO: A list of all known gpio controllers, determined by the Flash A list of all flash controllers, i.e. nodes based on the Interrupts A list of all interrupt controllers, determined by the Buses A list of all known buses on the device, determined by the ADCs A list of all ADC controllers on the device, i.e. nodes based on the DACs A list of all DAC controllers on the device, i.e. nodes based on the Clocks A list of all clock controllers on the device, i.e. nodes based on the Bindings files code completion and schema validationThe DeviceTree bindings are described in yaml files. This extension provides a schema file for Red Hat's YAML extension, which provides code completion, documentation and validation for YAML files under dts/bindings. C file macro argument completionThe extension will use data from the most recent DeviceTree context to provide completion items for the arguments of the following macros in C:
InstallationThe extension can be installed from the Visual Studio Extension marketplace. It's also possible to download specific releases from the GitHub repository by picking a devicetree-X.X.X.vsix package from the GitHub releases tab. Open Visual Studio Code and run the "Install from VSIX..." command, either through the command palette (Ctrl+Shift+P) or by opening the extensions panel, and pressing the ... menu in the top corner. Locate the VSIX package, press "Install" and reload Visual Studio Code once prompted. |