@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,233 @@
|
|
|
1
|
+
/** One board variant's extractable facts, from its own devicetree + board.yml
|
|
2
|
+
* + board.cmake. Silicon facts (ADC/PWM matrices) never appear here — they
|
|
3
|
+
* do not live in devicetree. */
|
|
4
|
+
export interface BoardDataEntry {
|
|
5
|
+
/** Qualified west build target (the variant yaml identifier). */
|
|
6
|
+
readonly identifier: string;
|
|
7
|
+
/** Human board name. */
|
|
8
|
+
readonly name: string;
|
|
9
|
+
/** Vendor directory name. */
|
|
10
|
+
readonly vendor: string;
|
|
11
|
+
/** The variant DTS file this was extracted from. */
|
|
12
|
+
readonly dts: string;
|
|
13
|
+
/** Console controller nodelabel (the chosen zephyr,console). */
|
|
14
|
+
readonly console?: string;
|
|
15
|
+
/** Addressable user LED (worldsemi,ws2812-*): the pad driving the pixel.
|
|
16
|
+
* A plain-GPIO LED — no led0 devicetree spec (the pixel is not a
|
|
17
|
+
* gpio-leds node). Present only when the board has no gpio-leds LED. */
|
|
18
|
+
readonly stripLed?: {
|
|
19
|
+
readonly controller: string;
|
|
20
|
+
readonly pin: number;
|
|
21
|
+
};
|
|
22
|
+
/** PWM-driven LEDs (pwm-leds children) in board order. The alias is the
|
|
23
|
+
* devicetree alias ('pwm-led0') — the DT_ALIAS-addressable form. */
|
|
24
|
+
readonly pwmLeds?: readonly {
|
|
25
|
+
readonly alias?: string;
|
|
26
|
+
readonly controller: string;
|
|
27
|
+
readonly channel: number;
|
|
28
|
+
readonly periodNs?: number;
|
|
29
|
+
readonly flags?: readonly string[];
|
|
30
|
+
}[];
|
|
31
|
+
/** The board's USB device wiring: 'enabled' (DTS turns the device
|
|
32
|
+
* controller on), 'disabled' (explicitly off — suppress the USB0
|
|
33
|
+
* export), undefined (silent; the app overlay may still compose CDC). */
|
|
34
|
+
readonly usbDevice?: 'enabled' | 'disabled';
|
|
35
|
+
/** The USB device controller nodelabel backing usbDevice. */
|
|
36
|
+
readonly usbController?: string;
|
|
37
|
+
/** Watchdog node label (the devicetree watchdog0 alias). */
|
|
38
|
+
readonly wdtNodeLabel?: string;
|
|
39
|
+
/** Probe/flash methods from the board's board.cmake (west runners, in the
|
|
40
|
+
* board's include order — first = west's default runner). */
|
|
41
|
+
readonly probeMethods?: readonly {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly description: string;
|
|
44
|
+
readonly runner: string;
|
|
45
|
+
readonly args?: readonly string[];
|
|
46
|
+
readonly debug?: boolean;
|
|
47
|
+
readonly debugInterface?: 'swd' | 'jtag';
|
|
48
|
+
readonly debugDevice?: string;
|
|
49
|
+
/** The board's support/openocd.cfg, verbatim lines in file order. */
|
|
50
|
+
readonly debugCfg?: readonly string[];
|
|
51
|
+
}[];
|
|
52
|
+
/** The canonical aliased LED (led0). */
|
|
53
|
+
readonly led?: {
|
|
54
|
+
readonly dtSpec: string;
|
|
55
|
+
readonly controller: string;
|
|
56
|
+
readonly pin: number;
|
|
57
|
+
readonly flags: readonly string[];
|
|
58
|
+
};
|
|
59
|
+
/** The canonical aliased button (sw0). */
|
|
60
|
+
readonly button?: {
|
|
61
|
+
readonly dtSpec: string;
|
|
62
|
+
readonly controller: string;
|
|
63
|
+
readonly pin: number;
|
|
64
|
+
readonly flags: readonly string[];
|
|
65
|
+
};
|
|
66
|
+
/** Additional aliased LEDs/buttons beyond the canonical ones. */
|
|
67
|
+
readonly extraLeds?: readonly {
|
|
68
|
+
readonly dtSpec: string;
|
|
69
|
+
readonly controller: string;
|
|
70
|
+
readonly pin: number;
|
|
71
|
+
readonly flags: readonly string[];
|
|
72
|
+
}[];
|
|
73
|
+
readonly extraButtons?: readonly {
|
|
74
|
+
readonly dtSpec: string;
|
|
75
|
+
readonly controller: string;
|
|
76
|
+
readonly pin: number;
|
|
77
|
+
readonly flags: readonly string[];
|
|
78
|
+
}[];
|
|
79
|
+
/** Connector gpio-maps (arduino headers, XIAO edge connector, ...). */
|
|
80
|
+
readonly connectors?: readonly {
|
|
81
|
+
readonly nodelabel: string;
|
|
82
|
+
readonly compatible?: string;
|
|
83
|
+
readonly pins: Readonly<Record<string, {
|
|
84
|
+
readonly controller: string;
|
|
85
|
+
readonly pin: number;
|
|
86
|
+
readonly flags: readonly string[];
|
|
87
|
+
}>>;
|
|
88
|
+
}[];
|
|
89
|
+
/** Bus controller nodelabels the board DTS wires up. */
|
|
90
|
+
readonly buses?: {
|
|
91
|
+
readonly i2c: readonly string[];
|
|
92
|
+
readonly spi: readonly string[];
|
|
93
|
+
readonly uart: readonly string[];
|
|
94
|
+
};
|
|
95
|
+
/** Silicon PWM routes from the SoC pinctrl files (STM32 vendor HAL's
|
|
96
|
+
* per-soc *-pinctrl.dtsi, harvested through the board's include chain).
|
|
97
|
+
* RAW port/bit form — the manifest generator resolves global pin numbers
|
|
98
|
+
* via its controller table and applies nodelabel conventions (tim4 →
|
|
99
|
+
* pwm4). Families whose PWM is a matrix or arithmetic (ESP32 LEDC, RP2040
|
|
100
|
+
* slices) carry no pwmPins — those are family conventions at manifest
|
|
101
|
+
* generation. */
|
|
102
|
+
readonly pwmPins?: readonly {
|
|
103
|
+
/** Pinctrl-source peripheral, e.g. 'tim4'. */
|
|
104
|
+
readonly source: string;
|
|
105
|
+
readonly channel: number;
|
|
106
|
+
/** GPIO port letter as written in the pinctrl file ('A', 'B', ...). */
|
|
107
|
+
readonly port: string;
|
|
108
|
+
readonly bit: number;
|
|
109
|
+
/** The pinctrl node name — the token overlays reference. */
|
|
110
|
+
readonly pinctrl: string;
|
|
111
|
+
}[];
|
|
112
|
+
/** Silicon analog-input routes from the SoC pinctrl files (STM32
|
|
113
|
+
* `adc1_in1_pa1` style) or the vendor pin-mux YAMLs (Atmel
|
|
114
|
+
* modules/hal/atmel/pinconfigs — `[b, adc0, ain15]` per pin). Same
|
|
115
|
+
* raw-harvest contract as pwmPins; pinctrl is absent for families with
|
|
116
|
+
* no pinctrl node tokens (Atmel analog inputs need no pad mux). */
|
|
117
|
+
readonly adcPins?: readonly {
|
|
118
|
+
/** ADC controller as written, e.g. 'adc1'. */
|
|
119
|
+
readonly source: string;
|
|
120
|
+
readonly channel: number;
|
|
121
|
+
readonly port: string;
|
|
122
|
+
readonly bit: number;
|
|
123
|
+
readonly pinctrl?: string;
|
|
124
|
+
}[];
|
|
125
|
+
/** Flash size in KB (largest flash@ DT_SIZE_K in the include chain — the
|
|
126
|
+
* package variant dtsi overrides the SoC base). */
|
|
127
|
+
readonly flashKb?: number;
|
|
128
|
+
/** The board chain already defines a storage_partition label — the
|
|
129
|
+
* manifest generator must NOT emit synthesis facts (west errors on a
|
|
130
|
+
* doubly defined node). */
|
|
131
|
+
readonly hasStoragePartition?: boolean;
|
|
132
|
+
/** The board's own storage_partition reg (offset/size bytes) when the
|
|
133
|
+
* chain ships one — real facts instead of a synthesized region. */
|
|
134
|
+
readonly storageReg?: {
|
|
135
|
+
offsetBytes: number;
|
|
136
|
+
sizeBytes: number;
|
|
137
|
+
};
|
|
138
|
+
/** Counter-capable device nodes from the include chain (labeled RTC
|
|
139
|
+
* nodes with counter compatibles; unlabeled counter{} children under
|
|
140
|
+
* labeled timer parents — labels assigned in the generated overlay). */
|
|
141
|
+
readonly counterNodes?: readonly {
|
|
142
|
+
readonly compatible: string;
|
|
143
|
+
readonly nodeLabel?: string;
|
|
144
|
+
readonly parentLabel?: string;
|
|
145
|
+
}[];
|
|
146
|
+
/** ESP32 LEDC PWM matrix (harvested from <soc>-pinctrl.h LEDC macros):
|
|
147
|
+
* any listed pad can carry any of channelCount channels; the overlay
|
|
148
|
+
* assigns channels to the driven pads at build time. */
|
|
149
|
+
readonly pwmMatrix?: {
|
|
150
|
+
readonly controller: string;
|
|
151
|
+
readonly channelCount: number;
|
|
152
|
+
readonly pads: readonly number[];
|
|
153
|
+
};
|
|
154
|
+
/** Labeled PWM controller device nodes from the include chain (nRF's
|
|
155
|
+
* psel-routed pwm0..pwm3 — any pad any channel; the manifest generator
|
|
156
|
+
* synthesizes a matrix from them). */
|
|
157
|
+
readonly pwmNodes?: readonly string[];
|
|
158
|
+
/** ESP32 SARADC routes (harvested from the HAL adc_channel.h):
|
|
159
|
+
* global pad + channel, keyed to the DT adc{N} device. */
|
|
160
|
+
readonly espAdc?: readonly {
|
|
161
|
+
readonly source: string;
|
|
162
|
+
readonly pad: number;
|
|
163
|
+
readonly channel: number;
|
|
164
|
+
}[];
|
|
165
|
+
/** RP2 header-matrix ADC routes (harvested from the in-tree
|
|
166
|
+
* rpi-pico-*-pinctrl.h `ADC_CH<n>_P<pad>` macros): global pad + channel
|
|
167
|
+
* + the PINMUX MACRO token — the RP2 ADC driver applies pinctrl, so the
|
|
168
|
+
* overlay synthesizes its pad group from the macro. */
|
|
169
|
+
readonly padAdc?: readonly {
|
|
170
|
+
readonly source: string;
|
|
171
|
+
readonly channel: number;
|
|
172
|
+
readonly pad: number;
|
|
173
|
+
readonly pinctrl: string;
|
|
174
|
+
}[];
|
|
175
|
+
/** RP2 header-matrix PWM routes (the `PWM_<slice><A|B>_P<pad>` macros):
|
|
176
|
+
* channel = slice*2 + (B?1:0) — the driver's channel encoding — and the
|
|
177
|
+
* pinmux macro token for the overlay's pinctrl group. */
|
|
178
|
+
readonly padPwm?: readonly {
|
|
179
|
+
readonly source: string;
|
|
180
|
+
readonly channel: number;
|
|
181
|
+
readonly pad: number;
|
|
182
|
+
readonly pinctrl: string;
|
|
183
|
+
}[];
|
|
184
|
+
/** Wired analog channels from connector io-channel-maps (the DKs'
|
|
185
|
+
* arduino,uno-adc nodes): the channel index a named connector pin is
|
|
186
|
+
* wired to, joined with the same connector family's gpio-map for the
|
|
187
|
+
* pad. Board-authored truth — covers boards on SoCs without a family
|
|
188
|
+
* table. */
|
|
189
|
+
readonly connectorAdc?: readonly {
|
|
190
|
+
readonly source: string;
|
|
191
|
+
readonly channel: number;
|
|
192
|
+
readonly controller: string;
|
|
193
|
+
readonly pin: number;
|
|
194
|
+
}[];
|
|
195
|
+
/** Pinctrl harvest lint results — name↔pinmux-value disagreements; each
|
|
196
|
+
* warning names a route that was dropped as untrustworthy (a harvest bug
|
|
197
|
+
* or an upstream typo, not a fact to ship). */
|
|
198
|
+
readonly pinctrlWarnings?: readonly string[];
|
|
199
|
+
/** SoC-level ADC/DAC device nodelabels in the include chain — the
|
|
200
|
+
* cross-check that filters pinctrl routes for undeclared devices. */
|
|
201
|
+
readonly analogDevices?: readonly string[];
|
|
202
|
+
/** Silicon analog-output routes from the SoC pinctrl files (STM32
|
|
203
|
+
* `dac1_out1_pa4` style). The source ('dac1') is already the DT
|
|
204
|
+
* nodelabel on STM32. */
|
|
205
|
+
readonly dacPins?: readonly {
|
|
206
|
+
/** DAC controller as written, e.g. 'dac1'. */
|
|
207
|
+
readonly source: string;
|
|
208
|
+
readonly channel: number;
|
|
209
|
+
readonly port: string;
|
|
210
|
+
readonly bit: number;
|
|
211
|
+
readonly pinctrl: string;
|
|
212
|
+
}[];
|
|
213
|
+
/** GPIO controller device nodes from the SoC dtsi include chain (the
|
|
214
|
+
* universal `gpio-controller` property) — the FULL port inventory, not
|
|
215
|
+
* just the ports the board's own facts name. Boardgen seeds its derived
|
|
216
|
+
* controller table from these so every SoC pad sweeps, not just the
|
|
217
|
+
* wired ones. `ngpios` states the width where the dtsi does. */
|
|
218
|
+
readonly gpioControllers?: readonly {
|
|
219
|
+
readonly nodelabel: string;
|
|
220
|
+
readonly ngpios?: number;
|
|
221
|
+
}[];
|
|
222
|
+
/** The coverage ledger: which silicon source satisfied each capability for
|
|
223
|
+
* THIS board. 'pinctrl' = SoC pinctrl dtsi/header harvest; 'pinconfig' =
|
|
224
|
+
* vendor pinconfigs YAML; 'header' = ESP32/RP2 header matrix; 'family' =
|
|
225
|
+
* a family table (nRF SAADC); 'connector' = board-authored io-channel-map.
|
|
226
|
+
* Absent = the capability is honestly uncovered. Surfaced by `board sync`
|
|
227
|
+
* so drift between "known" and "lowered" is diagnosable. */
|
|
228
|
+
readonly siliconSources?: {
|
|
229
|
+
readonly adc?: 'pinctrl' | 'pinconfig' | 'header' | 'family' | 'connector';
|
|
230
|
+
readonly pwm?: 'pinctrl' | 'pinconfig' | 'header' | 'family';
|
|
231
|
+
readonly dac?: 'pinctrl' | 'pinconfig';
|
|
232
|
+
};
|
|
233
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// board-catalog/types.ts — the board record shape shared by the catalog
|
|
3
|
+
// walker, the on-disk overlay, and every consumer (boardgen, the create
|
|
4
|
+
// wizard, the sync diff). One record per board VARIANT, keyed by the
|
|
5
|
+
// qualified west build target.
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { BoardDataEntry } from './types.js';
|
|
2
|
+
/** Provenance of a walked catalog — pins it to the exact tree it describes. */
|
|
3
|
+
export interface BoardCatalogProvenance {
|
|
4
|
+
/** The Zephyr base directory the walk read (resolved). */
|
|
5
|
+
readonly zephyrBase: string;
|
|
6
|
+
/** VERSION file contents rendered 'MAJOR.MINOR.PATCH' (best-effort). */
|
|
7
|
+
readonly version: string;
|
|
8
|
+
/** Git HEAD of the tree when readable (best-effort; tarballs carry none). */
|
|
9
|
+
readonly gitHead?: string;
|
|
10
|
+
/** Boards-dir mtime (epoch ms) — the fallback change signal for git-less trees. */
|
|
11
|
+
readonly boardsMtimeMs: number;
|
|
12
|
+
/** ISO timestamp of the walk. */
|
|
13
|
+
readonly generatedAt: string;
|
|
14
|
+
/** Variant count, carried for quick display without loading `boards`. */
|
|
15
|
+
readonly variants: number;
|
|
16
|
+
}
|
|
17
|
+
/** A completed walk: records in boards/ directory order + provenance. */
|
|
18
|
+
export interface BoardCatalogWalkResult {
|
|
19
|
+
readonly boards: Readonly<Record<string, BoardDataEntry>>;
|
|
20
|
+
readonly provenance: BoardCatalogProvenance;
|
|
21
|
+
readonly stats: {
|
|
22
|
+
readonly variants: number;
|
|
23
|
+
readonly withFacts: number;
|
|
24
|
+
readonly failures: number;
|
|
25
|
+
/** Variant yamls that carried an identifier but resolved to no .dts at
|
|
26
|
+
* all (even through the shared-base fallback) — silently invisible in
|
|
27
|
+
* the catalog; surfaced so a tree shape change can't hide boards. */
|
|
28
|
+
readonly droppedYamls: number;
|
|
29
|
+
/** Coverage ledger aggregated across the walk: per capability, how many
|
|
30
|
+
* boards were satisfied by each silicon source. The drift guard for the
|
|
31
|
+
* "100% board/soc knowledge" goal — a family with a source in-tree but
|
|
32
|
+
* zero boards covered by it is a regression. */
|
|
33
|
+
readonly coverage: {
|
|
34
|
+
readonly adc: Readonly<Record<string, number>>;
|
|
35
|
+
readonly pwm: Readonly<Record<string, number>>;
|
|
36
|
+
readonly dac: Readonly<Record<string, number>>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** board.yml soc lookup, both formats Zephyr ships:
|
|
41
|
+
* - legacy single-board (`board:` / top-level `socs:`): every soc listed
|
|
42
|
+
* under the socs: block → `uniqueSocs`;
|
|
43
|
+
* - multi-board directories (top-level `boards:` list — lyra_24_dvk,
|
|
44
|
+
* lyra_dvk, …): each entry carries its own socs; single-soc entries map
|
|
45
|
+
* board name → soc in `byName`. Multi-soc entries stay unmapped (their
|
|
46
|
+
* variant yamls carry qualified identifiers).
|
|
47
|
+
* `boardNames` lists every declared board name (the `boards:` entries and
|
|
48
|
+
* the legacy `board:` name) — the CONFIG_BOARD_<X> stem a variant's
|
|
49
|
+
* board.cmake guards its runner args with. */
|
|
50
|
+
export interface BoardYmlSocIndex {
|
|
51
|
+
readonly byName: ReadonlyMap<string, string>;
|
|
52
|
+
readonly uniqueSocs: readonly string[];
|
|
53
|
+
readonly boardNames: readonly string[];
|
|
54
|
+
}
|
|
55
|
+
/** Read board.yml's board→soc index (see BoardYmlSocIndex). */
|
|
56
|
+
export declare function boardYmlSocIndex(dir: string): BoardYmlSocIndex;
|
|
57
|
+
/** How the caller pins runner args to ONE variant of a shared board dir. */
|
|
58
|
+
export interface VariantPin {
|
|
59
|
+
/** CONFIG_BOARD stems to try in order: the board.yml entry name this
|
|
60
|
+
* target belongs to, then the full underscored target name. */
|
|
61
|
+
readonly boardConfigs?: readonly string[];
|
|
62
|
+
/** The target's soc segment ('nrf5340'). */
|
|
63
|
+
readonly soc?: string;
|
|
64
|
+
/** Qualifier segments after the soc ('cpunet', ['a53','smp']). */
|
|
65
|
+
readonly quals?: readonly string[];
|
|
66
|
+
}
|
|
67
|
+
export declare function boardProbeMethods(dir: string, variant?: VariantPin): BoardDataEntry['probeMethods'];
|
|
68
|
+
/** VERSION file → 'MAJOR.MINOR.PATCH' ('' when unreadable). */
|
|
69
|
+
export declare function zephyrVersionOf(zephyrBase: string): string;
|
|
70
|
+
/**
|
|
71
|
+
* Git HEAD of the tree, read straight off the filesystem (no git spawn —
|
|
72
|
+
* sync runs where git may be absent). Handles the plain clone (.git dir,
|
|
73
|
+
* HEAD → ref → loose ref or packed-refs) and the worktree/submodule form
|
|
74
|
+
* (.git file pointing at a gitdir). Best-effort: undefined when unreadable.
|
|
75
|
+
*/
|
|
76
|
+
export declare function gitHeadOf(zephyrBase: string): string | undefined;
|
|
77
|
+
/** Every build target a board.yml declares, with the naming facts the
|
|
78
|
+
* synthesizer needs (board.yml-driven dirs ship NO per-variant yamls —
|
|
79
|
+
* nucleo_n657x0_q's sb target exists only as a board.yml entry). */
|
|
80
|
+
export interface BoardYmlTarget {
|
|
81
|
+
readonly identifier: string;
|
|
82
|
+
/** The board entry name the target belongs to (CONFIG_BOARD stem). */
|
|
83
|
+
readonly boardName: string;
|
|
84
|
+
readonly soc?: string;
|
|
85
|
+
/** Variant chain segments after the soc ('sb', ['a53','smp']). */
|
|
86
|
+
readonly chain: readonly string[];
|
|
87
|
+
readonly fullName?: string;
|
|
88
|
+
readonly vendor?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Parse board.yml into its declared build targets, both shapes:
|
|
92
|
+
* multi-board (`boards:` list) and legacy (`board:` block), with socs and
|
|
93
|
+
* (nested) variants. Variant chains accumulate through nesting levels
|
|
94
|
+
* (board/soc/v1/v2).
|
|
95
|
+
*/
|
|
96
|
+
export declare function boardYmlTargets(dir: string): BoardYmlTarget[];
|
|
97
|
+
/**
|
|
98
|
+
* Walk `<zephyrBase>/boards` and extract one record per board variant.
|
|
99
|
+
* Reader failures degrade to the base record (identifier/name/vendor/dts +
|
|
100
|
+
* probe methods) — a board whose DTS defeats the reader still resolves, it
|
|
101
|
+
* just carries no pin facts.
|
|
102
|
+
*/
|
|
103
|
+
export declare function walkBoardCatalog(zephyrBase: string): BoardCatalogWalkResult;
|
|
104
|
+
/** Bus controller labels declared by the SoC's dtsi files in the installed
|
|
105
|
+
* tree, classified by family. Best-effort: matches dts/dtsi files whose
|
|
106
|
+
* name contains the soc name (a soc stem like 'stm32f411' matches
|
|
107
|
+
* 'stm32f411xe.dtsi'), plus same-dir includes. */
|
|
108
|
+
export declare function socBusLabelsFromTree(zephyrBase: string, soc: string): {
|
|
109
|
+
i2c: string[];
|
|
110
|
+
spi: string[];
|
|
111
|
+
uart: string[];
|
|
112
|
+
};
|