@typecad/framework-zephyr 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 +22 -35
- package/dist/as-built.d.ts +33 -0
- package/dist/as-built.js +188 -0
- package/dist/async/timer-polyfill.js +1 -1
- package/dist/boardgen.d.ts +128 -0
- package/dist/boardgen.js +1366 -0
- package/dist/chips/board-overrides.d.ts +7 -0
- package/dist/chips/board-overrides.js +11 -0
- package/dist/chips/controllers.d.ts +28 -8
- package/dist/chips/controllers.js +49 -12
- package/dist/chips/esp32s3.js +49 -0
- package/dist/chips/index.d.ts +6 -12
- package/dist/chips/index.js +18 -34
- package/dist/chips/resolve.d.ts +16 -2
- package/dist/chips/resolve.js +298 -15
- package/dist/chips/soc/.d.ts +2 -0
- package/dist/chips/soc/.js +129 -0
- package/dist/chips/soc/esp32.d.ts +2 -0
- package/dist/chips/soc/esp32.js +120 -0
- package/dist/chips/soc/esp32c3.d.ts +2 -0
- package/dist/chips/soc/esp32c3.js +90 -0
- package/dist/chips/soc/esp32c6.d.ts +2 -0
- package/dist/chips/soc/esp32c6.js +109 -0
- package/dist/chips/soc/esp32s3.d.ts +2 -0
- package/dist/chips/soc/esp32s3.js +189 -0
- package/dist/chips/soc/index.d.ts +2 -0
- package/dist/chips/soc/index.js +23 -0
- package/dist/chips/soc/nrf52840.d.ts +2 -0
- package/dist/chips/soc/nrf52840.js +130 -0
- package/dist/chips/soc/rp2040.d.ts +2 -0
- package/dist/chips/soc/rp2040.js +141 -0
- package/dist/chips/soc/rp2350a.d.ts +2 -0
- package/dist/chips/soc/rp2350a.js +145 -0
- package/dist/chips/soc/samd21g18a.d.ts +2 -0
- package/dist/chips/soc/samd21g18a.js +143 -0
- package/dist/chips/soc/stm32f411xe.d.ts +2 -0
- package/dist/chips/soc/stm32f411xe.js +251 -0
- package/dist/chips/types.d.ts +382 -12
- package/dist/chips/xiao-ble.js +33 -0
- package/dist/display/profiles.js +1 -1
- package/dist/doctor.js +38 -4
- package/dist/dt-config/custom-board.d.ts +23 -0
- package/dist/dt-config/custom-board.js +227 -0
- package/dist/dt-config/kconfig.d.ts +83 -1
- package/dist/dt-config/kconfig.js +116 -27
- package/dist/dt-config/overlay.js +623 -18
- package/dist/framework.manifest.d.ts +20 -30
- package/dist/framework.manifest.js +124 -178
- package/dist/index.d.ts +4 -1
- package/dist/index.js +8 -2
- package/dist/lowering/adc.d.ts +26 -5
- package/dist/lowering/adc.js +137 -31
- package/dist/lowering/ble.js +31 -28
- package/dist/lowering/dac.js +9 -9
- package/dist/lowering/fs.js +18 -10
- package/dist/lowering/gpio.d.ts +2 -0
- package/dist/lowering/gpio.js +90 -10
- package/dist/lowering/http.js +39 -14
- package/dist/lowering/hwtimer.d.ts +4 -0
- package/dist/lowering/hwtimer.js +35 -10
- package/dist/lowering/i2c.js +46 -54
- package/dist/lowering/index.d.ts +5 -5
- package/dist/lowering/index.js +15 -16
- package/dist/lowering/interrupts.d.ts +22 -5
- package/dist/lowering/interrupts.js +104 -22
- package/dist/lowering/mqtt.js +12 -6
- package/dist/lowering/power.js +0 -4
- package/dist/lowering/preferences.js +49 -77
- package/dist/lowering/pulse.js +5 -36
- package/dist/lowering/pwm.d.ts +32 -3
- package/dist/lowering/pwm.js +105 -17
- package/dist/lowering/random.js +3 -3
- package/dist/lowering/sensor.d.ts +37 -0
- package/dist/lowering/sensor.js +119 -0
- package/dist/lowering/spi.d.ts +12 -0
- package/dist/lowering/spi.js +65 -40
- package/dist/lowering/thread.d.ts +14 -0
- package/dist/lowering/thread.js +55 -0
- package/dist/lowering/timing.js +20 -46
- package/dist/lowering/tone.js +18 -5
- package/dist/lowering/uart.d.ts +13 -0
- package/dist/lowering/uart.js +72 -51
- package/dist/lowering/usb.d.ts +34 -0
- package/dist/lowering/usb.js +206 -0
- package/dist/lowering/wdt.d.ts +1 -1
- package/dist/lowering/wdt.js +17 -7
- package/dist/lowering/wifi.d.ts +3 -2
- package/dist/lowering/wifi.js +120 -111
- package/dist/sdk/board-catalog-sync.d.ts +16 -0
- package/dist/sdk/board-catalog-sync.js +41 -0
- package/dist/sdk/board-data.generated.d.ts +2 -0
- package/dist/sdk/board-data.generated.js +4 -0
- package/dist/sdk/catalog-walker.d.ts +90 -0
- package/dist/sdk/catalog-walker.js +682 -0
- package/dist/sdk/dts-reader.d.ts +83 -0
- package/dist/sdk/dts-reader.js +596 -0
- package/dist/strategy.d.ts +136 -17
- package/dist/strategy.js +881 -212
- package/dist/toolchain/bossac-touch.d.ts +18 -0
- package/dist/toolchain/bossac-touch.js +88 -0
- package/dist/toolchain/compat.d.ts +2 -2
- package/dist/toolchain/compat.js +8 -3
- package/dist/toolchain/debug-config.d.ts +21 -26
- package/dist/toolchain/debug-config.js +212 -72
- package/dist/toolchain/env-check.d.ts +4 -4
- package/dist/toolchain/env-check.js +5 -5
- package/dist/toolchain/index.d.ts +66 -1
- package/dist/toolchain/index.js +713 -58
- package/dist/toolchain/scaffold.d.ts +9 -0
- package/dist/toolchain/scaffold.js +84 -7
- package/dist/toolchain/west-discover.d.ts +8 -1
- package/dist/toolchain/west-discover.js +19 -6
- package/dist/toolchain/west-spawn.js +17 -5
- package/installer/CHANGELOG.md +473 -0
- package/installer/README.md +328 -0
- package/installer/environment.yml +46 -0
- package/installer/etc/conda/activate.d/zephyr.bat +7 -0
- package/installer/etc/conda/activate.d/zephyr.ps1 +12 -0
- package/installer/etc/conda/activate.d/zephyr.sh +20 -0
- package/installer/etc/conda/deactivate.d/zephyr.bat +6 -0
- package/installer/etc/conda/deactivate.d/zephyr.ps1 +6 -0
- package/installer/etc/conda/deactivate.d/zephyr.sh +4 -0
- package/installer/install.mjs +580 -0
- package/installer/install.ps1 +619 -0
- package/installer/install.sh +310 -0
- package/installer/lib/detect-platform.sh +62 -0
- package/installer/lib/fetch-sdk.sh +304 -0
- package/installer/lib/init-workspace.sh +153 -0
- package/installer/lib/write-activation.sh +76 -0
- package/installer/patches/tfm-c-include-separators.patch +19 -0
- package/installer/patches/zephyr-tfm-nordic-zephyr-include.patch +24 -0
- package/installer/templates/project/.typecad/activate-zephyr.ps1 +31 -0
- package/installer/templates/project/.typecad/activate-zephyr.sh +31 -0
- package/installer/templates/project/.vscode/settings.json +30 -0
- package/installer/templates/project/README.md +58 -0
- package/installer/versions.env +110 -0
- package/package.json +16 -16
- package/src/as-built.ts +206 -0
- package/src/boardgen.ts +1428 -0
- package/src/chips/controllers.ts +61 -12
- package/src/chips/index.ts +35 -54
- package/src/chips/resolve.ts +316 -14
- package/src/chips/types.ts +388 -13
- package/src/display/profiles.ts +1 -1
- package/src/doctor.ts +110 -77
- package/src/dt-config/custom-board.ts +325 -0
- package/src/dt-config/kconfig.ts +177 -19
- package/src/dt-config/overlay.ts +1058 -450
- package/src/framework.manifest.ts +125 -178
- package/src/index.ts +57 -41
- package/src/lowering/adc.ts +222 -102
- package/src/lowering/ble.ts +32 -28
- package/src/lowering/dac.ts +82 -82
- package/src/lowering/fs.ts +18 -10
- package/src/lowering/gpio.ts +242 -152
- package/src/lowering/http.ts +512 -488
- package/src/lowering/hwtimer.ts +139 -101
- package/src/lowering/i2c.ts +116 -126
- package/src/lowering/index.ts +91 -93
- package/src/lowering/interrupts.ts +113 -21
- package/src/lowering/mqtt.ts +12 -6
- package/src/lowering/preferences.ts +327 -354
- package/src/lowering/pwm.ts +167 -74
- package/src/lowering/random.ts +3 -3
- package/src/lowering/sensor.ts +155 -0
- package/src/lowering/spi.ts +164 -124
- package/src/lowering/thread.ts +63 -0
- package/src/lowering/timing.ts +46 -72
- package/src/lowering/uart.ts +73 -51
- package/src/lowering/usb.ts +221 -0
- package/src/lowering/wdt.ts +95 -84
- package/src/lowering/wifi.ts +120 -111
- package/src/sdk/board-catalog-sync.ts +62 -0
- package/src/strategy.ts +888 -229
- package/src/toolchain/bossac-touch.ts +112 -0
- package/src/toolchain/compat.ts +8 -3
- package/src/toolchain/debug-config.ts +666 -522
- package/src/toolchain/env-check.ts +9 -9
- package/src/toolchain/index.ts +765 -44
- package/src/toolchain/scaffold.ts +81 -7
- package/src/toolchain/west-discover.ts +334 -316
- package/src/toolchain/west-spawn.ts +17 -5
- package/src/async/timer-polyfill.ts +0 -107
- package/src/chips/esp32.ts +0 -74
- package/src/chips/esp32s3.ts +0 -57
- package/src/chips/xiao-ble.ts +0 -70
- package/src/lowering/power.ts +0 -70
- package/src/lowering/pulse.ts +0 -93
- package/src/lowering/tone.ts +0 -60
- package/src/lowering/worker-backing.ts +0 -94
- package/src/lowering/worker.ts +0 -17
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Zephyr framework manifest
|
|
3
3
|
//
|
|
4
4
|
// Coverage reflects actual resolveHALOperation / lowerHalOp + resolveDisplayOp
|
|
5
|
-
// behavior. GPIO, PWM, ADC, I2C, SPI, UART, interrupts,
|
|
5
|
+
// behavior. GPIO, PWM, ADC, I2C, SPI, UART, interrupts, pulse,
|
|
6
6
|
// shift, WDT, BLE, timing, WiFi, HTTP/S, MQTT, board constants, and random
|
|
7
7
|
// are lowered; display is lowered via the generic <zephyr/drivers/display.h>
|
|
8
8
|
// GFX runtime. WiFi/HTTP/MQTT require an ESP32 target (nRF52840 has no radio).
|
|
@@ -38,20 +38,23 @@ export default defineFrameworkManifest({
|
|
|
38
38
|
implementationMode: 'from-scratch',
|
|
39
39
|
|
|
40
40
|
entrypoint: {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
// Zephyr is a main()-based RTOS: top-level statements lower straight into
|
|
42
|
+
// main() (no setup()/loop() pair, no bridge shim). Event-driven programs
|
|
43
|
+
// get their scheduler loop appended inside main() by the driver machinery.
|
|
44
|
+
entrypointFunctionName: 'main',
|
|
45
|
+
requiresLoopFunction: false,
|
|
43
46
|
sourceExtension: 'cpp',
|
|
44
47
|
overrideBaseName: 'main',
|
|
45
48
|
outputSubdirectory: 'src',
|
|
46
49
|
generateHeaderFile: true,
|
|
47
|
-
customBridgeShim: 'main',
|
|
48
50
|
},
|
|
49
51
|
|
|
50
52
|
profile: {
|
|
51
53
|
// Informational list of supported board targets. The manifest validator
|
|
52
|
-
// never iterates this
|
|
53
|
-
//
|
|
54
|
-
|
|
54
|
+
// never iterates this. Every board in the catalog resolves the same way
|
|
55
|
+
// (resolveChipFromBoard over the generated manifest) — there is no
|
|
56
|
+
// curated target list.
|
|
57
|
+
targets: [],
|
|
55
58
|
forcedIncludes: ['<zephyr/kernel.h>', '<zephyr/drivers/gpio.h>', '<cstdint>'],
|
|
56
59
|
symbolAliases: {},
|
|
57
60
|
},
|
|
@@ -65,27 +68,29 @@ export default defineFrameworkManifest({
|
|
|
65
68
|
'gpio.write': 'supported',
|
|
66
69
|
'gpio.read': 'supported',
|
|
67
70
|
'gpio.toggle': 'supported',
|
|
68
|
-
|
|
71
|
+
// Thin GPIO (hal/gpio-pin.ts): construction flags as tokens, applied
|
|
72
|
+
// once per pin ahead of first use.
|
|
73
|
+
'gpio.configure': 'supported',
|
|
74
|
+
'gpio.read_cfg': 'supported', // fused guarded configure + read
|
|
75
|
+
'gpio.shift_out': 'supported',
|
|
76
|
+
'gpio.shift_in': 'supported',
|
|
69
77
|
},
|
|
70
78
|
},
|
|
71
79
|
|
|
72
|
-
// ── Supported: Timing (delay/millis/delay_us/micros
|
|
80
|
+
// ── Supported: Timing (delay/millis/delay_us/micros; timers via polyfill) ─
|
|
73
81
|
timing: {
|
|
74
82
|
supported: true,
|
|
75
83
|
partialCoverage: false,
|
|
76
84
|
ops: {
|
|
77
|
-
'timing.delay': 'supported', // → k_msleep(ms)
|
|
78
|
-
'timing.delay_microseconds': 'supported', // → k_busy_wait(us)
|
|
79
|
-
'timing.millis': 'supported', // → k_uptime_get_32()
|
|
80
|
-
'timing.micros': 'supported', // → k_cycle_get_32 + cycles/sec
|
|
81
|
-
'timing.free_heap': 'supported', // → 0 (no portable query; see lowering)
|
|
82
85
|
// Timer ops are POLYFILL_BACKED_OPS → timer_methods. The validator skips
|
|
83
86
|
// the resolver probe (these legitimately return polyfill-helper calls,
|
|
84
87
|
// not direct lowering) and requires the polyfill be in polyfills.emitted.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
'timing.
|
|
88
|
-
'timing.
|
|
88
|
+
// Time.* — the TS-flavored surface (hal/time.ts), preferred over the
|
|
89
|
+
// Arduino-named forms above for new code.
|
|
90
|
+
'timing.sleep': 'supported', // → k_msleep(ms) — Time.sleep
|
|
91
|
+
'timing.now': 'supported', // → k_uptime_get() — Time.now
|
|
92
|
+
'timing.now_us': 'supported', // → k_cyc_to_us_floor64 — Time.nowUs
|
|
93
|
+
'timing.busy_wait_us': 'supported', // → k_busy_wait(us) — Time.busyWaitUs
|
|
89
94
|
},
|
|
90
95
|
},
|
|
91
96
|
|
|
@@ -94,9 +99,11 @@ export default defineFrameworkManifest({
|
|
|
94
99
|
supported: true,
|
|
95
100
|
partialCoverage: false,
|
|
96
101
|
ops: {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
'pwm.
|
|
102
|
+
// Thin PWM (hal/pwm-pin.ts): ns-true verbs; construction period
|
|
103
|
+
// applies once, setDuty is 0.0–1.0 sugar over one set_pulse call.
|
|
104
|
+
'pwm.set_pulse': 'supported',
|
|
105
|
+
'pwm.set_duty': 'supported',
|
|
106
|
+
'pwm.set_period': 'supported',
|
|
100
107
|
},
|
|
101
108
|
},
|
|
102
109
|
|
|
@@ -105,11 +112,10 @@ export default defineFrameworkManifest({
|
|
|
105
112
|
supported: true,
|
|
106
113
|
partialCoverage: false,
|
|
107
114
|
ops: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
'adc.
|
|
111
|
-
'adc.
|
|
112
|
-
'adc.read_voltage': 'supported',
|
|
115
|
+
// Thin ADC (hal/adc-pin.ts): construction gain/reference tokens,
|
|
116
|
+
// lazy inline channel setup.
|
|
117
|
+
'adc.read_raw': 'supported',
|
|
118
|
+
'adc.read_mv': 'supported',
|
|
113
119
|
},
|
|
114
120
|
},
|
|
115
121
|
dac: {
|
|
@@ -119,77 +125,57 @@ export default defineFrameworkManifest({
|
|
|
119
125
|
// (zephyr-dac-pin-unavailable).
|
|
120
126
|
supported: true,
|
|
121
127
|
partialCoverage: true,
|
|
122
|
-
ops: {
|
|
128
|
+
ops: {
|
|
129
|
+
// Thin DAC (hal/dac-pin.ts): raw code, construction resolution.
|
|
130
|
+
'dac.write_value': 'supported',
|
|
131
|
+
},
|
|
123
132
|
},
|
|
124
133
|
interrupts: {
|
|
125
134
|
supported: true,
|
|
126
135
|
partialCoverage: true,
|
|
127
136
|
unsupportedReason: undefined,
|
|
128
137
|
ops: {
|
|
129
|
-
'interrupt.attach': 'supported',
|
|
130
138
|
'interrupt.detach': 'supported',
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
supported: true,
|
|
135
|
-
partialCoverage: true,
|
|
136
|
-
ops: {
|
|
137
|
-
'tone.play': 'supported', // PWM-based square wave (blocking for duration)
|
|
138
|
-
'tone.stop': 'supported',
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
power: {
|
|
142
|
-
supported: true,
|
|
143
|
-
partialCoverage: true,
|
|
144
|
-
ops: {
|
|
145
|
-
'power.deep_sleep': 'supported', // k_sleep (deepest allowed state)
|
|
146
|
-
'power.light_sleep': 'supported', // pm_state_force SUSPEND_TO_IDLE
|
|
147
|
-
'power.set_cpu_frequency': 'supported', // comment (nRF clock API deferred)
|
|
148
|
-
'power.deep_sleep_pin': 'supported', // GPIO-interrupt wake + k_sleep
|
|
139
|
+
// Thin GPIO interrupts (hal/gpio-pin.ts onInterrupt): INT_* tokens,
|
|
140
|
+
// covering the level modes the legacy mode strings could not express.
|
|
141
|
+
'interrupt.attach_flags': 'supported',
|
|
149
142
|
},
|
|
150
143
|
},
|
|
151
144
|
i2c: {
|
|
152
145
|
supported: true,
|
|
153
146
|
partialCoverage: false,
|
|
154
147
|
ops: {
|
|
155
|
-
|
|
156
|
-
'i2c.
|
|
157
|
-
'i2c.
|
|
158
|
-
'i2c.
|
|
159
|
-
'i2c.
|
|
160
|
-
'i2c.recover': 'supported',
|
|
148
|
+
// Thin I2C device (hal/i2c-target.ts): Zephyr register verbs.
|
|
149
|
+
'i2c.reg_write': 'supported',
|
|
150
|
+
'i2c.reg_read': 'supported',
|
|
151
|
+
'i2c.reg_update': 'supported',
|
|
152
|
+
'i2c.dev_write': 'supported',
|
|
161
153
|
},
|
|
162
154
|
},
|
|
163
155
|
spi: {
|
|
164
156
|
supported: true,
|
|
165
157
|
partialCoverage: false,
|
|
166
158
|
ops: {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
'spi.
|
|
170
|
-
'spi.
|
|
159
|
+
// Thin SPI device (hal/spi-target.ts): spi_dt_spec against the DT
|
|
160
|
+
// child node the overlay emits per constructed target.
|
|
161
|
+
'spi.transceive': 'supported',
|
|
162
|
+
'spi.dev_write': 'supported',
|
|
163
|
+
'spi.reg_read': 'supported',
|
|
171
164
|
},
|
|
172
165
|
},
|
|
173
166
|
uart: {
|
|
174
167
|
supported: true,
|
|
175
168
|
partialCoverage: true,
|
|
176
169
|
ops: {
|
|
177
|
-
|
|
178
|
-
'uart.
|
|
179
|
-
|
|
180
|
-
'uart.
|
|
170
|
+
// Thin UART (hal/uart-port.ts): poll API with construction baud.
|
|
171
|
+
'uart.poll_write': 'supported',
|
|
172
|
+
// Interrupt-drained RX ring (hal/uart-port.ts).
|
|
173
|
+
'uart.rx_arm': 'supported',
|
|
174
|
+
'uart.rx_available': 'supported',
|
|
175
|
+
'uart.rx_peek': 'supported',
|
|
176
|
+
'uart.rx_read': 'supported',
|
|
181
177
|
},
|
|
182
178
|
},
|
|
183
|
-
pulse: {
|
|
184
|
-
supported: true,
|
|
185
|
-
partialCoverage: true,
|
|
186
|
-
ops: { 'pulse.in': 'supported', 'pulse.in_long': 'supported' },
|
|
187
|
-
},
|
|
188
|
-
shift: {
|
|
189
|
-
supported: true,
|
|
190
|
-
partialCoverage: false,
|
|
191
|
-
ops: { 'shift.out': 'supported', 'shift.in': 'supported' },
|
|
192
|
-
},
|
|
193
179
|
board: {
|
|
194
180
|
// Board constant resolution. Board.definition.<path> /
|
|
195
181
|
// Pins.definition.<path> property accesses are folded by
|
|
@@ -207,13 +193,38 @@ export default defineFrameworkManifest({
|
|
|
207
193
|
supported: true,
|
|
208
194
|
partialCoverage: false,
|
|
209
195
|
ops: {
|
|
210
|
-
'wdt.enable': 'supported',
|
|
211
|
-
'wdt.reset': 'supported',
|
|
212
196
|
'wdt.disable': 'supported',
|
|
197
|
+
// Thin Watchdog (hal/watchdog.ts): construction timeout in ms.
|
|
198
|
+
'wdt.setup': 'supported',
|
|
199
|
+
'wdt.feed': 'supported',
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
// Thin Counter (hal/counter.ts) — Zephyr's counter driver with Zephyr's
|
|
203
|
+
// verbs, over the same per-instance state as hwtimer.*. Chips without a
|
|
204
|
+
// declared free counter lower to a comment + profileDiagnostics flag.
|
|
205
|
+
counter: {
|
|
206
|
+
supported: true,
|
|
207
|
+
partialCoverage: true,
|
|
208
|
+
ops: {
|
|
209
|
+
'counter.on_alarm': 'supported',
|
|
210
|
+
'counter.start': 'supported',
|
|
211
|
+
'counter.stop': 'supported',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
// Thin Thread (hal/thread.ts) — kernel threads. start(fn) is
|
|
215
|
+
// k_thread_create (K_NO_WAIT) over a per-slot stack sized by the
|
|
216
|
+
// construction stackKb; join is k_thread_join (K_FOREVER).
|
|
217
|
+
thread: {
|
|
218
|
+
supported: true,
|
|
219
|
+
partialCoverage: false,
|
|
220
|
+
ops: {
|
|
221
|
+
'thread.start': 'supported',
|
|
222
|
+
'thread.join': 'supported',
|
|
213
223
|
},
|
|
214
224
|
},
|
|
215
225
|
// ── Partial: WiFi (STA connect + scan + config via conn_mgr/net_mgmt) ────
|
|
216
|
-
// ESP32
|
|
226
|
+
// ESP32 family only (esp32, esp32s3, esp32c3, esp32c6) — profileDiagnostics
|
|
227
|
+
// flags wifi usage on radioless chips (nRF52840, RP2040/RP2350).
|
|
217
228
|
// AP mode, credential persistence, static IP, and event callbacks deferred.
|
|
218
229
|
wifi: {
|
|
219
230
|
supported: true,
|
|
@@ -222,51 +233,34 @@ export default defineFrameworkManifest({
|
|
|
222
233
|
// driver hook; credentials need a custom settings-subsystem layer; static IP
|
|
223
234
|
// / auto-reconnect / tx-power aren't wifi-shaped or aren't exposed by the
|
|
224
235
|
// esp32 Zephyr driver. See per-op reasons.
|
|
225
|
-
unsupportedReason: 'AP
|
|
236
|
+
unsupportedReason: 'Per-station AP enumeration and credential persistence have no Zephyr lowering (no driver/Kconfig hook).',
|
|
226
237
|
ops: {
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
'wifi.
|
|
231
|
-
'wifi.
|
|
232
|
-
|
|
233
|
-
'wifi.
|
|
238
|
+
// Station (8) — join carries the construction facts (credentials,
|
|
239
|
+
// security, band/channel, timeout, static IPv4, power-save);
|
|
240
|
+
// net_mgmt connect/disconnect + L4 connectivity state underneath.
|
|
241
|
+
'wifi.join': 'supported', 'wifi.connect_start': 'supported',
|
|
242
|
+
'wifi.disconnect': 'supported', 'wifi.is_connected': 'supported',
|
|
243
|
+
'wifi.local_ip': 'supported', 'wifi.rssi': 'supported',
|
|
244
|
+
'wifi.mac': 'supported',
|
|
234
245
|
// Scan (8) — net_mgmt NET_REQUEST_WIFI_SCAN + result pool.
|
|
235
|
-
|
|
246
|
+
// scan_start is the async split of scan (kick + poll scan_done);
|
|
247
|
+
// emitted synthetically by the async tier, no TS-facing method.
|
|
248
|
+
'wifi.scan': 'supported',
|
|
249
|
+
'wifi.scan_start': 'supported',
|
|
236
250
|
'wifi.scan_done': 'supported', 'wifi.scan_count': 'supported',
|
|
237
251
|
'wifi.scan_ssid': 'supported', 'wifi.scan_rssi': 'supported',
|
|
238
252
|
'wifi.scan_encryption': 'supported', 'wifi.scan_channel': 'supported',
|
|
239
|
-
// AP mode (2
|
|
240
|
-
// ssid/
|
|
241
|
-
// driver hook (config_params isn't wired, max_clients hardcodes 5).
|
|
253
|
+
// AP mode (2) — esp32 driver wires ap_enable/ap_disable. Only
|
|
254
|
+
// ssid/psk/channel are honored (the thin WiFiAP facts carry exactly those).
|
|
242
255
|
'wifi.ap_start': 'supported', 'wifi.ap_stop': 'supported',
|
|
243
|
-
// Config (2) — hostname (best-effort no-op) + power save (real net_mgmt).
|
|
244
|
-
'wifi.set_hostname': 'supported', 'wifi.set_power_save': 'supported',
|
|
245
256
|
// on_event: 'disconnect' (NET_EVENT_L4_DISCONNECTED) + 'connect'
|
|
246
257
|
// (NET_EVENT_IPV4_ADDR_ADD) are lowered.
|
|
247
258
|
'wifi.on_event': 'supported',
|
|
248
|
-
// ── Genuinely unsupported (no
|
|
259
|
+
// ── Genuinely unsupported (no driver hook) ─────────────────────────
|
|
249
260
|
// ap_client_count: no API to enumerate connected AP stations.
|
|
250
|
-
// ap_ip: set via net_if, not wifi net_mgmt.
|
|
251
|
-
// ap_set_channel: channel set at ap_start; driver doesn't wire ap_config_params.
|
|
252
|
-
// ap_set_hidden: esp32 ap_enable config has no ssid_hidden field.
|
|
253
|
-
// ap_set_max_clients: driver hardcodes max_connection to 5; config_params unwired.
|
|
254
|
-
// save_credentials/connect_saved/clear_credentials: no wifi-credentials API in
|
|
255
|
-
// Zephyr (would need a custom settings-subsystem layer).
|
|
256
|
-
// set_static_ip: a net_if operation, not a wifi net_mgmt request.
|
|
257
|
-
// set_auto_reconnect: esp32 driver doesn't expose esp_wifi_set_auto_connect.
|
|
258
|
-
// set_tx_power: driver owns the radio; the PHY ceiling isn't a Zephyr Kconfig (zephyr#45580).
|
|
259
261
|
'wifi.ap_client_count': 'unsupported',
|
|
260
|
-
'wifi.ap_ip': 'unsupported',
|
|
261
|
-
'wifi.ap_set_channel': 'unsupported',
|
|
262
|
-
'wifi.ap_set_hidden': 'unsupported',
|
|
263
|
-
'wifi.ap_set_max_clients': 'unsupported',
|
|
264
|
-
'wifi.save_credentials': 'unsupported', 'wifi.connect_saved': 'unsupported',
|
|
265
|
-
'wifi.clear_credentials': 'unsupported',
|
|
266
|
-
'wifi.set_static_ip': 'unsupported',
|
|
267
|
-
'wifi.set_auto_reconnect': 'unsupported',
|
|
268
|
-
'wifi.set_tx_power': 'unsupported',
|
|
269
262
|
},
|
|
263
|
+
|
|
270
264
|
},
|
|
271
265
|
http: {
|
|
272
266
|
supported: true,
|
|
@@ -277,7 +271,7 @@ export default defineFrameworkManifest({
|
|
|
277
271
|
// a networked target (ESP32 WiFi); profileDiagnostics flags usage on a
|
|
278
272
|
// radioless chip as 'zephyr-http-unavailable-on-target'.
|
|
279
273
|
ops: {
|
|
280
|
-
'http.begin': 'supported',
|
|
274
|
+
'http.begin': 'supported',
|
|
281
275
|
'http.set_header': 'supported', 'http.set_timeout': 'supported',
|
|
282
276
|
'http.set_max_body': 'supported', 'http.set_body': 'supported',
|
|
283
277
|
'http.set_insecure': 'supported', 'http.set_ca_cert': 'supported',
|
|
@@ -316,13 +310,6 @@ export default defineFrameworkManifest({
|
|
|
316
310
|
},
|
|
317
311
|
|
|
318
312
|
// ── Supported: Worker offload (k_work system workqueue + k_sem) ──────────
|
|
319
|
-
// worker.* is lowered via lowerWorkerOp against the shared __tc_worker
|
|
320
|
-
// contract; the Zephyr backing (worker-backing.ts) supplies k_work + k_sem.
|
|
321
|
-
worker: {
|
|
322
|
-
supported: true,
|
|
323
|
-
partialCoverage: false,
|
|
324
|
-
ops: { 'worker.submit': 'supported', 'worker.done': 'supported' },
|
|
325
|
-
},
|
|
326
313
|
|
|
327
314
|
// ── Honestly unsupported extended categories ─────────────────────────────
|
|
328
315
|
// These have op-kinds in HAL_OPERATION_KINDS but no Zephyr lowering. Each
|
|
@@ -331,12 +318,6 @@ export default defineFrameworkManifest({
|
|
|
331
318
|
// catchall schema (HalCoverageSchema) validates any declared extended
|
|
332
319
|
// category; declaring them keeps the manifest a complete coverage record.
|
|
333
320
|
|
|
334
|
-
rmt: {
|
|
335
|
-
supported: false,
|
|
336
|
-
unsupportedReason: 'RMT (ESP32 infrared/transaction peripheral) has no Zephyr lowering.',
|
|
337
|
-
partialCoverage: false,
|
|
338
|
-
ops: unsupportedOps('rmt.'),
|
|
339
|
-
},
|
|
340
321
|
snprintf: {
|
|
341
322
|
supported: false,
|
|
342
323
|
unsupportedReason: 'snprintf.emit is a raw escape hatch; the Zephyr resolver returns undefined (use rawCpp()).',
|
|
@@ -357,10 +338,8 @@ export default defineFrameworkManifest({
|
|
|
357
338
|
supported: true,
|
|
358
339
|
partialCoverage: false,
|
|
359
340
|
ops: {
|
|
360
|
-
'preferences.begin': 'supported', 'preferences.end': 'supported',
|
|
361
341
|
'preferences.clear': 'supported', 'preferences.remove': 'supported',
|
|
362
342
|
'preferences.put_int': 'supported', 'preferences.get_int': 'supported',
|
|
363
|
-
'preferences.put_uint': 'supported', 'preferences.get_uint': 'supported',
|
|
364
343
|
'preferences.put_bool': 'supported', 'preferences.get_bool': 'supported',
|
|
365
344
|
'preferences.put_float': 'supported', 'preferences.get_float': 'supported',
|
|
366
345
|
'preferences.put_string': 'supported', 'preferences.get_string': 'supported',
|
|
@@ -387,16 +366,10 @@ export default defineFrameworkManifest({
|
|
|
387
366
|
supported: true,
|
|
388
367
|
partialCoverage: false,
|
|
389
368
|
ops: {
|
|
390
|
-
'fs.
|
|
369
|
+
'fs.read_text': 'supported', 'fs.write_text': 'supported',
|
|
391
370
|
'fs.exists': 'supported', 'fs.remove': 'supported',
|
|
392
371
|
},
|
|
393
372
|
},
|
|
394
|
-
mdns: {
|
|
395
|
-
supported: false,
|
|
396
|
-
unsupportedReason: 'No mDNS lowering on Zephyr (requires networking stack).',
|
|
397
|
-
partialCoverage: false,
|
|
398
|
-
ops: unsupportedOps('mdns.'),
|
|
399
|
-
},
|
|
400
373
|
mqtt: {
|
|
401
374
|
supported: true,
|
|
402
375
|
partialCoverage: false,
|
|
@@ -413,43 +386,19 @@ export default defineFrameworkManifest({
|
|
|
413
386
|
'mqtt.connected': 'supported', 'mqtt.disconnect': 'supported',
|
|
414
387
|
},
|
|
415
388
|
},
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
temp: {
|
|
423
|
-
supported: false,
|
|
424
|
-
unsupportedReason: 'No on-chip temperature lowering on Zephyr (nRF52840 TEMP peripheral; not wired).',
|
|
425
|
-
partialCoverage: false,
|
|
426
|
-
ops: { 'temp.read': 'unsupported' },
|
|
427
|
-
},
|
|
428
|
-
hwtimer: {
|
|
429
|
-
// Hardware timers via the Zephyr counter driver (<zephyr/drivers/counter.h>).
|
|
430
|
-
// set_frequency → top value (counter_freq/hz) + on_overflow callback;
|
|
431
|
-
// start arms both; stop halts. A chip declares its free counters
|
|
432
|
-
// (e.g. nRF RTC1; RTC0 is kernel-owned). This is distinct from the JS
|
|
433
|
-
// setInterval/setTimeout k_timer polyfill, which is unaffected.
|
|
389
|
+
sensor: {
|
|
390
|
+
// DT-bound sensor parts — the generic catalog (hal/sensor.ts +
|
|
391
|
+
// sensor-catalog.generated.ts). fetch → sensor_sample_fetch,
|
|
392
|
+
// get → sensor_channel_get on a per-sensor device handle; the overlay
|
|
393
|
+
// generator emits the DT child node, and the driver's own Kconfig
|
|
394
|
+
// `default y` lights it up (only CONFIG_SENSOR is set, usage-gated).
|
|
434
395
|
supported: true,
|
|
435
|
-
partialCoverage:
|
|
396
|
+
partialCoverage: false,
|
|
436
397
|
ops: {
|
|
437
|
-
'
|
|
438
|
-
'
|
|
398
|
+
'sensor.fetch': 'supported',
|
|
399
|
+
'sensor.get': 'supported',
|
|
439
400
|
},
|
|
440
401
|
},
|
|
441
|
-
capacitive: {
|
|
442
|
-
// FT6336U capacitive touch is handled via the strategy-owned touch adapter
|
|
443
|
-
// (src/display/touch-adapter.ts → touch_init/touch_isTouched/touch_readRaw),
|
|
444
|
-
// NOT via a HAL op lowering. The manifest marks it unsupported here (no
|
|
445
|
-
// resolveHALOperation path for capacitive.read); the touch adapter provides
|
|
446
|
-
// the integration. partialCoverage reflects that it works on targets with
|
|
447
|
-
// the FT6336U DT node (ESP32), not on the bare nRF52840.
|
|
448
|
-
supported: false,
|
|
449
|
-
unsupportedReason: 'Capacitive touch is handled via the strategy touch adapter (FT6336U I2C), not a HAL op. Requires the ft6336u DT node.',
|
|
450
|
-
partialCoverage: true,
|
|
451
|
-
ops: { 'capacitive.read': 'unsupported' },
|
|
452
|
-
},
|
|
453
402
|
i2s: {
|
|
454
403
|
supported: false,
|
|
455
404
|
unsupportedReason: 'No I2S / digital audio lowering on Zephyr.',
|
|
@@ -463,8 +412,12 @@ export default defineFrameworkManifest({
|
|
|
463
412
|
ops: unsupportedOps('twai.'),
|
|
464
413
|
},
|
|
465
414
|
usb: {
|
|
415
|
+
// CDC-ACM serial over the board's USB connector. BOARD-GATED: the
|
|
416
|
+
// lowering only fires when the board's manifest carries zephyr.usb.*
|
|
417
|
+
// (boardgen emits it from the board's own DTS) — the manifest probe
|
|
418
|
+
// runs with no board, so the honest declaration is unsupported here.
|
|
466
419
|
supported: false,
|
|
467
|
-
unsupportedReason: '
|
|
420
|
+
unsupportedReason: 'Board-gated: USB lowers only on boards whose DTS enables the USB device controller (boardgen emits zephyr.usb.* from the catalog).',
|
|
468
421
|
partialCoverage: false,
|
|
469
422
|
ops: unsupportedOps('usb.'),
|
|
470
423
|
},
|
|
@@ -507,7 +460,6 @@ export default defineFrameworkManifest({
|
|
|
507
460
|
{ id: 'wiring_compat', domain: 'standard', notes: 'HIGH/LOW/digitalRead/etc. macros routing Wiring tokens (referenced unconditionally by the UI runtime header) to the __tc_gpio_* helpers' },
|
|
508
461
|
{ id: 'string_methods', domain: 'embedded', notes: 'STL-free __tc_* string helpers (const char*, inline ASCII case conv, <cstring> only)' },
|
|
509
462
|
{ id: 'static_array', domain: 'embedded', notes: 'STL-free __tc_StaticArray<T,N> wrapper for no-<vector> mutated/struct array literals' },
|
|
510
|
-
{ id: 'timer_methods', domain: 'embedded', notes: 'k_timer + k_work pool (system workqueue); callbacks run in thread context' },
|
|
511
463
|
{ id: 'async_runtime', domain: 'embedded', notes: 'Heap-free static Promise/microtask runtime (generateStaticAsyncRuntime), pumped in loop()' },
|
|
512
464
|
],
|
|
513
465
|
suppressed: [],
|
|
@@ -527,7 +479,7 @@ export default defineFrameworkManifest({
|
|
|
527
479
|
|
|
528
480
|
typeEmission: {
|
|
529
481
|
normalizeCppType: true,
|
|
530
|
-
mathHeader: '<
|
|
482
|
+
mathHeader: '<cmath>',
|
|
531
483
|
needsStdString: false,
|
|
532
484
|
needsStdVector: false,
|
|
533
485
|
needsIostream: false,
|
|
@@ -546,17 +498,11 @@ export default defineFrameworkManifest({
|
|
|
546
498
|
ambientTypes: ['Preferences'],
|
|
547
499
|
|
|
548
500
|
conformance: {
|
|
549
|
-
// Hardware-test groups
|
|
550
|
-
//
|
|
551
|
-
//
|
|
552
|
-
//
|
|
553
|
-
hardwareTestGroups: [
|
|
554
|
-
'01-basics',
|
|
555
|
-
'30-timing',
|
|
556
|
-
'40-gpio',
|
|
557
|
-
'41-analog',
|
|
558
|
-
'42-timers',
|
|
559
|
-
],
|
|
501
|
+
// Hardware-test groups moved to the shared HAL suite
|
|
502
|
+
// (packages/hal/tests — common/ + board/ via board test-pins.json), which
|
|
503
|
+
// runs on Zephyr targets through the hal board configs. The
|
|
504
|
+
// hal-resolution snapshots below stay.
|
|
505
|
+
hardwareTestGroups: [],
|
|
560
506
|
// Per-op HAL-resolution suite — one tests/packages/framework-zephyr/
|
|
561
507
|
// hal-resolution/<cat>.test.ts per category, snapshotting the exact C++
|
|
562
508
|
// each op lowers to. Mirrors the framework-esp32 convention. These are
|
|
@@ -564,8 +510,9 @@ export default defineFrameworkManifest({
|
|
|
564
510
|
// catches regressions like silent pull-resistor / interrupt no-ops.
|
|
565
511
|
halResolutionTests: [
|
|
566
512
|
'adc', 'ble', 'board', 'dac', 'fs', 'gpio', 'http', 'hwtimer', 'i2c',
|
|
567
|
-
'interrupts', 'mqtt', '
|
|
568
|
-
'spi', '
|
|
513
|
+
'interrupts', 'mqtt', 'preferences', 'pwm', 'random',
|
|
514
|
+
'spi', 'thin-buses', 'thin-classes', 'thread', 'timing',
|
|
515
|
+
'uart', 'usb', 'wdt', 'wifi',
|
|
569
516
|
],
|
|
570
517
|
},
|
|
571
518
|
|
package/src/index.ts
CHANGED
|
@@ -1,41 +1,57 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// @typecad/framework-zephyr — public exports
|
|
3
|
-
//
|
|
4
|
-
// The cuttlefish loader (framework-package.ts) requires a `FrameworkStrategy`
|
|
5
|
-
// export (the PlatformStrategy class it instantiates) and an optional
|
|
6
|
-
// `Toolchain`. This package aliases ZephyrStrategy → FrameworkStrategy.
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
|
|
9
|
-
export { ZephyrStrategy as FrameworkStrategy } from './strategy.js';
|
|
10
|
-
export { ZephyrStrategy } from './strategy.js';
|
|
11
|
-
export { Toolchain } from './toolchain/index.js';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// @typecad/framework-zephyr — public exports
|
|
3
|
+
//
|
|
4
|
+
// The cuttlefish loader (framework-package.ts) requires a `FrameworkStrategy`
|
|
5
|
+
// export (the PlatformStrategy class it instantiates) and an optional
|
|
6
|
+
// `Toolchain`. This package aliases ZephyrStrategy → FrameworkStrategy.
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
export { ZephyrStrategy as FrameworkStrategy } from './strategy.js';
|
|
10
|
+
export { ZephyrStrategy } from './strategy.js';
|
|
11
|
+
export { Toolchain } from './toolchain/index.js';
|
|
12
|
+
export { bossacTouchReset } from './toolchain/bossac-touch.js';
|
|
13
|
+
|
|
14
|
+
// Create-time starter debug artifacts. The `cuttlefish create` flow reads this
|
|
15
|
+
// optional named export off the loaded framework module (same loader pattern
|
|
16
|
+
// as doctor/licenses) and calls it for freshly scaffolded projects, so F5 in
|
|
17
|
+
// VS Code works before the first build. No-ops for non-GDB targets.
|
|
18
|
+
export { writeProjectDebugArtifacts } from './toolchain/debug-config.js';
|
|
19
|
+
|
|
20
|
+
// `cuttlefish doctor` — verify the installed Zephyr is reachable + inside the
|
|
21
|
+
// declared compat range, and preview board-target normalization. Re-exported
|
|
22
|
+
// under the dispatcher-facing alias `doctor` so the loader picks it up as
|
|
23
|
+
// mod.doctor (see framework-package.ts).
|
|
24
|
+
export { runDoctor as doctor } from './doctor.js';
|
|
25
|
+
|
|
26
|
+
// `cuttlefish licenses` — enumerate the Zephyr kernel + west manifest projects
|
|
27
|
+
// and resolve each one's SPDX license. Re-exported under the dispatcher-facing
|
|
28
|
+
// alias `licenses` so the loader picks it up as mod.licenses (see
|
|
29
|
+
// framework-package.ts). Mirrors framework-arduino's presenter.
|
|
30
|
+
export { runLicensesPresenter as licenses } from './licenses.js';
|
|
31
|
+
|
|
32
|
+
// Chip descriptor cache (the lowering's resolved-board view; no curated
|
|
33
|
+
// registry — every board reconstructs from its generated manifest).
|
|
34
|
+
export {
|
|
35
|
+
setActiveChip,
|
|
36
|
+
getActiveChip,
|
|
37
|
+
NO_BOARD_CHIP,
|
|
38
|
+
} from './chips/index.js';
|
|
39
|
+
export type {
|
|
40
|
+
ZephyrChipDescriptor,
|
|
41
|
+
ZephyrGpioDtSpec,
|
|
42
|
+
} from './chips/types.js';
|
|
43
|
+
|
|
44
|
+
// Board catalog sync — regenerate the local board overlay from the user's
|
|
45
|
+
// own Zephyr tree (`cuttlefish board sync`), so board add/change/remove
|
|
46
|
+
// tracks `west update` instead of cuttlefish releases.
|
|
47
|
+
export {
|
|
48
|
+
syncBoardCatalog,
|
|
49
|
+
ensureFreshBoardCatalog,
|
|
50
|
+
loadBoardCatalogOverlay,
|
|
51
|
+
resetBoardCatalogOverlayCache,
|
|
52
|
+
} from './sdk/board-catalog-sync.js';
|
|
53
|
+
export type {
|
|
54
|
+
BoardCatalogSyncReport,
|
|
55
|
+
BoardCatalogEnsureResult,
|
|
56
|
+
BoardCatalogOverlay,
|
|
57
|
+
} from './sdk/board-catalog-sync.js';
|