@typecad/cuttlefish 1.0.0-alpha.14 → 1.0.0-alpha.16
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 +25 -26
- package/dist/api/config.d.ts +22 -26
- 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 +7 -6
- 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 +219 -242
- package/dist/config-loader.d.ts +14 -19
- package/dist/config-loader.js +240 -78
- package/dist/config-schema.d.ts +3 -5
- package/dist/config-schema.js +8 -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 +27 -0
- 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 +4 -2
- package/dist/create/editor-integration.js +41 -2
- package/dist/create/framework-catalog.d.ts +57 -9
- package/dist/create/framework-catalog.js +76 -57
- package/dist/create/index.d.ts +5 -11
- package/dist/create/index.js +3 -8
- 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/scaffold.d.ts +4 -7
- package/dist/create/scaffold.js +19 -109
- package/dist/create/templates.d.ts +32 -5
- package/dist/create/templates.js +130 -116
- package/dist/create/wizard.d.ts +12 -1
- package/dist/create/wizard.js +168 -38
- 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 +125 -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 +40 -42
- 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/init.d.ts +1 -1
- package/dist/library/init.js +137 -137
- package/dist/library-packages.d.ts +1 -1
- package/dist/library-packages.js +1 -1
- 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 +13 -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/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 +4 -5
- 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 +36 -30
- package/dist/types.d.ts +26 -26
- package/dist/ui-hook.d.ts +1 -1
- package/dist/utils/cli.d.ts +2 -2
- package/dist/utils/cli.js +92 -154
- 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 -157
- 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 -181
- package/dist/create/board-spec.js +0 -214
- 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
package/README.md
CHANGED
|
@@ -1,79 +1,82 @@
|
|
|
1
|
-
# `@typecad/cuttlefish`
|
|
2
|
-
|
|
3
|
-
TypeScript → C++ transpiler for embedded firmware. Targets native (desktop)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`cuttlefish` is the command-line tool at the center of the [TypeCAD](https://cuttlefish.typecad.net)
|
|
7
|
-
toolchain: it loads `cuttlefish.config.ts`, transpiles TypeScript firmware to
|
|
8
|
-
C++, and can chain compile, upload, and serial-monitor steps.
|
|
9
|
-
|
|
10
|
-
## Quick start
|
|
11
|
-
|
|
12
|
-
From a project root containing `cuttlefish.config.ts`:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npx @typecad/cuttlefish build
|
|
16
|
-
npx @typecad/cuttlefish build --compile --upload --port COM4
|
|
17
|
-
npx @typecad/cuttlefish build --compile --upload --monitor --port COM4 --baud 115200
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Scaffold a starter project with the built-in wizard:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npx @typecad/cuttlefish create --board
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Commands
|
|
27
|
-
|
|
28
|
-
| Command | Description |
|
|
29
|
-
| --- | --- |
|
|
30
|
-
| `cuttlefish build` | Transpile the entry file (default). Accepts `--compile`, `--upload`, `--monitor`, `--port`, `--baud`. |
|
|
31
|
-
| `cuttlefish create` | Generate a starter project and `cuttlefish.config.ts`. |
|
|
32
|
-
| `cuttlefish
|
|
33
|
-
| `cuttlefish
|
|
34
|
-
| `cuttlefish
|
|
35
|
-
| `cuttlefish
|
|
36
|
-
| `cuttlefish
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- `--
|
|
43
|
-
- `--
|
|
44
|
-
- `--
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
board: '
|
|
60
|
-
framework: '@typecad/framework-
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export default config;
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Ecosystem
|
|
67
|
-
|
|
68
|
-
`@typecad/cuttlefish` is the transpiler core. It pairs with sibling packages:
|
|
69
|
-
|
|
70
|
-
- [`@typecad/hal`](https://cuttlefish.typecad.net) — hardware abstraction (GPIO, I2C, SPI, UART) as regular TypeScript.
|
|
71
|
-
- [`@typecad/ui`](https://cuttlefish.typecad.net) — HTML/CSS-driven graphics for microcontroller displays.
|
|
72
|
-
- [`@typecad/expect`](https://cuttlefish.typecad.net) — hardware test framework (vitest-style assertions over serial).
|
|
73
|
-
- [`@typecad/framework-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
1
|
+
# `@typecad/cuttlefish`
|
|
2
|
+
|
|
3
|
+
TypeScript → C++ transpiler for embedded firmware. Targets native (desktop)
|
|
4
|
+
and Zephyr-supported embedded boards from a single TypeScript codebase.
|
|
5
|
+
|
|
6
|
+
`cuttlefish` is the command-line tool at the center of the [TypeCAD](https://cuttlefish.typecad.net)
|
|
7
|
+
toolchain: it loads `cuttlefish.config.ts`, transpiles TypeScript firmware to
|
|
8
|
+
C++, and can chain compile, upload, and serial-monitor steps.
|
|
9
|
+
|
|
10
|
+
## Quick start
|
|
11
|
+
|
|
12
|
+
From a project root containing `cuttlefish.config.ts`:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx @typecad/cuttlefish build
|
|
16
|
+
npx @typecad/cuttlefish build --compile --upload --port COM4
|
|
17
|
+
npx @typecad/cuttlefish build --compile --upload --monitor --port COM4 --baud 115200
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Scaffold a starter project with the built-in wizard:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx @typecad/cuttlefish create --board esp32s3
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
| Command | Description |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `cuttlefish build` | Transpile the entry file (default). Accepts `--compile`, `--upload`, `--monitor`, `--port`, `--baud`. |
|
|
31
|
+
| `cuttlefish create` | Generate a starter project and `cuttlefish.config.ts`. |
|
|
32
|
+
| `cuttlefish preview` | Launch the browser preview server for a UI project. |
|
|
33
|
+
| `cuttlefish gen-decls <file.h\|file.cpp\|--all <dir>>` | Generate `.d.ts` declaration stubs from C++ headers. |
|
|
34
|
+
| `cuttlefish doctor` | Check the active framework's environment (e.g. toolchain + board support). |
|
|
35
|
+
| `cuttlefish licenses [--all] [--strict]` | Scan this project's libraries for SPDX licenses. |
|
|
36
|
+
| `cuttlefish board sync [zephyr-base]` | Rebuild the local board catalog from your Zephyr tree's board DTS files. The catalog is machine-local — there is no compiled-in board database; builds create and refresh it automatically, this command forces a rebuild. |
|
|
37
|
+
| `cuttlefish board regen` | Regenerate the project-local board module (`.cuttlefish/board.ts` + `board.json`). Builds also regenerate it automatically whenever any input changes (config board, catalog, or Zephyr tree). |
|
|
38
|
+
| `cuttlefish library <search\|install\|init\|validate>` | The cuttlefish library package manager (npm keywords are the catalog). |
|
|
39
|
+
|
|
40
|
+
### Flags (for `build`)
|
|
41
|
+
|
|
42
|
+
- `--compile` — transpile, then compile via the active framework's toolchain (`west` for Zephyr, `g++` for native).
|
|
43
|
+
- `--upload` — flash firmware to the board (requires `--compile`).
|
|
44
|
+
- `--monitor` — open a serial monitor after upload.
|
|
45
|
+
- `--port <port>` — serial port for upload/monitor (e.g. `COM4`, `/dev/ttyUSB0`).
|
|
46
|
+
- `--baud <rate>` — serial monitor baud rate.
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
The CLI reads `cuttlefish.config.ts` from the current working directory and
|
|
51
|
+
treats it as the source of truth. When no config file is present, command-line
|
|
52
|
+
flags such as `--board` and `--build-target` supply board and build settings.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import type { CuttlefishConfig } from '@typecad/cuttlefish/api';
|
|
56
|
+
|
|
57
|
+
const config: CuttlefishConfig = {
|
|
58
|
+
entry: './src/main.ts',
|
|
59
|
+
board: 'xiao_ble/nrf52840',
|
|
60
|
+
framework: '@typecad/framework-zephyr',
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default config;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Ecosystem
|
|
67
|
+
|
|
68
|
+
`@typecad/cuttlefish` is the transpiler core. It pairs with sibling packages:
|
|
69
|
+
|
|
70
|
+
- [`@typecad/hal`](https://cuttlefish.typecad.net) — hardware abstraction (GPIO, I2C, SPI, UART) as regular TypeScript.
|
|
71
|
+
- [`@typecad/ui`](https://cuttlefish.typecad.net) — HTML/CSS-driven graphics for microcontroller displays.
|
|
72
|
+
- [`@typecad/expect`](https://cuttlefish.typecad.net) — hardware test framework (vitest-style assertions over serial).
|
|
73
|
+
- [`@typecad/framework-zephyr`](https://cuttlefish.typecad.net) — Zephyr RTOS framework (build, flashing, and the bundled Zephyr toolchain installer).
|
|
74
|
+
|
|
75
|
+
Built in, no separate package: the **native** desktop target (`framework:
|
|
76
|
+
'@typecad/framework-native'` resolves inside cuttlefish) and the **safety**
|
|
77
|
+
engine (verified GPIO reads, ISO 26262 analysis — author via
|
|
78
|
+
`@typecad/cuttlefish/safety`).
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT
|
|
@@ -57,7 +57,7 @@ Breakpoints are only injected when cuttlefish is run with `--debug`:
|
|
|
57
57
|
|
|
58
58
|
```sh
|
|
59
59
|
cuttlefish build --debug # uses cuttlefish.config.ts entry
|
|
60
|
-
cuttlefish src/index.ts --debug --
|
|
60
|
+
cuttlefish src/index.ts --debug --compile --upload --port COM4
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
See `cuttlefish --help` for the full `--debug` description.
|
|
@@ -87,17 +87,17 @@ under cuttlefish's basename-matching loader):
|
|
|
87
87
|
| `logMessage` | string | no | Logpoint with `{variable}` interpolation. When present, the breakpoint logs instead of halting. |
|
|
88
88
|
|
|
89
89
|
Two source files sharing the same basename in one project will share
|
|
90
|
-
breakpoints — acceptable for typical single-
|
|
90
|
+
breakpoints — acceptable for typical single-program projects.
|
|
91
91
|
|
|
92
92
|
## Native debugging on ESP32-S3
|
|
93
93
|
|
|
94
94
|
For ESP32-S3, this extension's printf instrumentation is superseded by a
|
|
95
95
|
native GDB path. `cuttlefish build --debug` on `esp32s3` emits `#line`
|
|
96
96
|
directives in the generated C++ and writes `.vscode/launch.json` +
|
|
97
|
-
`tasks.json` (at the
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
`tasks.json` (at the cuttlefish project root, where VS Code reads them) plus
|
|
98
|
+
`.cuttlefish/openocd.cfg` next to the build output. Press **F5** in VS Code
|
|
99
|
+
and the generated config attaches GDB to the chip's built-in USB-Serial-JTAG
|
|
100
|
+
— one USB cable, no external probe.
|
|
101
101
|
|
|
102
102
|
For Zephyr projects (`@typecad/framework-zephyr` on an esp32s3 board),
|
|
103
103
|
`cuttlefish create` writes the same starter artifacts at project creation —
|
|
@@ -108,21 +108,22 @@ re-merges the launch entry with the build-cache-resolved gdbPath. (The
|
|
|
108
108
|
starter gdbPath is probed from `$ZEPHYR_SDK_INSTALL_DIR`, the
|
|
109
109
|
zephyr-installer micromamba layout, or `~/zephyr-sdk-*`.)
|
|
110
110
|
|
|
111
|
-
`launch.json` ships a single **`
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
`
|
|
111
|
+
`launch.json` ships a single **`cortex-debug`** configuration (`servertype:
|
|
112
|
+
"openocd"`, or `"jlink"` when the board's probe method is a JLink runner).
|
|
113
|
+
The cortex-debug extension starts OpenOCD itself as a child process, passing
|
|
114
|
+
the generated `.cuttlefish/openocd.cfg`; the `preLaunchTask` is just
|
|
115
|
+
`build + flash` — no competing OpenOCD process. Install the cortex-debug
|
|
116
|
+
extension (ESP32 targets also need OpenOCD — the framework probes the
|
|
117
|
+
openocd-esp32 install layout or the Zephyr SDK's own openocd), and set the
|
|
118
|
+
serial port through the `CUTTLEFISH_PORT` env var or pass
|
|
119
|
+
`--port`.
|
|
119
120
|
|
|
120
|
-
The printf instrumentation documented below remains the path for targets
|
|
121
|
-
don't
|
|
121
|
+
The printf instrumentation documented below remains the path for targets
|
|
122
|
+
that don't ship a native GDB path yet.
|
|
122
123
|
|
|
123
124
|
## Limitations
|
|
124
125
|
|
|
125
|
-
- This is a
|
|
126
|
+
- This is a printf-based instrumentation shim, not a DAP debug
|
|
126
127
|
adapter. There is no native step/step-in/step-out — each breakpoint halts
|
|
127
128
|
until ENTER (continue) or `s` (skip this breakpoint for the run) is received
|
|
128
129
|
over serial. **On ESP32-S3, use the native GDB path above instead** — it
|
|
@@ -131,12 +132,10 @@ don't yet support native debugging (Arduino, other ESP32 variants).
|
|
|
131
132
|
parameters in the enclosing function. Member access and arbitrary
|
|
132
133
|
expressions are not resolved; `{ value }` in a logpoint emits the literal
|
|
133
134
|
`"{value}"` if `value` is not in scope.
|
|
134
|
-
- Baud rate is
|
|
135
|
-
|
|
136
|
-
- **Target-specific output:**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
is cycled. This is the ESP-IDF equivalent of "no IDE attached to a
|
|
142
|
-
breakpoint."
|
|
135
|
+
- Baud rate is fixed by the framework's console shim regardless of the CLI
|
|
136
|
+
`--baud` value.
|
|
137
|
+
- **Target-specific output:** under @typecad/framework-zephyr the injected
|
|
138
|
+
code routes through the board console (`printk`/shell backend) and blocks on
|
|
139
|
+
a getchar-equivalent with the idle thread feeding — so a debug build must
|
|
140
|
+
have a serial monitor attached (e.g. `cuttlefish build --monitor`), or it
|
|
141
|
+
will hang at the first breakpoint until power is cycled.
|
package/dist/api/config.d.ts
CHANGED
|
@@ -36,6 +36,14 @@ export interface CuttlefishZephyrConfig {
|
|
|
36
36
|
kconfig?: Record<string, string>;
|
|
37
37
|
/** Extra arguments forwarded to `west build`. */
|
|
38
38
|
cmakeArgs?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Named probe method from the board's supported table (e.g. 'stlink',
|
|
41
|
+
* 'dfu', 'jlink') — what `--probe` on the CLI also accepts. Serves both
|
|
42
|
+
* flashing and debugging; resolves to a west runner plus the args the
|
|
43
|
+
* method needs. The board package is the source of the table. Mutually
|
|
44
|
+
* exclusive with `runner`.
|
|
45
|
+
*/
|
|
46
|
+
probe?: string;
|
|
39
47
|
/** Override the west flash runner (e.g. 'nrfjprog', 'jlink', 'openocd'). */
|
|
40
48
|
runner?: string;
|
|
41
49
|
/**
|
|
@@ -55,18 +63,22 @@ export interface CuttlefishConfig {
|
|
|
55
63
|
/** Target architecture identifier (e.g. 'avr', 'esp32', 'rp2040'). */
|
|
56
64
|
target: ArchitectureIdentifier;
|
|
57
65
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
66
|
+
* Zephyr board target — the qualified `west build -b` argument (e.g.
|
|
67
|
+
* 'esp32s3_devkitc/esp32s3/procpu'). The project-local board module
|
|
68
|
+
* (.cuttlefish/board.ts + board.json) is a derived artifact: every build
|
|
69
|
+
* regenerates it when any input moves — this field, the local board
|
|
70
|
+
* catalog, or the Zephyr tree the catalog was generated from. The catalog
|
|
71
|
+
* itself is always local (`cuttlefish board sync` rebuilds it from your
|
|
72
|
+
* tree); there is no compiled-in board database.
|
|
64
73
|
*/
|
|
65
|
-
|
|
74
|
+
board?: string;
|
|
66
75
|
/**
|
|
67
|
-
*
|
|
76
|
+
* Zephyr SoC name for contract-based projects (custom PCBs with no board
|
|
77
|
+
* target) — e.g. 'stm32f411xe'. Selects the curated soc descriptor whose
|
|
78
|
+
* pin set the contract narrows against. Required with `contract` on
|
|
79
|
+
* embedded targets.
|
|
68
80
|
*/
|
|
69
|
-
|
|
81
|
+
soc?: string;
|
|
70
82
|
/**
|
|
71
83
|
* Path to a TypeCAD contract file (*.contract.json).
|
|
72
84
|
* If provided, the transpiler will generate a narrowed board definition.
|
|
@@ -78,7 +90,7 @@ export interface CuttlefishConfig {
|
|
|
78
90
|
framework?: string;
|
|
79
91
|
/**
|
|
80
92
|
* ESP32 PSRAM type. When set, the framework emits the PSRAM-enabling
|
|
81
|
-
* Kconfig
|
|
93
|
+
* Kconfig + BOARD_HAS_PSRAM define (Zephyr) so large canvas
|
|
82
94
|
* allocations (scroll viewports, lists) prefer external RAM. No effect
|
|
83
95
|
* on boards without PSRAM.
|
|
84
96
|
*/
|
|
@@ -101,10 +113,6 @@ export interface CuttlefishConfig {
|
|
|
101
113
|
* Toolchain configuration for compile/upload operations.
|
|
102
114
|
*/
|
|
103
115
|
toolchain?: CuttlefishToolchainConfig;
|
|
104
|
-
/**
|
|
105
|
-
* Console output configuration.
|
|
106
|
-
*/
|
|
107
|
-
console?: CuttlefishConsoleConfig;
|
|
108
116
|
/**
|
|
109
117
|
* Framework-specific configuration.
|
|
110
118
|
*/
|
|
@@ -131,18 +139,6 @@ interface CuttlefishToolchainConfig {
|
|
|
131
139
|
/** Framework-specific toolchain options. Each framework reads its own key. */
|
|
132
140
|
frameworkOptions?: Record<string, unknown>;
|
|
133
141
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Console output configuration for the target framework.
|
|
136
|
-
*/
|
|
137
|
-
interface CuttlefishConsoleConfig {
|
|
138
|
-
/** Default baud rate for console output when auto-injected. Default: 9600 */
|
|
139
|
-
baudRate?: number;
|
|
140
|
-
/**
|
|
141
|
-
* Serial port for upload and monitor (e.g. 'COM4', '/dev/ttyACM0').
|
|
142
|
-
* Can be overridden by the --port CLI flag.
|
|
143
|
-
*/
|
|
144
|
-
port?: string;
|
|
145
|
-
}
|
|
146
142
|
/**
|
|
147
143
|
* Configuration for the `cuttlefish-test` hardware test runner.
|
|
148
144
|
*/
|
|
@@ -54,8 +54,6 @@ export interface PeripheralFunction {
|
|
|
54
54
|
instance: number;
|
|
55
55
|
/** Function role (e.g. "sda", "scl", "mosi", "miso"). */
|
|
56
56
|
role: string;
|
|
57
|
-
/** Timer associated with this PWM function (e.g. "timer0", "timer1"). */
|
|
58
|
-
timer?: string;
|
|
59
57
|
}
|
|
60
58
|
export interface PinDefinitions {
|
|
61
59
|
/** Offset for analog pin numbers (e.g. A0 = 14 on Uno). */
|
|
@@ -93,6 +91,12 @@ export interface PinDefinitions {
|
|
|
93
91
|
led?: string;
|
|
94
92
|
/** On-board button pin name. */
|
|
95
93
|
button?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Additional named board pins (e.g. a PWM-driven onboard LED). Keys should
|
|
96
|
+
* be snake_case so the flattened `pins.<key>` entry registers the
|
|
97
|
+
* UPPER_SNAKE identifier in the transpiler's pin alias map.
|
|
98
|
+
*/
|
|
99
|
+
[key: string]: unknown;
|
|
96
100
|
}
|
|
97
101
|
export interface PeripheralInstance {
|
|
98
102
|
instance: number;
|
|
@@ -201,7 +205,7 @@ export interface BuildConfig {
|
|
|
201
205
|
* Describes the silicon capabilities that are independent of any board.
|
|
202
206
|
*/
|
|
203
207
|
export interface MCUDefinition {
|
|
204
|
-
/** MCU identifier (e.g. "
|
|
208
|
+
/** MCU identifier (e.g. "stm32f411"). */
|
|
205
209
|
id: string;
|
|
206
210
|
/** Human-readable name. */
|
|
207
211
|
name: string;
|
|
@@ -217,6 +221,19 @@ export interface MCUDefinition {
|
|
|
217
221
|
features: FeatureFlags;
|
|
218
222
|
/** MCU-specific build configuration. */
|
|
219
223
|
build: BuildConfig;
|
|
224
|
+
/**
|
|
225
|
+
* Silicon-level @typecad/framework-zephyr chip data for this MCU. The lower
|
|
226
|
+
* layer of the same record boards carry (BoardDefinition.zephyr): SoC
|
|
227
|
+
* name(s), devicetree includes, GPIO controller split, default console and
|
|
228
|
+
* clock plan — facts of the chip, not of any PCB. An MCU-only config (no
|
|
229
|
+
* board package) flattens these into board constants under `zephyr.*` so
|
|
230
|
+
* framework-zephyr's resolveChipFromBoard() reconstructs its chip descriptor
|
|
231
|
+
* and the custom-board generator can emit an out-of-tree board for the
|
|
232
|
+
* chip. Board packages keep board-level Zephyr facts (target name, probe
|
|
233
|
+
* methods, storage layout, onboard LED/button DT aliases) in their own
|
|
234
|
+
* zephyr field.
|
|
235
|
+
*/
|
|
236
|
+
zephyr?: Record<string, unknown>;
|
|
220
237
|
}
|
|
221
238
|
/**
|
|
222
239
|
* Board definition manifest.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Async.sleep / sleepUntil / yield operations.
|
|
7
7
|
* @param waitForPinEdge How `__cuttlefish_wait_pin_edge` (the HAL gpio
|
|
8
8
|
* waitForRising/waitForFalling lowering target) is implemented:
|
|
9
|
-
* - "polling" (default): a busy-wait loop using digitalRead/delay/
|
|
9
|
+
* - "polling" (default): a busy-wait loop using digitalRead/delay/__tc_now_ms +
|
|
10
10
|
* the RISING/FALLING/HIGH/LOW symbols. For Arduino-style targets where
|
|
11
11
|
* those are part of the core API.
|
|
12
12
|
* - "stub": resolve immediately, emitting NO Arduino symbols in the body.
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* Async.sleep / sleepUntil / yield operations.
|
|
32
32
|
* @param waitForPinEdge How `__cuttlefish_wait_pin_edge` (the HAL gpio
|
|
33
33
|
* waitForRising/waitForFalling lowering target) is implemented:
|
|
34
|
-
* - "polling" (default): a busy-wait loop using digitalRead/delay/
|
|
34
|
+
* - "polling" (default): a busy-wait loop using digitalRead/delay/__tc_now_ms +
|
|
35
35
|
* the RISING/FALLING/HIGH/LOW symbols. For Arduino-style targets where
|
|
36
36
|
* those are part of the core API.
|
|
37
37
|
* - "stub": resolve immediately, emitting NO Arduino symbols in the body.
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
* - "interrupt": omit entirely — the strategy/ISR layer provides the symbol.
|
|
43
43
|
*/
|
|
44
44
|
export function generateStaticAsyncRuntime(capacity, waitForPinEdge = "polling", strategy) {
|
|
45
|
-
// The current-time expression (
|
|
46
|
-
//
|
|
45
|
+
// The current-time expression (__tc_now_ms() — the runtime clock contract
|
|
46
|
+
// every strategy provides). Falling back to the contract symbol keeps the
|
|
47
47
|
// behavior when no strategy is supplied.
|
|
48
|
-
const now = strategy?.currentTimeMillis?.() ?? "
|
|
48
|
+
const now = strategy?.currentTimeMillis?.() ?? "__tc_now_ms()";
|
|
49
49
|
return `
|
|
50
50
|
// TypeCAD static (heap-free) async runtime — for targets without <vector>.
|
|
51
51
|
namespace typecad_async_static {
|
|
@@ -199,7 +199,7 @@ ${waitPinEdgeForMode(waitForPinEdge, strategy, now)}
|
|
|
199
199
|
`;
|
|
200
200
|
}
|
|
201
201
|
/** Emit `__cuttlefish_wait_pin_edge` per the strategy's waitForPinEdge mode. */
|
|
202
|
-
function waitPinEdgeForMode(mode, strategy, now = "
|
|
202
|
+
function waitPinEdgeForMode(mode, strategy, now = "__tc_now_ms()") {
|
|
203
203
|
if (mode === "interrupt") {
|
|
204
204
|
// The strategy/ISR layer provides the symbol; emit nothing here.
|
|
205
205
|
return "// __cuttlefish_wait_pin_edge is provided by the strategy (interrupt mode).";
|
|
@@ -30,8 +30,9 @@ export interface AsyncRuntimeConfig {
|
|
|
30
30
|
*/
|
|
31
31
|
hasPromiseRuntime: boolean;
|
|
32
32
|
/**
|
|
33
|
-
* Whether the platform
|
|
34
|
-
* (as opposed to cooperative polling).
|
|
33
|
+
* Whether the platform provides native timer callbacks for async sleeps
|
|
34
|
+
* (as opposed to cooperative polling). Zephyr sets this false: periodic
|
|
35
|
+
* work is a Thread (k_thread) or a Counter, never a timer queue.
|
|
35
36
|
*/
|
|
36
37
|
hasTimers: boolean;
|
|
37
38
|
/**
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Public surface for the generated Zephyr board catalog. The pack itself is
|
|
2
|
+
// generated by scripts/gen-zephyr-board-data.mjs against the pinned Zephyr
|
|
3
|
+
// tree and lives at src/create/board-catalog.generated.ts (shared with the
|
|
4
|
+
// create/scaffold flow). The framework's board generator (boardgen) joins
|
|
5
|
+
// this catalog with its curated soc descriptors.
|
|
6
|
+
export { BOARD_DATA } from '../../create/board-catalog.generated.js';
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flat map from dot-path key to scalar constant value.
|
|
3
3
|
*
|
|
4
|
-
* Examples (
|
|
5
|
-
* "
|
|
6
|
-
* "
|
|
7
|
-
* "
|
|
8
|
-
* "memory.flash" → 32768
|
|
9
|
-
* "memory.sram" → 2048
|
|
10
|
-
* "memory.eeprom"→ 1024
|
|
4
|
+
* Examples (from a generated board.json manifest):
|
|
5
|
+
* "name" → "XIAO BLE"
|
|
6
|
+
* "pins.led" → 13
|
|
7
|
+
* "pins.analogOffset" → 14
|
|
11
8
|
*/
|
|
12
9
|
export type BoardConstants = Map<string, string | number | boolean>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Board constant types
|
|
3
3
|
//
|
|
4
4
|
// Types for compile-time constant extraction from board definitions.
|
|
5
|
-
// The implementation
|
|
5
|
+
// The implementation lives in the CLI (ir/board-resolver.ts) and reads the
|
|
6
|
+
// project-local generated board.json manifest.
|
|
6
7
|
// ---------------------------------------------------------------------------
|
|
7
8
|
export {};
|
|
@@ -21,7 +21,7 @@ export interface CoopSchedOptions {
|
|
|
21
21
|
timeBudgetMs?: number;
|
|
22
22
|
/**
|
|
23
23
|
* C++ expression yielding the current monotonic time in ms, used for the
|
|
24
|
-
* budget check (
|
|
24
|
+
* budget check (`__tc_now_ms()`). Required only when
|
|
25
25
|
* enableTimeBudget is true.
|
|
26
26
|
*/
|
|
27
27
|
currentTimeExpr?: string;
|
|
@@ -31,7 +31,7 @@ export function generateCoopScheduler(options = {}) {
|
|
|
31
31
|
const priorities = options.priorities ?? 2;
|
|
32
32
|
const enableTimeBudget = options.enableTimeBudget ?? false;
|
|
33
33
|
const timeBudgetMs = options.timeBudgetMs ?? 5;
|
|
34
|
-
const currentTimeExpr = options.currentTimeExpr ?? "
|
|
34
|
+
const currentTimeExpr = options.currentTimeExpr ?? "__tc_now_ms()";
|
|
35
35
|
// Budget check snippet, only included when time-budgeting is enabled.
|
|
36
36
|
const budgetCheck = enableTimeBudget
|
|
37
37
|
? ` if ((${currentTimeExpr} - _start) >= static_cast<uint32_t>(${timeBudgetMs})) { break; }`
|
|
@@ -219,7 +219,7 @@ export declare function parsedIsPlainStructType(cppType: string): boolean;
|
|
|
219
219
|
/**
|
|
220
220
|
* True for types that own a string buffer and therefore need `.c_str()` when
|
|
221
221
|
* passed to a C variadic (printf/snprintf): `std::string`, `__tc_str_ptr`,
|
|
222
|
-
* and platform string types like
|
|
222
|
+
* and platform string types like `String`. NOT true for `const char*`
|
|
223
223
|
* / `char*`, which are already C-strings.
|
|
224
224
|
*
|
|
225
225
|
* This is the structured replacement for the
|
|
@@ -648,7 +648,7 @@ export function parsedIsPlainStructType(cppType) {
|
|
|
648
648
|
/**
|
|
649
649
|
* True for types that own a string buffer and therefore need `.c_str()` when
|
|
650
650
|
* passed to a C variadic (printf/snprintf): `std::string`, `__tc_str_ptr`,
|
|
651
|
-
* and platform string types like
|
|
651
|
+
* and platform string types like `String`. NOT true for `const char*`
|
|
652
652
|
* / `char*`, which are already C-strings.
|
|
653
653
|
*
|
|
654
654
|
* This is the structured replacement for the
|
|
@@ -121,7 +121,7 @@ export interface ResolvedDisplay extends DisplayProfile {
|
|
|
121
121
|
_mountBus: string;
|
|
122
122
|
_mountAddress: number;
|
|
123
123
|
_mountReset: number;
|
|
124
|
-
/** Framework build target string (e.g.
|
|
124
|
+
/** Framework build target string (e.g. a Zephyr board target like
|
|
125
125
|
* "esp32:esp32:esp32s3:PSRAM=opi" or an IDF target). Carried through for
|
|
126
126
|
* framework-side toolchain/compile use; cuttlefish itself does not parse it.
|
|
127
127
|
* Optional. */
|
|
@@ -200,9 +200,7 @@ export function generateTouchAdapter(touch, strategy) {
|
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
202
|
throw new Error(`No touch adapter for library "${touch.library}". ` +
|
|
203
|
-
`
|
|
204
|
-
`
|
|
205
|
-
`
|
|
206
|
-
`resolveTouchAdapter can dispatch to them. Otherwise use the framework-agnostic ` +
|
|
207
|
-
`"sdl" library, or { adapter: './path' } for a custom touch adapter.`);
|
|
203
|
+
`Pass a framework strategy whose resolveTouchAdapter dispatches to that driver, ` +
|
|
204
|
+
`use the framework-agnostic "sdl" library, or pass { adapter: './path' } for a ` +
|
|
205
|
+
`custom touch adapter.`);
|
|
208
206
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FrameworkManifest } from './framework-manifest.js';
|
|
2
|
-
export declare const KNOWN_FRAMEWORK_PACKAGES: readonly ["@typecad/framework-
|
|
2
|
+
export declare const KNOWN_FRAMEWORK_PACKAGES: readonly ["@typecad/framework-zephyr"];
|
|
3
3
|
export type KnownFrameworkPackage = typeof KNOWN_FRAMEWORK_PACKAGES[number];
|
|
4
4
|
/**
|
|
5
5
|
* Loads a framework's manifest via its `./framework.manifest` subpath export.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
declare const HAL_CATEGORIES: readonly ["gpio", "pwm", "adc", "dac", "interrupts", "
|
|
2
|
+
declare const HAL_CATEGORIES: readonly ["gpio", "pwm", "adc", "dac", "interrupts", "timing", "i2c", "spi", "uart", "board", "wdt", "wifi", "http", "mqtt", "display"];
|
|
3
3
|
export type HalCategory = typeof HAL_CATEGORIES[number];
|
|
4
4
|
export declare const FrameworkManifestSchema: z.ZodObject<{
|
|
5
5
|
schemaVersion: z.ZodLiteral<1>;
|
|
@@ -19,9 +19,9 @@ export declare const FrameworkManifestSchema: z.ZodObject<{
|
|
|
19
19
|
entrypointFunctionName: z.ZodString;
|
|
20
20
|
requiresLoopFunction: z.ZodBoolean;
|
|
21
21
|
sourceExtension: z.ZodEnum<{
|
|
22
|
-
cpp: "cpp";
|
|
23
22
|
ino: "ino";
|
|
24
23
|
cc: "cc";
|
|
24
|
+
cpp: "cpp";
|
|
25
25
|
h: "h";
|
|
26
26
|
}>;
|
|
27
27
|
overrideBaseName: z.ZodOptional<z.ZodString>;
|
|
@@ -40,10 +40,10 @@ export declare const FrameworkManifestSchema: z.ZodObject<{
|
|
|
40
40
|
unsupportedReason: z.ZodOptional<z.ZodString>;
|
|
41
41
|
ops: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
42
42
|
stub: "stub";
|
|
43
|
-
polyfill: "polyfill";
|
|
44
43
|
supported: "supported";
|
|
45
44
|
unsupported: "unsupported";
|
|
46
45
|
"probe-inconclusive": "probe-inconclusive";
|
|
46
|
+
polyfill: "polyfill";
|
|
47
47
|
}>>;
|
|
48
48
|
partialCoverage: z.ZodDefault<z.ZodBoolean>;
|
|
49
49
|
}, z.core.$strip>;
|
|
@@ -55,10 +55,10 @@ export declare const FrameworkManifestSchema: z.ZodObject<{
|
|
|
55
55
|
unsupportedReason: z.ZodOptional<z.ZodString>;
|
|
56
56
|
ops: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
57
57
|
stub: "stub";
|
|
58
|
-
polyfill: "polyfill";
|
|
59
58
|
supported: "supported";
|
|
60
59
|
unsupported: "unsupported";
|
|
61
60
|
"probe-inconclusive": "probe-inconclusive";
|
|
61
|
+
polyfill: "polyfill";
|
|
62
62
|
}>>;
|
|
63
63
|
partialCoverage: z.ZodDefault<z.ZodBoolean>;
|
|
64
64
|
}, z.core.$strip>>>;
|
|
@@ -97,6 +97,7 @@ export declare const FrameworkManifestSchema: z.ZodObject<{
|
|
|
97
97
|
none: "none";
|
|
98
98
|
"<math.h>": "<math.h>";
|
|
99
99
|
"<Arduino.h>": "<Arduino.h>";
|
|
100
|
+
"<cmath>": "<cmath>";
|
|
100
101
|
}>;
|
|
101
102
|
needsStdString: z.ZodBoolean;
|
|
102
103
|
needsStdVector: z.ZodBoolean;
|
|
@@ -140,8 +141,8 @@ export type FrameworkManifest = z.infer<typeof FrameworkManifestSchema>;
|
|
|
140
141
|
* polyfill id that backs it.
|
|
141
142
|
*
|
|
142
143
|
* The manifest validator uses this to verify `polyfill`-declared ops: if a
|
|
143
|
-
* manifest declares `
|
|
144
|
-
*
|
|
144
|
+
* manifest declares an op as `polyfill`, the framework's `polyfills.emitted`
|
|
145
|
+
* list must include the polyfill id named here.
|
|
145
146
|
*
|
|
146
147
|
* Keep in sync with the transpiler's lowering routes — when a new op kind
|
|
147
148
|
* starts being routed via a polyfill instead of the HAL resolver, add it
|