# eclipse-cdt-cloud/vscode-peripheral-inspector architecture

> Architecture diagram of the GitHub repository eclipse-cdt-cloud/vscode-peripheral-inspector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eclipse-cdt-cloud/vscode-peripheral-inspector
- Repository: https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector

## Overview

Peripheral Inspector is a VS Code extension for loading SVD peripheral definitions, displaying their register trees, and reading or editing live device values. The main flow starts with a debug session and configured definition path, resolves or parses peripheral data, builds session-specific nodes, and presents them in the peripheral view. The README also documents CMSIS pack selection, custom file-format providers, search, refresh, export, editing, and layout and ignore settings. Relationships below use excerpts, source-index references, or README statements; some detailed UI and integration wiring was not sampled.

Main entry points: [`src/entry-points`](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/tree/main/src/entry-points) (Extension entry points), [`src/svd-resolver.ts`](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/svd-resolver.ts) (SVD resolution), [`src/model/peripheral/tree/peripheral-session-tree.ts`](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/tree/peripheral-session-tree.ts) (Session tree loading), [`src/views/peripheral/peripheral-view.tsx`](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/views/peripheral/peripheral-view.tsx) (Peripheral view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Extension runtime"]
  node_extension["Extension entry points"]
  node_commands["Commands and actions<br/>[commands.ts]"]
  node_configuration["Session configuration"]
  node_api["Extension API"]
end

subgraph group_definitions["Definition loading"]
  node_resolver["SVD resolution<br/>[svd-resolver.ts]"]
  node_cmsis_pack["CMSIS pack metadata"]
  node_session_tree["Session tree loading"]
  node_svd_parser["SVD parsing<br/>[svd-parser.ts]"]
  node_custom_provider["Custom format providers<br/>[api-types.ts]"]
end

subgraph group_device["Debug data"]
  node_data_tracker["Peripheral data tracker"]
  node_peripheral_nodes["Peripheral nodes<br/>[peripheral-node.ts]"]
  node_register_nodes["Register and field nodes"]
  node_memory_utils["Memory read utilities<br/>[memreadutils.ts]"]
end

subgraph group_presentation["Peripheral interface"]
  node_data_provider["Peripheral data provider"]
  node_view_provider["Peripheral view provider"]
  node_view["Peripheral view"]
  node_resource_converter["Register export conversion"]
  node_dto["Peripheral data models<br/>[peripheral-dto.ts]"]
end

node_developer(("Extension user"))
node_vscode["VS Code"]
node_device_target["Debug target"]
node_pack_service["CMSIS pack assets"]

node_developer -->|"configures and operates"| node_vscode
node_vscode -.->|"activates"| node_extension
node_extension -->|"registers"| node_commands
node_extension -->|"uses"| node_configuration
node_extension -->|"initializes"| node_data_tracker
node_extension -->|"uses"| node_resolver
node_extension -->|"registers"| node_view_provider
node_developer -->|"sets definition path"| node_configuration
node_configuration -.->|"provides configuration"| node_resolver
node_resolver -->|"reads pack metadata"| node_cmsis_pack
node_resolver -->|"resolves pack assets"| node_pack_service
node_resolver -.->|"supplies definition path"| node_session_tree
node_session_tree -->|"parses SVD data"| node_svd_parser
node_session_tree -->|"invokes provider"| node_custom_provider
node_developer -->|"registers providers"| node_api
node_data_tracker -->|"creates session trees"| node_session_tree
node_session_tree -.->|"builds peripheral nodes"| node_peripheral_nodes
node_peripheral_nodes -->|"contains register nodes"| node_register_nodes
node_register_nodes -->|"writes register values"| node_device_target
node_peripheral_nodes -.->|"reads peripheral memory"| node_memory_utils
node_data_tracker -->|"supplies updates"| node_data_provider
node_view_provider -.->|"uses data provider"| node_data_provider
node_view_provider -.->|"provides peripheral view"| node_view
node_view -->|"exports registers"| node_resource_converter
node_view -->|"renders peripheral data"| node_dto
node_developer -->|"searches refreshes edits"| node_view
node_developer -->|"exports registers"| node_view

click node_extension "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/tree/main/src/entry-points"
click node_commands "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/commands.ts"
click node_configuration "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/tree/peripheral-configuration-provider.ts"
click node_api "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/peripheral-inspector-api.ts"
click node_resolver "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/svd-resolver.ts"
click node_cmsis_pack "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/tree/main/src/cmsis-pack"
click node_session_tree "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/tree/peripheral-session-tree.ts"
click node_svd_parser "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/svd-parser.ts"
click node_custom_provider "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/api-types.ts"
click node_data_tracker "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/tree/peripheral-data-tracker.ts"
click node_peripheral_nodes "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/nodes/peripheral-node.ts"
click node_register_nodes "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/nodes/peripheral-register-node.ts"
click node_memory_utils "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/memreadutils.ts"
click node_data_provider "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/views/peripheral/peripheral-data-provider.ts"
click node_view_provider "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/views/peripheral/peripheral-view-provider.ts"
click node_view "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/views/peripheral/peripheral-view.tsx"
click node_resource_converter "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/views/peripheral/peripheral-resource-converter.ts"
click node_dto "https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/common/peripheral-dto.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extension,node_commands,node_configuration,node_api,node_developer toneBlue
class node_resolver,node_cmsis_pack,node_session_tree,node_svd_parser,node_custom_provider toneAmber
class node_data_tracker,node_peripheral_nodes,node_register_nodes,node_memory_utils toneMint
class node_data_provider,node_view_provider,node_view,node_resource_converter,node_dto toneRose
class node_vscode,node_device_target,node_pack_service toneIndigo
```

## Components

### Extension runtime

- [Extension entry points](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/tree/main/src/entry-points): `src/entry-points`
- [Commands and actions](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/commands.ts): `src/commands.ts`
- [Session configuration](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/tree/peripheral-configuration-provider.ts): `src/model/peripheral/tree/peripheral-configuration-provider.ts`
- [Extension API](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/peripheral-inspector-api.ts): `src/peripheral-inspector-api.ts`

### Definition loading

- [SVD resolution](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/svd-resolver.ts): `src/svd-resolver.ts`
- [CMSIS pack metadata](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/tree/main/src/cmsis-pack): `src/cmsis-pack`
- [Session tree loading](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/tree/peripheral-session-tree.ts): `src/model/peripheral/tree/peripheral-session-tree.ts`
- [SVD parsing](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/svd-parser.ts): `src/svd-parser.ts`
- [Custom format providers](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/api-types.ts): `src/api-types.ts`

### Debug data

- [Peripheral data tracker](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/tree/peripheral-data-tracker.ts): `src/model/peripheral/tree/peripheral-data-tracker.ts`
- [Peripheral nodes](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/nodes/peripheral-node.ts): `src/model/peripheral/nodes/peripheral-node.ts`
- [Register and field nodes](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/model/peripheral/nodes/peripheral-register-node.ts): `src/model/peripheral/nodes/peripheral-register-node.ts`
- [Memory read utilities](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/memreadutils.ts): `src/memreadutils.ts`

### Peripheral interface

- [Peripheral data provider](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/views/peripheral/peripheral-data-provider.ts): `src/views/peripheral/peripheral-data-provider.ts`
- [Peripheral view provider](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/views/peripheral/peripheral-view-provider.ts): `src/views/peripheral/peripheral-view-provider.ts`
- [Peripheral view](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/views/peripheral/peripheral-view.tsx): `src/views/peripheral/peripheral-view.tsx`
- [Register export conversion](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/views/peripheral/peripheral-resource-converter.ts): `src/views/peripheral/peripheral-resource-converter.ts`
- [Peripheral data models](https://github.com/eclipse-cdt-cloud/vscode-peripheral-inspector/blob/main/src/common/peripheral-dto.ts): `src/common/peripheral-dto.ts`

### Other components

- **Extension user**
- **VS Code**
- **Debug target**
- **CMSIS pack assets**

## Connections

- Extension user → VS Code: configures and operates (evidence: `README.md`)
- VS Code → Extension entry points: activates
- Extension entry points → Commands and actions: registers (evidence: `src/entry-points/desktop/extension.ts`)
- Extension entry points → Session configuration: uses (evidence: `src/entry-points/desktop/extension.ts`)
- Extension entry points → Peripheral data tracker: initializes (evidence: `src/entry-points/desktop/extension.ts`)
- Extension entry points → SVD resolution: uses (evidence: `src/entry-points/desktop/extension.ts`)
- Extension entry points → Peripheral view provider: registers (evidence: `src/entry-points/desktop/extension.ts`)
- Extension user → Session configuration: sets definition path (evidence: `README.md`)
- Session configuration → SVD resolution: provides configuration (evidence: `src/svd-resolver.ts`)
- SVD resolution → CMSIS pack metadata: reads pack metadata (evidence: `src/svd-resolver.ts`)
- SVD resolution → CMSIS pack assets: resolves pack assets (evidence: `README.md`)
- SVD resolution → Session tree loading: supplies definition path
- Session tree loading → SVD parsing: parses SVD data (evidence: `src/model/peripheral/tree/peripheral-session-tree.ts`)
- Session tree loading → Custom format providers: invokes provider (evidence: `src/model/peripheral/tree/peripheral-session-tree.ts`)
- Extension user → Extension API: registers providers (evidence: `README.md`)
- Peripheral data tracker → Session tree loading: creates session trees (evidence: `src/model/peripheral/tree/peripheral-data-tracker.ts`)
- Session tree loading → Peripheral nodes: builds peripheral nodes (evidence: `src/model/peripheral/nodes/peripheral-node.ts`)
- Peripheral nodes → Register and field nodes: contains register nodes (evidence: `src/model/peripheral/nodes/peripheral-node.ts`)
- Register and field nodes → Debug target: writes register values (evidence: `src/model/peripheral/nodes/peripheral-register-node.ts`)
- Peripheral nodes → Memory read utilities: reads peripheral memory (evidence: `src/model/peripheral/nodes/peripheral-node.ts`)
- Peripheral data tracker → Peripheral data provider: supplies updates (evidence: `src/model/peripheral/tree/peripheral-data-tracker.ts`)
- Peripheral view provider → Peripheral data provider: uses data provider
- Peripheral view provider → Peripheral view: provides peripheral view
- Peripheral view → Register export conversion: exports registers (evidence: `src/views/peripheral/peripheral-view.tsx`)
- Peripheral view → Peripheral data models: renders peripheral data (evidence: `src/views/peripheral/peripheral-view.tsx`)
- Extension user → Peripheral view: searches refreshes edits (evidence: `README.md`)
- Extension user → Peripheral view: exports registers (evidence: `README.md`)
