@typecad/cuttlefish 1.0.0-alpha.13 → 1.0.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -79
- package/assets/editor-extensions/typecad-debug/README.md +141 -0
- package/assets/editor-extensions/typecad-debug/out/extension.js +347 -0
- package/assets/editor-extensions/typecad-debug/out/extension.js.map +1 -0
- package/assets/editor-extensions/typecad-debug/package.json +76 -0
- package/assets/editor-extensions/typecad-ui/LICENSE +27 -0
- package/assets/editor-extensions/typecad-ui/README.md +52 -0
- package/assets/editor-extensions/typecad-ui/file-icon-dark.png +0 -0
- package/assets/editor-extensions/typecad-ui/file-icon-light.png +0 -0
- package/assets/editor-extensions/typecad-ui/icon.png +0 -0
- package/assets/editor-extensions/typecad-ui/language-configuration.json +43 -0
- package/assets/editor-extensions/typecad-ui/package.json +54 -0
- package/assets/editor-extensions/typecad-ui/snippets/typecad-ui.json +80 -0
- package/assets/editor-extensions/typecad-ui/syntaxes/markdown-ui.json +45 -0
- package/assets/editor-extensions/typecad-ui/syntaxes/typecad-ui.tmLanguage.json +1269 -0
- package/dist/api/config.d.ts +30 -27
- package/dist/api/schema/types.d.ts +20 -3
- package/dist/api/shared/async-runtime-static.d.ts +1 -1
- package/dist/api/shared/async-runtime-static.js +5 -5
- package/dist/api/shared/async-types.d.ts +3 -2
- package/dist/api/shared/board-catalog.d.ts +2 -0
- package/dist/api/shared/board-catalog.js +6 -0
- package/dist/api/shared/board-resolver.d.ts +4 -7
- package/dist/api/shared/board-resolver.js +2 -1
- package/dist/api/shared/coop-scheduler.d.ts +1 -1
- package/dist/api/shared/coop-scheduler.js +1 -1
- package/dist/api/shared/cpp-type-ir.d.ts +1 -1
- package/dist/api/shared/cpp-type-ir.js +1 -1
- package/dist/api/shared/display-profile.d.ts +1 -1
- package/dist/api/shared/display-profile.js +3 -5
- package/dist/api/shared/framework-manifest-registry.d.ts +1 -1
- package/dist/api/shared/framework-manifest-registry.js +0 -1
- package/dist/api/shared/framework-manifest.d.ts +65 -507
- package/dist/api/shared/framework-manifest.js +6 -11
- package/dist/api/shared/hal-op-ir.d.ts +294 -685
- package/dist/api/shared/hal-op-ir.js +31 -65
- package/dist/api/shared/index.d.ts +0 -4
- package/dist/api/shared/index.js +1 -7
- package/dist/api/shared/ir-core.d.ts +6 -0
- package/dist/api/shared/ir-declarations.d.ts +4 -0
- package/dist/api/shared/ir.d.ts +1 -3
- package/dist/api/shared/platform-strategy.d.ts +14 -37
- package/dist/api/shared/polyfill-helper-registry.js +0 -5
- package/dist/api/shared/polyfill-types.js +0 -27
- package/dist/api/shared/promise-runtime.js +3 -3
- package/dist/api/shared/spdx-licenses.d.ts +12 -10
- package/dist/api/shared/spdx-licenses.js +1 -1
- package/dist/api/shared/toolchain-types.d.ts +1 -1
- package/dist/api/shared/toolchain-types.js +3 -3
- package/dist/api/shared/types.d.ts +0 -3
- package/dist/api/shared/validate-framework-manifest.js +13 -33
- package/dist/board-catalog/dts-reader.d.ts +220 -0
- package/dist/board-catalog/dts-reader.js +1052 -0
- package/dist/board-catalog/index.d.ts +11 -0
- package/dist/board-catalog/index.js +12 -0
- package/dist/board-catalog/pinconfig.d.ts +48 -0
- package/dist/board-catalog/pinconfig.js +263 -0
- package/dist/board-catalog/sdk.d.ts +82 -0
- package/dist/board-catalog/sdk.js +180 -0
- package/dist/board-catalog/store.d.ts +196 -0
- package/dist/board-catalog/store.js +363 -0
- package/dist/board-catalog/types.d.ts +233 -0
- package/dist/board-catalog/types.js +7 -0
- package/dist/board-catalog/walker.d.ts +112 -0
- package/dist/board-catalog/walker.js +1101 -0
- package/dist/cli-utils.d.ts +2 -2
- package/dist/cli-utils.js +5 -5
- package/dist/cli.js +227 -244
- package/dist/config-loader.d.ts +14 -19
- package/dist/config-loader.js +242 -78
- package/dist/config-schema.d.ts +19 -227
- package/dist/config-schema.js +9 -8
- package/dist/contract/board-generator.d.ts +4 -4
- package/dist/contract/board-generator.js +16 -5
- package/dist/contract/contract-parser.d.ts +36 -127
- package/dist/contract/contract-parser.js +76 -0
- package/dist/contract/index.d.ts +1 -1
- package/dist/contract/index.js +70 -21
- package/dist/create/active-board-catalog.d.ts +9 -0
- package/dist/create/active-board-catalog.js +94 -0
- package/dist/create/board-catalog.generated.d.ts +96 -0
- package/dist/create/board-catalog.generated.js +128737 -0
- package/dist/create/board-search.d.ts +23 -0
- package/dist/create/board-search.js +88 -0
- package/dist/create/editor-integration.d.ts +32 -0
- package/dist/create/editor-integration.js +257 -0
- package/dist/create/eslint-rules-template.d.ts +2 -2
- package/dist/create/framework-catalog.d.ts +48 -8
- package/dist/create/framework-catalog.js +58 -44
- package/dist/create/index.d.ts +8 -13
- package/dist/create/index.js +5 -9
- package/dist/create/mcu-target.d.ts +39 -0
- package/dist/create/mcu-target.js +80 -0
- package/dist/create/pack-targets.d.ts +19 -0
- package/dist/create/pack-targets.js +56 -0
- package/dist/create/{init-scaffold.d.ts → scaffold.d.ts} +8 -11
- package/dist/create/{init-scaffold.js → scaffold.js} +28 -87
- package/dist/create/templates.d.ts +51 -0
- package/dist/create/{init-templates.js → templates.js} +135 -116
- package/dist/create/wizard.d.ts +19 -0
- package/dist/create/wizard.js +314 -0
- package/dist/debug/preprocessor.d.ts +5 -0
- package/dist/debug/preprocessor.js +31 -7
- package/dist/diagnostics/diagnostics-report.d.ts +1 -1
- package/dist/diagnostics/diagnostics-report.js +3 -11
- package/dist/diagnostics/json-schema.d.ts +1 -1
- package/dist/diagnostics/md-writer.js +2 -2
- package/dist/diagnostics/mermaid-builder.d.ts +1 -1
- package/dist/diagnostics/mermaid-builder.js +1 -1
- package/dist/emit/cpp-emitter.js +4 -1
- package/dist/emit/emitters/class-emitter.js +32 -4
- package/dist/emit/emitters/emitter-context.d.ts +11 -0
- package/dist/emit/emitters/entrypoint-synthesizer.js +1 -1
- package/dist/emit/emitters/function-emitter-impl.js +33 -17
- package/dist/emit/emitters/output-finalizer.d.ts +7 -0
- package/dist/emit/emitters/output-finalizer.js +31 -23
- package/dist/emit/emitters/setup.js +147 -63
- package/dist/emit/emitters/top-level-prep.js +1 -1
- package/dist/emit/emitters/type-decl-emitter.js +13 -8
- package/dist/emit/emitters/ui-emitter.js +1 -1
- package/dist/emit/expression-renderer.d.ts +3 -3
- package/dist/emit/expression-renderer.js +17 -7
- package/dist/emit/route-hal-op.js +17 -48
- package/dist/emit/snprintf-helpers.d.ts +1 -3
- package/dist/emit/snprintf-helpers.js +1 -39
- package/dist/emit/statement-renderer.d.ts +0 -4
- package/dist/emit/statement-renderer.js +54 -45
- package/dist/emit/utils/async-state-machine.d.ts +16 -9
- package/dist/emit/utils/async-state-machine.js +56 -54
- package/dist/emit/utils/comment-helpers.d.ts +0 -8
- package/dist/emit/utils/comment-helpers.js +1 -1
- package/dist/emit/utils/cpp-helpers.d.ts +2 -2
- package/dist/emit/utils/cpp-helpers.js +2 -2
- package/dist/emit/utils/hal-op-cpp-type.js +4 -6
- package/dist/emit/utils/index.d.ts +3 -3
- package/dist/emit/utils/index.js +3 -3
- package/dist/emit/utils/type-inference.d.ts +1 -29
- package/dist/emit/utils/type-inference.js +0 -75
- package/dist/framework-package.d.ts +3 -0
- package/dist/framework-package.js +23 -6
- package/dist/framework-registry.d.ts +5 -5
- package/dist/frameworks/native/graphics/terminal-preview.d.ts +5 -0
- package/dist/frameworks/native/graphics/terminal-preview.js +33 -0
- package/dist/frameworks/native/index.d.ts +3 -0
- package/dist/frameworks/native/index.js +15 -0
- package/dist/frameworks/native/native-compile.d.ts +17 -0
- package/dist/frameworks/native/native-compile.js +170 -0
- package/dist/frameworks/native/native-config.d.ts +41 -0
- package/dist/frameworks/native/native-config.js +7 -0
- package/dist/frameworks/native/strategy.d.ts +97 -0
- package/dist/frameworks/native/strategy.js +664 -0
- package/dist/ir/board-resolver.d.ts +18 -23
- package/dist/ir/board-resolver.js +43 -401
- package/dist/ir/build-ir-state.d.ts +3 -0
- package/dist/ir/build-ir-state.js +42 -0
- package/dist/ir/build-ir.d.ts +1 -1
- package/dist/ir/build-ir.js +64 -45
- package/dist/ir/declaration-builders.js +1 -0
- package/dist/ir/expression-to-ir.js +17 -10
- package/dist/ir/hal/hal-emitter.d.ts +0 -2
- package/dist/ir/hal/hal-emitter.js +92 -41
- package/dist/ir/hal/hal-parser.d.ts +5 -5
- package/dist/ir/hal/hal-parser.js +128 -36
- package/dist/ir/hal/hal-plugins.d.ts +0 -1
- package/dist/ir/hal/hal-plugins.js +425 -716
- package/dist/ir/heap-analysis.js +2 -41
- package/dist/ir/identifier-collector.js +32 -20
- package/dist/ir/network-validation.js +7 -11
- package/dist/ir/ownership-analysis.js +75 -13
- package/dist/ir/peripheral-usage.d.ts +8 -2
- package/dist/ir/peripheral-usage.js +78 -149
- package/dist/ir/peripheral-validation.js +23 -3
- package/dist/ir/pin-capability-validation.d.ts +12 -0
- package/dist/ir/pin-capability-validation.js +61 -97
- package/dist/ir/pin-mode-validation.js +5 -5
- package/dist/ir/program-analysis.d.ts +8 -15
- package/dist/ir/program-analysis.js +140 -323
- package/dist/ir/pulldown-validation.js +11 -4
- package/dist/ir/resource-analysis.js +15 -3
- package/dist/ir/statement-to-ir.js +0 -6
- package/dist/ir/timing-validation.js +1 -1
- package/dist/ir/transformers/array-methods.js +11 -5
- package/dist/ir/transformers/call-statement.js +20 -87
- package/dist/ir/transformers/callback-context-registry.d.ts +1 -1
- package/dist/ir/transformers/callback-context-registry.js +8 -16
- package/dist/ir/transformers/control-flow.js +0 -13
- package/dist/ir/transformers/expressions.js +10 -9
- package/dist/ir/transformers/hal-call-resolver.d.ts +2 -2
- package/dist/ir/transformers/hal-call-resolver.js +24 -10
- package/dist/ir/transformers/hal-emit-helpers.d.ts +2 -2
- package/dist/ir/transformers/hal-emit-helpers.js +2 -2
- package/dist/ir/transformers/namespace-methods.js +1 -1
- package/dist/ir/transformers/ui-callback-lowering.d.ts +0 -2
- package/dist/ir/transformers/ui-callback-lowering.js +0 -24
- package/dist/ir/transformers/variables.js +338 -42
- package/dist/ir/try-catch-validation.js +4 -3
- package/dist/ir/type-resolution.js +15 -4
- package/dist/ir/validation-orchestrator.js +0 -9
- package/dist/libdef/cpp-to-decl.d.ts +0 -9
- package/dist/libdef/cpp-to-decl.js +0 -72
- package/dist/libdef/registry.d.ts +0 -1
- package/dist/libdef/registry.js +1 -24
- package/dist/library/catalog.d.ts +35 -0
- package/dist/library/catalog.js +67 -0
- package/dist/library/cli.d.ts +2 -0
- package/dist/library/cli.js +168 -0
- package/dist/library/init.d.ts +25 -0
- package/dist/library/init.js +397 -0
- package/dist/library/install.d.ts +9 -0
- package/dist/library/install.js +80 -0
- package/dist/library/registry-search.d.ts +34 -0
- package/dist/library/registry-search.js +50 -0
- package/dist/library/validate.d.ts +17 -0
- package/dist/library/validate.js +175 -0
- package/dist/library-packages.d.ts +95 -0
- package/dist/library-packages.js +275 -0
- package/dist/mapping/peripheral-names.js +9 -4
- package/dist/mapping/source-map.d.ts +3 -4
- package/dist/mapping/source-map.js +12 -18
- package/dist/orchestrator/graph-builder.d.ts +3 -3
- package/dist/orchestrator/graph-builder.js +29 -12
- package/dist/orchestrator/type-checker.d.ts +3 -3
- package/dist/orchestrator/type-checker.js +3 -3
- package/dist/platform/async-runtime.js +1 -1
- package/dist/platform/coop-scheduler-runtime.js +2 -2
- package/dist/platform/generic-debug-codegen.d.ts +36 -0
- package/dist/platform/generic-debug-codegen.js +185 -0
- package/dist/platform/generic-strategy.d.ts +3 -4
- package/dist/platform/generic-strategy.js +5 -80
- package/dist/platform/index.js +1 -1
- package/dist/platform/registry.d.ts +2 -2
- package/dist/platform/registry.js +2 -2
- package/dist/preview/client.js +17 -3
- package/dist/safety/asil-decorators.d.ts +32 -0
- package/dist/safety/asil-decorators.js +32 -0
- package/dist/safety/authoring.d.ts +85 -0
- package/dist/safety/authoring.js +61 -0
- package/dist/safety/engine.d.ts +3 -0
- package/dist/safety/engine.js +83 -0
- package/dist/safety/hal/ops.d.ts +48 -0
- package/dist/safety/hal/ops.js +46 -0
- package/dist/safety/iso26262/analyze.d.ts +13 -0
- package/dist/safety/iso26262/analyze.js +29 -0
- package/dist/safety/iso26262/asil.d.ts +10 -0
- package/dist/safety/iso26262/asil.js +22 -0
- package/dist/safety/iso26262/collect.d.ts +14 -0
- package/dist/safety/iso26262/collect.js +137 -0
- package/dist/safety/iso26262/goto-checker.d.ts +10 -0
- package/dist/safety/iso26262/goto-checker.js +72 -0
- package/dist/safety/iso26262/heap-checker.d.ts +7 -0
- package/dist/safety/iso26262/heap-checker.js +57 -0
- package/dist/safety/iso26262/init-checker.d.ts +13 -0
- package/dist/safety/iso26262/init-checker.js +127 -0
- package/dist/safety/iso26262/loop-checker.d.ts +7 -0
- package/dist/safety/iso26262/loop-checker.js +86 -0
- package/dist/safety/iso26262/recursion-checker.d.ts +9 -0
- package/dist/safety/iso26262/recursion-checker.js +134 -0
- package/dist/safety/iso26262/sidecar-writer.d.ts +25 -0
- package/dist/safety/iso26262/sidecar-writer.js +13 -0
- package/dist/safety/passes/pinMode-intercept.d.ts +3 -0
- package/dist/safety/passes/pinMode-intercept.js +60 -0
- package/dist/safety/runtime/mode-table.d.ts +5 -0
- package/dist/safety/runtime/mode-table.js +55 -0
- package/dist/safety/runtime/polyfills.d.ts +6 -0
- package/dist/safety/runtime/polyfills.js +12 -0
- package/dist/safety/runtime/result-struct.d.ts +11 -0
- package/dist/safety/runtime/result-struct.js +98 -0
- package/dist/safety/runtime/safe-int.d.ts +33 -0
- package/dist/safety/runtime/safe-int.js +170 -0
- package/dist/safety/runtime/safe-traits.d.ts +4 -0
- package/dist/safety/runtime/safe-traits.js +95 -0
- package/dist/safety/runtime/safe-variable.d.ts +39 -0
- package/dist/safety/runtime/safe-variable.js +226 -0
- package/dist/safety/runtime/vote.d.ts +8 -0
- package/dist/safety/runtime/vote.js +92 -0
- package/dist/safety/runtime/write-verify.d.ts +8 -0
- package/dist/safety/runtime/write-verify.js +71 -0
- package/dist/safety/safe-int-types.d.ts +45 -0
- package/dist/safety/safe-int-types.js +25 -0
- package/dist/safety/safe-variable-types.d.ts +29 -0
- package/dist/safety/safe-variable-types.js +19 -0
- package/dist/safety/safety-bridge.d.ts +5 -6
- package/dist/safety/safety-bridge.js +15 -28
- package/dist/safety/sidecar-bridge.d.ts +1 -3
- package/dist/safety/sidecar-bridge.js +3 -20
- package/dist/safety/specifiers.d.ts +6 -0
- package/dist/safety/specifiers.js +14 -0
- package/dist/safety-hook.d.ts +8 -7
- package/dist/safety-hook.js +12 -13
- package/dist/testing.d.ts +5 -6
- package/dist/testing.js +5 -5
- package/dist/transpile/resolution.d.ts +1 -1
- package/dist/transpile/resolution.js +18 -9
- package/dist/transpile/test-pins.d.ts +18 -0
- package/dist/transpile/test-pins.js +142 -0
- package/dist/transpile.d.ts +1 -2
- package/dist/transpile.js +90 -29
- package/dist/types.d.ts +45 -26
- package/dist/ui-hook.d.ts +1 -1
- package/dist/utils/cli.d.ts +2 -2
- package/dist/utils/cli.js +160 -157
- package/dist/utils/fs.d.ts +3 -4
- package/dist/utils/fs.js +4 -5
- package/dist/utils/strings.d.ts +0 -1
- package/dist/utils/strings.js +0 -8
- package/dist/utils/ui.d.ts +5 -2
- package/dist/utils/ui.js +13 -3
- package/package.json +158 -149
- package/dist/add-preset.d.ts +0 -4
- package/dist/add-preset.js +0 -74
- package/dist/api/shared/async-symbol-detector.d.ts +0 -11
- package/dist/api/shared/async-symbol-detector.js +0 -140
- package/dist/api/shared/native-display-op-resolver.d.ts +0 -10
- package/dist/api/shared/native-display-op-resolver.js +0 -64
- package/dist/create/board-checklist.d.ts +0 -2
- package/dist/create/board-checklist.js +0 -52
- package/dist/create/board-codegen.d.ts +0 -9
- package/dist/create/board-codegen.js +0 -238
- package/dist/create/board-generators.d.ts +0 -12
- package/dist/create/board-generators.js +0 -651
- package/dist/create/board-spec.d.ts +0 -637
- package/dist/create/board-spec.js +0 -214
- package/dist/create/init-templates.d.ts +0 -28
- package/dist/create/init-wizard.d.ts +0 -8
- package/dist/create/init-wizard.js +0 -182
- package/dist/install/framework-catalog.d.ts +0 -53
- package/dist/install/framework-catalog.js +0 -107
- package/dist/install/handle-install.d.ts +0 -35
- package/dist/install/handle-install.js +0 -177
- package/dist/install/index.d.ts +0 -4
- package/dist/install/index.js +0 -3
- package/dist/ir/pin-state-tracking.d.ts +0 -58
- package/dist/ir/pin-state-tracking.js +0 -182
- package/dist/ir/pwm-timer-sharing.d.ts +0 -4
- package/dist/ir/pwm-timer-sharing.js +0 -94
- package/dist/ir/timer0-pwm-timing-conflict.d.ts +0 -4
- package/dist/ir/timer0-pwm-timing-conflict.js +0 -72
- package/dist/libdef/component-decls.d.ts +0 -2
- package/dist/libdef/component-decls.js +0 -6
- package/dist/libdef/component-discovery.d.ts +0 -43
- package/dist/libdef/component-discovery.js +0 -83
- package/dist/theme-tokens.d.ts +0 -22
- package/dist/theme-tokens.js +0 -172
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/** A GPIO reference inside the devicetree: controller nodelabel + pin + flags. */
|
|
2
|
+
export interface DtsGpioRef {
|
|
3
|
+
/** Controller nodelabel, e.g. 'gpioa', 'gpio0'. */
|
|
4
|
+
readonly controller: string;
|
|
5
|
+
/** Pin number within the controller. */
|
|
6
|
+
readonly pin: number;
|
|
7
|
+
/** Raw flag tokens as written (macros stay opaque): ['GPIO_ACTIVE_LOW', 'GPIO_PULL_UP']. */
|
|
8
|
+
readonly flags: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
/** A gpio-leds / gpio-keys child with its devicetree alias when aliased. */
|
|
11
|
+
export interface DtsGpioNode extends DtsGpioRef {
|
|
12
|
+
/** Node's own nodelabel, e.g. 'user_led', 'button0'. */
|
|
13
|
+
readonly nodelabel: string;
|
|
14
|
+
/** Devicetree alias pointing here, e.g. 'led0', 'sw0' (from the aliases node). */
|
|
15
|
+
readonly alias?: string;
|
|
16
|
+
}
|
|
17
|
+
/** A connector nexus (e.g. the XIAO's D0–D10 gpio-map). */
|
|
18
|
+
export interface DtsConnector {
|
|
19
|
+
/** Connector nodelabel, e.g. 'xiao_d', 'arduino_header_d'. */
|
|
20
|
+
readonly nodelabel: string;
|
|
21
|
+
/** Compatible string, e.g. 'seeed,xiao-gpio', 'arduino-header-r3'. */
|
|
22
|
+
readonly compatible?: string;
|
|
23
|
+
/** Silkscreen-ish label (from the map's trailing comments) → ref. */
|
|
24
|
+
readonly pins: Readonly<Record<string, DtsGpioRef>>;
|
|
25
|
+
}
|
|
26
|
+
/** Everything the reader could extract from one board DTS (post local includes). */
|
|
27
|
+
export interface DtsBoardFacts {
|
|
28
|
+
/** alias name → nodelabel ('led0' → 'user_led', 'sw0' → 'button0'). */
|
|
29
|
+
readonly aliases: Readonly<Record<string, string>>;
|
|
30
|
+
/** chosen property → nodelabel ('zephyr,console' → 'uart0'). */
|
|
31
|
+
readonly chosen: Readonly<Record<string, string>>;
|
|
32
|
+
/** gpio-leds children. */
|
|
33
|
+
readonly leds: readonly DtsGpioNode[];
|
|
34
|
+
/** gpio-keys children. */
|
|
35
|
+
readonly buttons: readonly DtsGpioNode[];
|
|
36
|
+
/** Connector nexus maps. */
|
|
37
|
+
readonly connectors: readonly DtsConnector[];
|
|
38
|
+
/** Wired analog channels from connector io-channel-maps, joined to pads
|
|
39
|
+
* through the connectors' gpio-maps (the DKs' A0-A5 ↔ AIN wiring). */
|
|
40
|
+
readonly connectorAdc: readonly {
|
|
41
|
+
source: string;
|
|
42
|
+
channel: number;
|
|
43
|
+
controller: string;
|
|
44
|
+
pin: number;
|
|
45
|
+
}[];
|
|
46
|
+
/** Name↔pinmux-value disagreement warnings from the pinctrl harvest —
|
|
47
|
+
* each names a route that was DROPPED as untrustworthy. Surfaced through
|
|
48
|
+
* the catalog record so board-module generation can report them. */
|
|
49
|
+
readonly pinctrlWarnings?: readonly string[];
|
|
50
|
+
/** Addressable user LED (worldsemi,ws2812-*): the pad driving the pixel.
|
|
51
|
+
* NOT a gpio-leds node — consumers must treat it as a plain GPIO LED
|
|
52
|
+
* (no led0 devicetree spec), same as a curated board override. */
|
|
53
|
+
readonly stripLed?: DtsGpioRef;
|
|
54
|
+
/** PWM-driven LEDs (pwm-leds children), in board order. `alias` is the
|
|
55
|
+
* devicetree alias ('pwm-led0') — the addressable form; non-aliased
|
|
56
|
+
* channels carry their controller+channel only. */
|
|
57
|
+
readonly pwmLeds: readonly DtsPwmLed[];
|
|
58
|
+
/** The board's USB device wiring: 'enabled' when the DTS turns the device
|
|
59
|
+
* controller on (zephyr_udc0/&usbd status okay), 'disabled' when it
|
|
60
|
+
* explicitly turns it off, undefined when the DTS is silent (the app
|
|
61
|
+
* overlay may still compose a CDC device). */
|
|
62
|
+
readonly usbDevice?: 'enabled' | 'disabled';
|
|
63
|
+
/** The USB device controller nodelabel backing usbDevice ('zephyr_udc0',
|
|
64
|
+
* or the board's own label for &usbd). */
|
|
65
|
+
readonly usbController?: string;
|
|
66
|
+
/** Bus controller nodelabels the board DTS wires up (&i2c0/&spi2/&usart1
|
|
67
|
+
* status-okay overrides; &ref blocks). Board-level facts only — a bus
|
|
68
|
+
* enabled solely in the SoC dtsi is invisible here, by design. */
|
|
69
|
+
readonly buses: {
|
|
70
|
+
readonly i2c: readonly string[];
|
|
71
|
+
readonly spi: readonly string[];
|
|
72
|
+
readonly uart: readonly string[];
|
|
73
|
+
};
|
|
74
|
+
/** Silicon PWM routes from the SoC pinctrl files the board's include
|
|
75
|
+
* chain reaches (STM32 vendor HAL ships per-soc *-pinctrl.dtsi with
|
|
76
|
+
* `tim4_ch1_pb6`-style nodes). Empty for SoCs whose pinctrl data lives
|
|
77
|
+
* elsewhere (Atmel C headers) or whose PWM is a matrix (ESP32 LEDC) —
|
|
78
|
+
* those are family conventions in the manifest generator. */
|
|
79
|
+
readonly pwmPins: readonly DtsPwmPin[];
|
|
80
|
+
/** Silicon analog-input routes from the SoC pinctrl files (STM32
|
|
81
|
+
* `adc1_in1_pa1`-style nodes). Same raw-harvest contract as pwmPins. */
|
|
82
|
+
readonly adcPins: readonly DtsAdcPin[];
|
|
83
|
+
/** Silicon analog-output routes from the SoC pinctrl files (STM32
|
|
84
|
+
* `dac1_out1_pa4`-style nodes). Same raw-harvest contract as pwmPins. */
|
|
85
|
+
readonly dacPins: readonly DtsDacPin[];
|
|
86
|
+
/** SoC-level ADC/DAC device nodelabels found in the include chain
|
|
87
|
+
* (adc1:/dac1: device nodes). Pinctrl routes whose source device is
|
|
88
|
+
* absent here are dropped by the manifest generator — a route for an
|
|
89
|
+
* undeclared device would emit DEVICE_DT_GET against nothing. */
|
|
90
|
+
readonly analogDevices: readonly string[];
|
|
91
|
+
/** SoC-level watchdog node reached through the include chain (compatible
|
|
92
|
+
* `*-watchdog`), for boards whose own DTS writes no watchdog0 alias —
|
|
93
|
+
* the hardware exists on nearly every SoC; the alias is authorial habit.
|
|
94
|
+
* Board-level watchdog0 alias wins over this. */
|
|
95
|
+
readonly wdtSocNode?: string;
|
|
96
|
+
/** ESP32 LEDC matrix controller nodelabel ('ledc0'), when the include
|
|
97
|
+
* chain declares one. */
|
|
98
|
+
readonly ledcNode?: string;
|
|
99
|
+
/** Labeled PWM controller device nodes in the include chain (nRF's
|
|
100
|
+
* psel-routed `pwm0`..`pwm3` — any GPIO pad can carry any of a
|
|
101
|
+
* peripheral's channels: the matrix the manifest generator synthesizes
|
|
102
|
+
* from, like the ESP32 LEDC). Sorted. */
|
|
103
|
+
readonly pwmNodes?: readonly string[];
|
|
104
|
+
/** Flash size in KB (the largest flash@ reg DT_SIZE_K across the include
|
|
105
|
+
* chain — the variant dtsi overrides the SoC default). Feeds the storage
|
|
106
|
+
* partition synthesis. */
|
|
107
|
+
readonly flashKb?: number;
|
|
108
|
+
/** True when the board's own chain already defines a storage_partition
|
|
109
|
+
* label — synthesis must not redeclare it (west errors on a doubly
|
|
110
|
+
* defined node). */
|
|
111
|
+
readonly hasStoragePartition?: boolean;
|
|
112
|
+
/** The board's own storage_partition reg, when the chain defines one —
|
|
113
|
+
* offset/size in bytes. Boards that ship the partition (ESP32 AMP layout)
|
|
114
|
+
* carry their real facts instead of a synthesized region; the overlay
|
|
115
|
+
* only writes the /chosen pointer for them, never a redeclaration. */
|
|
116
|
+
readonly storageReg?: {
|
|
117
|
+
offsetBytes: number;
|
|
118
|
+
sizeBytes: number;
|
|
119
|
+
};
|
|
120
|
+
/** Counter-capable devices reached through the include chain, in source
|
|
121
|
+
* order. Two forms: a labeled node whose compatible IS a counter
|
|
122
|
+
* (nRF `rtc1:` nordic,nrf-rtc; STM32 `rtc:` st,stm32-rtc — the counter
|
|
123
|
+
* driver binds the node itself), or an unlabeled `counter {}` child
|
|
124
|
+
* under a labeled timer parent (ESP32 timer0-2, Ambiq) — the manifest
|
|
125
|
+
* generator assigns those labels in the generated overlay. */
|
|
126
|
+
readonly counterNodes: readonly DtsCounterNode[];
|
|
127
|
+
/** GPIO controller device nodes (gpio-controller property) from the SoC
|
|
128
|
+
* dtsi include chain — the full port inventory, not just the ports the
|
|
129
|
+
* board's own facts name. Sorted by nodelabel. */
|
|
130
|
+
readonly gpioControllers: readonly DtsGpioController[];
|
|
131
|
+
}
|
|
132
|
+
/** A pwm-leds child: one PWM-driven LED channel. */
|
|
133
|
+
export interface DtsPwmLed {
|
|
134
|
+
/** Devicetree alias ('pwm-led0') when aliased — the DT_ALIAS addressing form. */
|
|
135
|
+
readonly alias?: string;
|
|
136
|
+
/** PWM controller nodelabel ('pwm1'). */
|
|
137
|
+
readonly controller: string;
|
|
138
|
+
readonly channel: number;
|
|
139
|
+
/** Period cell from the pwms property, when present. */
|
|
140
|
+
readonly periodNs?: number;
|
|
141
|
+
/** Flag tokens (PWM_POLARITY_INVERTED, …). Macro expressions like
|
|
142
|
+
* PWM_MSEC(20) are period shorthand — never flags. */
|
|
143
|
+
readonly flags?: readonly string[];
|
|
144
|
+
}
|
|
145
|
+
/** A silicon PWM route harvested from an SoC pinctrl file: a timer channel
|
|
146
|
+
* reachable on a specific pad, e.g. STM32 `tim4_ch1_pb6` (TIM4 CH1 on PB6).
|
|
147
|
+
* RAW — ports/bits as the pinctrl file states them; the board manifest
|
|
148
|
+
* generator maps them to global pin numbers using its derived controller
|
|
149
|
+
* table and applies the family's nodelabel conventions (tim4 → pwm4). */
|
|
150
|
+
export interface DtsPwmPin {
|
|
151
|
+
/** Pinctrl-source peripheral name, e.g. 'tim4'. */
|
|
152
|
+
readonly source: string;
|
|
153
|
+
/** Channel number within the peripheral. */
|
|
154
|
+
readonly channel: number;
|
|
155
|
+
/** GPIO port letter as written ('A', 'B', …). */
|
|
156
|
+
readonly port: string;
|
|
157
|
+
/** Pad bit within the port. */
|
|
158
|
+
readonly bit: number;
|
|
159
|
+
/** The pinctrl node's own name — the token the generated overlay composes
|
|
160
|
+
* `pinctrl-0 = <&name>` references from ('tim4_ch1_pb6'). */
|
|
161
|
+
readonly pinctrl: string;
|
|
162
|
+
}
|
|
163
|
+
/** A silicon analog-input route harvested from an SoC pinctrl file, e.g.
|
|
164
|
+
* STM32 `adc1_in1_pa1` (ADC1 channel 1 on PA1). RAW, like DtsPwmPin. */
|
|
165
|
+
export interface DtsAdcPin {
|
|
166
|
+
/** ADC controller name as written, e.g. 'adc1'. */
|
|
167
|
+
readonly source: string;
|
|
168
|
+
/** Input channel number. */
|
|
169
|
+
readonly channel: number;
|
|
170
|
+
readonly port: string;
|
|
171
|
+
readonly bit: number;
|
|
172
|
+
readonly pinctrl: string;
|
|
173
|
+
}
|
|
174
|
+
/** A silicon analog-OUTPUT route harvested from an SoC pinctrl file, e.g.
|
|
175
|
+
* STM32 `dac1_out1_pa4` (DAC1 channel 1 on PA4). RAW, like DtsPwmPin. */
|
|
176
|
+
export interface DtsDacPin {
|
|
177
|
+
/** DAC controller name as written, e.g. 'dac1' — the DT nodelabel on
|
|
178
|
+
* STM32 (dac1: dac@40007400), so it maps straight to the device spec. */
|
|
179
|
+
readonly source: string;
|
|
180
|
+
/** Output channel number. */
|
|
181
|
+
readonly channel: number;
|
|
182
|
+
readonly port: string;
|
|
183
|
+
readonly bit: number;
|
|
184
|
+
readonly pinctrl: string;
|
|
185
|
+
}
|
|
186
|
+
/** A counter-capable device node from the include chain. */
|
|
187
|
+
export interface DtsCounterNode {
|
|
188
|
+
/** The counter binding's compatible (e.g. 'nordic,nrf-rtc',
|
|
189
|
+
* 'espressif,esp32-counter') — identifies the driver. */
|
|
190
|
+
readonly compatible: string;
|
|
191
|
+
/** Labeled-self form: the node's own nodelabel (nRF rtc1, STM32 rtc).
|
|
192
|
+
* Undefined in the child form. */
|
|
193
|
+
readonly nodeLabel?: string;
|
|
194
|
+
/** Child form: the labeled TIMER PARENT's nodelabel (ESP32 timer0) — the
|
|
195
|
+
* counter device is an unlabeled `counter {}` child; the overlay defines
|
|
196
|
+
* the label there. Undefined in the self form. */
|
|
197
|
+
readonly parentLabel?: string;
|
|
198
|
+
}
|
|
199
|
+
/** A GPIO controller device node reached through the include chain (a node
|
|
200
|
+
* carrying the universal `gpio-controller` property). This is the SoC's
|
|
201
|
+
* FULL port inventory — the board's own facts only name the ports it
|
|
202
|
+
* happens to wire, so without this the pin sweep systematically
|
|
203
|
+
* under-reports a board's pads. `ngpios` carries the declared width when
|
|
204
|
+
* the dtsi states one (nRF, Atmel, …); families that omit it (STM32) rely
|
|
205
|
+
* on the derived port-width conventions. */
|
|
206
|
+
export interface DtsGpioController {
|
|
207
|
+
readonly nodelabel: string;
|
|
208
|
+
readonly ngpios?: number;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Read one board DTS file (following its local include chain) and extract
|
|
212
|
+
* the board-level facts. `zephyrBoardsRoot` (e.g. <zephyr>/boards) resolves
|
|
213
|
+
* `<../boards/common/...>` style includes; `moduleDtsRoots` resolve the
|
|
214
|
+
* vendor HAL modules' pinctrl dtsi (`<st/f4/...-pinctrl.dtsi>` lives under
|
|
215
|
+
* modules/hal/stm32/dts — Zephyr's MODULE_DTS_ROOTS, mirrored here).
|
|
216
|
+
*/
|
|
217
|
+
export declare function readBoardDts(dtsPath: string, opts?: {
|
|
218
|
+
zephyrBoardsRoot?: string;
|
|
219
|
+
moduleDtsRoots?: readonly string[];
|
|
220
|
+
}): DtsBoardFacts;
|