@typecad/framework-zephyr 1.0.0-alpha.16 → 1.0.0-alpha.19
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/LICENSE +202 -21
- package/README.md +49 -87
- package/dist/as-built.d.ts +2 -2
- package/dist/as-built.js +2 -2
- package/dist/audit.d.ts +111 -0
- package/dist/audit.js +416 -0
- package/dist/boardgen.d.ts +1 -9
- package/dist/boardgen.js +288 -47
- package/dist/chips/resolve.js +20 -0
- package/dist/chips/types.d.ts +22 -1
- package/dist/debug-codegen.js +1 -1
- package/dist/display/bindings.d.ts +55 -0
- package/dist/display/bindings.js +316 -0
- package/dist/display/gfx.d.ts +2 -3
- package/dist/display/gfx.js +166 -154
- package/dist/display/index.js +20 -1
- package/dist/display/mipi-dbi-host.d.ts +9 -0
- package/dist/display/mipi-dbi-host.js +174 -0
- package/dist/display/profiles.d.ts +109 -4
- package/dist/display/profiles.js +270 -7
- package/dist/display/touch-adapter.js +119 -49
- package/dist/display/ui-adapter-eink.d.ts +2 -0
- package/dist/display/ui-adapter-eink.js +4 -0
- package/dist/display/ui-adapter-gray.d.ts +8 -0
- package/dist/display/ui-adapter-gray.js +170 -0
- package/dist/display/ui-adapter-mono.d.ts +13 -0
- package/dist/display/ui-adapter-mono.js +230 -0
- package/dist/display/ui-adapter-native.d.ts +10 -0
- package/dist/display/ui-adapter-native.js +295 -0
- package/dist/display/ui-adapter-shared.d.ts +11 -0
- package/dist/display/ui-adapter-shared.js +122 -0
- package/dist/display/ui-adapter.js +510 -558
- package/dist/doctor.js +4 -4
- package/dist/dt-config/custom-board.js +2 -2
- package/dist/dt-config/kconfig.d.ts +62 -1
- package/dist/dt-config/kconfig.js +141 -38
- package/dist/dt-config/overlay.d.ts +15 -2
- package/dist/dt-config/overlay.js +433 -18
- package/dist/framework.manifest.d.ts +10 -4
- package/dist/framework.manifest.js +133 -17
- package/dist/index.d.ts +2 -0
- package/dist/index.js +14 -6
- package/dist/licenses.d.ts +2 -2
- package/dist/licenses.js +13 -92
- package/dist/lowering/can.d.ts +25 -0
- package/dist/lowering/can.js +97 -0
- package/dist/lowering/clock.d.ts +17 -0
- package/dist/lowering/clock.js +58 -0
- package/dist/lowering/fs.js +1 -1
- package/dist/lowering/gpio.js +0 -32
- package/dist/lowering/hid.d.ts +27 -0
- package/dist/lowering/hid.js +244 -0
- package/dist/lowering/http.js +264 -32
- package/dist/lowering/i2c.d.ts +8 -0
- package/dist/lowering/i2c.js +137 -5
- package/dist/lowering/i2s.d.ts +27 -0
- package/dist/lowering/i2s.js +98 -0
- package/dist/lowering/index.d.ts +9 -1
- package/dist/lowering/index.js +25 -1
- package/dist/lowering/interrupts.js +6 -0
- package/dist/lowering/matrix.d.ts +15 -0
- package/dist/lowering/matrix.js +63 -0
- package/dist/lowering/mqtt.js +110 -8
- package/dist/lowering/power.d.ts +3 -2
- package/dist/lowering/power.js +20 -45
- package/dist/lowering/pwm.js +25 -0
- package/dist/lowering/sensor.d.ts +2 -2
- package/dist/lowering/sensor.js +8 -4
- package/dist/lowering/strip.d.ts +16 -0
- package/dist/lowering/strip.js +70 -0
- package/dist/lowering/thread.js +5 -1
- package/dist/lowering/trace.d.ts +44 -0
- package/dist/lowering/trace.js +239 -0
- package/dist/lowering/uart.js +6 -1
- package/dist/lowering/usb.d.ts +3 -1
- package/dist/lowering/usb.js +16 -13
- package/dist/lowering/wdt.js +2 -29
- package/dist/sbom.d.ts +181 -0
- package/dist/sbom.js +901 -0
- package/dist/sdk/board-catalog-sync.d.ts +1 -3
- package/dist/sdk/board-catalog-sync.js +4 -10
- package/dist/strategy.d.ts +82 -46
- package/dist/strategy.js +639 -182
- package/dist/tmp-probe.d.ts +2 -0
- package/dist/tmp-probe.js +9 -0
- package/dist/toolchain/debug-config.d.ts +50 -90
- package/dist/toolchain/debug-config.js +239 -510
- package/dist/toolchain/env-check.d.ts +1 -3
- package/dist/toolchain/env-check.js +2 -7
- package/dist/toolchain/index.d.ts +28 -3
- package/dist/toolchain/index.js +498 -62
- package/dist/toolchain/runners.d.ts +16 -0
- package/dist/toolchain/runners.js +75 -0
- package/dist/toolchain/scaffold.d.ts +5 -2
- package/dist/toolchain/scaffold.js +79 -15
- package/dist/toolchain/west-discover.d.ts +6 -0
- package/dist/toolchain/west-discover.js +36 -13
- package/dist/toolchain/west-spawn.js +8 -2
- package/dist/west-inventory.d.ts +25 -0
- package/dist/west-inventory.js +97 -0
- package/installer/README.md +328 -328
- package/installer/install.sh +2 -2
- package/installer/templates/project/.typecad/activate-zephyr.ps1 +1 -1
- package/installer/templates/project/.typecad/activate-zephyr.sh +1 -1
- package/installer/templates/project/.vscode/settings.json +1 -1
- package/installer/templates/project/README.md +2 -2
- package/package.json +5 -5
- package/src/as-built.ts +206 -206
- package/src/audit.ts +529 -0
- package/src/boardgen.ts +265 -50
- package/src/chips/resolve.ts +21 -0
- package/src/chips/types.ts +10 -1
- package/src/display/bindings.ts +347 -0
- package/src/display/gfx.ts +318 -306
- package/src/display/index.ts +87 -70
- package/src/display/mipi-dbi-host.ts +183 -0
- package/src/display/profiles.ts +458 -139
- package/src/display/touch-adapter.ts +119 -49
- package/src/display/ui-adapter-eink.ts +13 -0
- package/src/display/ui-adapter-gray.ts +178 -0
- package/src/display/ui-adapter-mono.ts +238 -0
- package/src/display/ui-adapter-native.ts +304 -0
- package/src/display/ui-adapter-shared.ts +125 -0
- package/src/display/ui-adapter.ts +732 -781
- package/src/doctor.ts +4 -4
- package/src/dt-config/custom-board.ts +2 -2
- package/src/dt-config/kconfig.ts +647 -505
- package/src/dt-config/overlay.ts +1475 -1058
- package/src/framework.manifest.ts +659 -535
- package/src/index.ts +16 -6
- package/src/licenses.ts +346 -425
- package/src/lowering/can.ts +140 -0
- package/src/lowering/clock.ts +91 -0
- package/src/lowering/fs.ts +135 -135
- package/src/lowering/gpio.ts +0 -33
- package/src/lowering/hid.ts +261 -0
- package/src/lowering/http.ts +264 -32
- package/src/lowering/i2c.ts +142 -5
- package/src/lowering/i2s.ts +143 -0
- package/src/lowering/index.ts +18 -1
- package/src/lowering/interrupts.ts +6 -0
- package/src/lowering/matrix.ts +70 -0
- package/src/lowering/mqtt.ts +109 -8
- package/src/lowering/power.ts +41 -0
- package/src/lowering/pwm.ts +192 -167
- package/src/lowering/sensor.ts +159 -155
- package/src/lowering/strip.ts +81 -0
- package/src/lowering/thread.ts +5 -1
- package/src/lowering/trace.ts +270 -0
- package/src/lowering/uart.ts +6 -1
- package/src/lowering/usb.ts +16 -13
- package/src/lowering/wdt.ts +2 -25
- package/src/sbom.ts +1117 -0
- package/src/sdk/board-catalog-sync.ts +4 -25
- package/src/strategy.ts +2680 -2309
- package/src/toolchain/debug-config.ts +262 -522
- package/src/toolchain/env-check.ts +279 -285
- package/src/toolchain/index.ts +1792 -1359
- package/src/toolchain/runners.ts +80 -0
- package/src/toolchain/scaffold.ts +355 -296
- package/src/toolchain/west-discover.ts +35 -13
- package/src/toolchain/west-spawn.ts +174 -168
- package/src/west-inventory.ts +102 -0
- package/dist/async/timer-polyfill.d.ts +0 -10
- package/dist/async/timer-polyfill.js +0 -95
- package/dist/chips/board-overrides.d.ts +0 -7
- package/dist/chips/board-overrides.js +0 -11
- package/dist/chips/esp32.d.ts +0 -2
- package/dist/chips/esp32.js +0 -71
- package/dist/chips/esp32s3.d.ts +0 -2
- package/dist/chips/esp32s3.js +0 -103
- package/dist/chips/soc/.d.ts +0 -2
- package/dist/chips/soc/.js +0 -129
- package/dist/chips/soc/esp32.d.ts +0 -2
- package/dist/chips/soc/esp32.js +0 -120
- package/dist/chips/soc/esp32c3.d.ts +0 -2
- package/dist/chips/soc/esp32c3.js +0 -90
- package/dist/chips/soc/esp32c6.d.ts +0 -2
- package/dist/chips/soc/esp32c6.js +0 -109
- package/dist/chips/soc/esp32s3.d.ts +0 -2
- package/dist/chips/soc/esp32s3.js +0 -189
- package/dist/chips/soc/index.d.ts +0 -2
- package/dist/chips/soc/index.js +0 -23
- package/dist/chips/soc/nrf52840.d.ts +0 -2
- package/dist/chips/soc/nrf52840.js +0 -130
- package/dist/chips/soc/rp2040.d.ts +0 -2
- package/dist/chips/soc/rp2040.js +0 -141
- package/dist/chips/soc/rp2350a.d.ts +0 -2
- package/dist/chips/soc/rp2350a.js +0 -145
- package/dist/chips/soc/samd21g18a.d.ts +0 -2
- package/dist/chips/soc/samd21g18a.js +0 -143
- package/dist/chips/soc/stm32f411xe.d.ts +0 -2
- package/dist/chips/soc/stm32f411xe.js +0 -251
- package/dist/chips/xiao-ble.d.ts +0 -2
- package/dist/chips/xiao-ble.js +0 -100
- package/dist/lowering/pulse.d.ts +0 -7
- package/dist/lowering/pulse.js +0 -51
- package/dist/lowering/tone.d.ts +0 -10
- package/dist/lowering/tone.js +0 -63
- package/dist/lowering/worker-backing.d.ts +0 -14
- package/dist/lowering/worker-backing.js +0 -79
- package/dist/lowering/worker.d.ts +0 -6
- package/dist/lowering/worker.js +0 -14
- package/dist/sdk/board-data.generated.d.ts +0 -2
- package/dist/sdk/board-data.generated.js +0 -4
- package/dist/sdk/catalog-walker.d.ts +0 -90
- package/dist/sdk/catalog-walker.js +0 -682
- package/dist/sdk/dts-reader.d.ts +0 -83
- package/dist/sdk/dts-reader.js +0 -596
- package/src/debug-codegen.ts +0 -207
|
@@ -40,7 +40,7 @@ export interface ZephyrEnvCheck {
|
|
|
40
40
|
compatRange: string | undefined;
|
|
41
41
|
/** Result of the compat-range check against the detected version. */
|
|
42
42
|
compatStatus: CompatStatus;
|
|
43
|
-
/** Raw board target from
|
|
43
|
+
/** Raw board target from typecad-hal.config.ts, if configured. */
|
|
44
44
|
buildTarget: string | undefined;
|
|
45
45
|
/** buildTarget normalized for the installed Zephyr version (may equal it). */
|
|
46
46
|
resolvedBoardTarget: string | undefined;
|
|
@@ -61,8 +61,6 @@ export type ZephyrEnvFailure = {
|
|
|
61
61
|
fixCommand: string | undefined;
|
|
62
62
|
};
|
|
63
63
|
export type ZephyrEnvResult = ZephyrEnvOk | ZephyrEnvFailure;
|
|
64
|
-
/** Clear the west-probe cache (for tests). Also resets discovery cache. */
|
|
65
|
-
export declare function resetWestProbeCacheForTest(): void;
|
|
66
64
|
/**
|
|
67
65
|
* Gather west facts: discover a usable install, then run `west --version`
|
|
68
66
|
* through it to capture the version. Memoized for the process lifetime (west
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ---------------------------------------------------------------------------
|
|
2
|
-
// Zephyr environment check — the shared detection behind `
|
|
2
|
+
// Zephyr environment check — the shared detection behind `typecad-hal doctor`.
|
|
3
3
|
//
|
|
4
4
|
// Zephyr environment check: gather the impure
|
|
5
5
|
// environment facts once (west presence + version, Zephyr version, board
|
|
@@ -21,16 +21,11 @@
|
|
|
21
21
|
import { spawnSync } from 'node:child_process';
|
|
22
22
|
import { existsSync, readdirSync } from 'node:fs';
|
|
23
23
|
import { join } from 'node:path';
|
|
24
|
-
import { discoverWest
|
|
24
|
+
import { discoverWest } from './west-discover.js';
|
|
25
25
|
import { westSpawn } from './west-spawn.js';
|
|
26
26
|
import { detectZephyrVersion, checkZephyrCompat, resolveBoardTarget, } from './compat.js';
|
|
27
27
|
// ---- west probe (impure; isolated + cached + overridable) ------------------
|
|
28
28
|
let cachedProbe;
|
|
29
|
-
/** Clear the west-probe cache (for tests). Also resets discovery cache. */
|
|
30
|
-
export function resetWestProbeCacheForTest() {
|
|
31
|
-
cachedProbe = undefined;
|
|
32
|
-
resetWestDiscoveryCache();
|
|
33
|
-
}
|
|
34
29
|
/**
|
|
35
30
|
* Gather west facts: discover a usable install, then run `west --version`
|
|
36
31
|
* through it to capture the version. Memoized for the process lifetime (west
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { ToolchainOptions, CompileResult, UploadResult } from '@typecad/cuttlefish/api/shared';
|
|
2
2
|
import type { ZephyrChipDescriptor } from '../chips/types.js';
|
|
3
|
+
export declare function scanMatrix(src: string): {
|
|
4
|
+
rows: number[];
|
|
5
|
+
cols: number[];
|
|
6
|
+
} | undefined;
|
|
7
|
+
export declare function scanHid(src: string): 'keyboard' | 'mouse' | undefined;
|
|
8
|
+
export declare function scanStrips(src: string): Array<{
|
|
9
|
+
index: number;
|
|
10
|
+
count: number;
|
|
11
|
+
}>;
|
|
3
12
|
/**
|
|
4
13
|
* Distinct DT-bound sensors the emitted sources reference — the lowering's
|
|
5
14
|
* state blocks name each one `__tc_sensor_<part>_i2c<N>_0x<addr>_dev`
|
|
@@ -11,10 +20,12 @@ export interface ScannedSensorPart {
|
|
|
11
20
|
part: string;
|
|
12
21
|
busIndex: number;
|
|
13
22
|
port: number;
|
|
14
|
-
busKind: 'i2c' | 'spi';
|
|
23
|
+
busKind: 'i2c' | 'spi' | 'w1';
|
|
15
24
|
spiHz: number;
|
|
16
25
|
spiMode: number;
|
|
17
26
|
alertPin: number;
|
|
27
|
+
/** 1-Wire parts: the converter resolution in bits. */
|
|
28
|
+
resolution: number;
|
|
18
29
|
}
|
|
19
30
|
export interface ScannedSpiTarget {
|
|
20
31
|
busIndex: number;
|
|
@@ -28,7 +39,7 @@ export interface ScannedSpiTarget {
|
|
|
28
39
|
export declare function scanSpiTargets(src: string): ScannedSpiTarget[];
|
|
29
40
|
export declare function scanSensorParts(src: string): ScannedSensorPart[];
|
|
30
41
|
/**
|
|
31
|
-
* Derive the Zephyr project root from the
|
|
42
|
+
* Derive the Zephyr project root from the typecad-hal-emitted source path.
|
|
32
43
|
*
|
|
33
44
|
* Cuttlefish emits `src/main.cpp` under the output dir. The CLI passes
|
|
34
45
|
* `sourcePath` = full path to `main.cpp` and `outputDir` = its parent (`src/`).
|
|
@@ -43,7 +54,7 @@ export declare function projectRootFromOptions(o: ToolchainOptions): string;
|
|
|
43
54
|
* runner for its hardware (xiao_ble → nrfutil, esp32* → esptool), and `west
|
|
44
55
|
* flash` resolves it automatically. The framework only intervenes where the
|
|
45
56
|
* board default needs an argument it can't infer:
|
|
46
|
-
* - An explicit `zephyr.runner` (from
|
|
57
|
+
* - An explicit `zephyr.runner` (from typecad-hal.config.ts) always wins.
|
|
47
58
|
* - ESP32 boards forward the port via `--esp-device` (esptool reads the
|
|
48
59
|
* device from it); board.cmake still picks the runner.
|
|
49
60
|
* - Every other board trusts the board.cmake default. Previously this forced
|
|
@@ -78,6 +89,15 @@ export type ProbeResolution = {
|
|
|
78
89
|
ok: false;
|
|
79
90
|
error: string;
|
|
80
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* The board a cached build dir was configured for (CMakeCache.txt's
|
|
94
|
+
* BOARD:STRING — the exact value passed to `west build -b`), or undefined
|
|
95
|
+
* when no cache exists. compile() compares it against the requested board
|
|
96
|
+
* and nukes the dir on mismatch: `west build`'s --pristine=auto covers
|
|
97
|
+
* cmake/config churn, NOT a board switch — west aborts with "refusing to
|
|
98
|
+
* proceed without --force", and cuttlefish doesn't forward that flag.
|
|
99
|
+
*/
|
|
100
|
+
export declare function cachedBuildBoard(buildDir: string): string | undefined;
|
|
81
101
|
export declare function resolveProbeMethod(zc: Record<string, unknown> | undefined, chip: ZephyrChipDescriptor, purpose?: 'flash' | 'debug'): ProbeResolution;
|
|
82
102
|
/**
|
|
83
103
|
* Run an openocd session against the board's probe config — the shared
|
|
@@ -197,4 +217,9 @@ export declare const Toolchain: {
|
|
|
197
217
|
upload(o: ToolchainOptions): UploadResult;
|
|
198
218
|
monitor(o: ToolchainOptions): void;
|
|
199
219
|
debug(o: ToolchainOptions): void;
|
|
220
|
+
debugServer(o: ToolchainOptions, action: "start" | "stop"): void;
|
|
200
221
|
};
|
|
222
|
+
/** How long `--monitor` waits for the port to (re)appear after a flash reset. */
|
|
223
|
+
export declare const MONITOR_PORT_WAIT_MS = 8000;
|
|
224
|
+
/** argv for the pyserial port wait — exported for the toolchain unit tests. */
|
|
225
|
+
export declare function serialPortWaitArgs(port: string, timeoutMs: number): string[];
|