@typecad/framework-zephyr 1.0.0-alpha.15 → 1.0.0-alpha.18

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.
Files changed (132) hide show
  1. package/LICENSE +202 -21
  2. package/README.md +49 -87
  3. package/dist/as-built.d.ts +2 -2
  4. package/dist/as-built.js +2 -2
  5. package/dist/boardgen.d.ts +1 -9
  6. package/dist/boardgen.js +228 -45
  7. package/dist/chips/types.d.ts +1 -1
  8. package/dist/debug-codegen.js +1 -1
  9. package/dist/display/touch-adapter.js +1 -1
  10. package/dist/display/ui-adapter.js +549 -549
  11. package/dist/doctor.js +4 -4
  12. package/dist/dt-config/custom-board.js +2 -2
  13. package/dist/dt-config/kconfig.js +18 -12
  14. package/dist/dt-config/overlay.d.ts +2 -2
  15. package/dist/dt-config/overlay.js +2 -2
  16. package/dist/framework.manifest.d.ts +3 -3
  17. package/dist/framework.manifest.js +10 -7
  18. package/dist/index.js +5 -5
  19. package/dist/licenses.d.ts +2 -2
  20. package/dist/licenses.js +8 -8
  21. package/dist/lowering/fs.js +1 -1
  22. package/dist/lowering/gpio.js +0 -32
  23. package/dist/lowering/http.js +264 -32
  24. package/dist/lowering/i2c.js +0 -8
  25. package/dist/lowering/interrupts.js +6 -0
  26. package/dist/lowering/mqtt.js +110 -8
  27. package/dist/lowering/usb.js +11 -11
  28. package/dist/lowering/wdt.js +2 -29
  29. package/dist/sdk/board-catalog-sync.d.ts +1 -3
  30. package/dist/sdk/board-catalog-sync.js +4 -10
  31. package/dist/strategy.d.ts +22 -44
  32. package/dist/strategy.js +152 -155
  33. package/dist/tmp-probe.d.ts +2 -0
  34. package/dist/tmp-probe.js +9 -0
  35. package/dist/toolchain/debug-config.d.ts +50 -90
  36. package/dist/toolchain/debug-config.js +241 -502
  37. package/dist/toolchain/env-check.d.ts +1 -3
  38. package/dist/toolchain/env-check.js +2 -7
  39. package/dist/toolchain/index.d.ts +65 -2
  40. package/dist/toolchain/index.js +432 -55
  41. package/dist/toolchain/runners.d.ts +16 -0
  42. package/dist/toolchain/runners.js +75 -0
  43. package/dist/toolchain/scaffold.d.ts +1 -1
  44. package/dist/toolchain/scaffold.js +12 -12
  45. package/dist/toolchain/west-discover.d.ts +6 -0
  46. package/dist/toolchain/west-discover.js +36 -13
  47. package/dist/toolchain/west-spawn.js +8 -2
  48. package/installer/README.md +328 -328
  49. package/installer/install.sh +2 -2
  50. package/installer/templates/project/.typecad/activate-zephyr.ps1 +1 -1
  51. package/installer/templates/project/.typecad/activate-zephyr.sh +1 -1
  52. package/installer/templates/project/.vscode/settings.json +1 -1
  53. package/installer/templates/project/README.md +2 -2
  54. package/package.json +5 -5
  55. package/src/as-built.ts +206 -206
  56. package/src/boardgen.ts +214 -48
  57. package/src/chips/types.ts +567 -567
  58. package/src/display/touch-adapter.ts +204 -204
  59. package/src/display/ui-adapter.ts +781 -781
  60. package/src/doctor.ts +4 -4
  61. package/src/dt-config/custom-board.ts +2 -2
  62. package/src/dt-config/kconfig.ts +18 -12
  63. package/src/dt-config/overlay.ts +1058 -1058
  64. package/src/framework.manifest.ts +538 -535
  65. package/src/index.ts +5 -5
  66. package/src/licenses.ts +425 -425
  67. package/src/lowering/fs.ts +135 -135
  68. package/src/lowering/gpio.ts +0 -33
  69. package/src/lowering/http.ts +264 -32
  70. package/src/lowering/i2c.ts +0 -9
  71. package/src/lowering/interrupts.ts +6 -0
  72. package/src/lowering/mqtt.ts +109 -8
  73. package/src/lowering/usb.ts +221 -221
  74. package/src/lowering/wdt.ts +2 -25
  75. package/src/sdk/board-catalog-sync.ts +4 -25
  76. package/src/strategy.ts +2265 -2309
  77. package/src/toolchain/debug-config.ts +264 -514
  78. package/src/toolchain/env-check.ts +279 -285
  79. package/src/toolchain/index.ts +1703 -1286
  80. package/src/toolchain/runners.ts +80 -0
  81. package/src/toolchain/scaffold.ts +296 -296
  82. package/src/toolchain/west-discover.ts +35 -13
  83. package/src/toolchain/west-spawn.ts +174 -168
  84. package/dist/async/timer-polyfill.d.ts +0 -10
  85. package/dist/async/timer-polyfill.js +0 -95
  86. package/dist/chips/board-overrides.d.ts +0 -7
  87. package/dist/chips/board-overrides.js +0 -11
  88. package/dist/chips/esp32.d.ts +0 -2
  89. package/dist/chips/esp32.js +0 -71
  90. package/dist/chips/esp32s3.d.ts +0 -2
  91. package/dist/chips/esp32s3.js +0 -103
  92. package/dist/chips/soc/.d.ts +0 -2
  93. package/dist/chips/soc/.js +0 -129
  94. package/dist/chips/soc/esp32.d.ts +0 -2
  95. package/dist/chips/soc/esp32.js +0 -120
  96. package/dist/chips/soc/esp32c3.d.ts +0 -2
  97. package/dist/chips/soc/esp32c3.js +0 -90
  98. package/dist/chips/soc/esp32c6.d.ts +0 -2
  99. package/dist/chips/soc/esp32c6.js +0 -109
  100. package/dist/chips/soc/esp32s3.d.ts +0 -2
  101. package/dist/chips/soc/esp32s3.js +0 -189
  102. package/dist/chips/soc/index.d.ts +0 -2
  103. package/dist/chips/soc/index.js +0 -23
  104. package/dist/chips/soc/nrf52840.d.ts +0 -2
  105. package/dist/chips/soc/nrf52840.js +0 -130
  106. package/dist/chips/soc/rp2040.d.ts +0 -2
  107. package/dist/chips/soc/rp2040.js +0 -141
  108. package/dist/chips/soc/rp2350a.d.ts +0 -2
  109. package/dist/chips/soc/rp2350a.js +0 -145
  110. package/dist/chips/soc/samd21g18a.d.ts +0 -2
  111. package/dist/chips/soc/samd21g18a.js +0 -143
  112. package/dist/chips/soc/stm32f411xe.d.ts +0 -2
  113. package/dist/chips/soc/stm32f411xe.js +0 -251
  114. package/dist/chips/xiao-ble.d.ts +0 -2
  115. package/dist/chips/xiao-ble.js +0 -100
  116. package/dist/lowering/power.d.ts +0 -9
  117. package/dist/lowering/power.js +0 -60
  118. package/dist/lowering/pulse.d.ts +0 -7
  119. package/dist/lowering/pulse.js +0 -51
  120. package/dist/lowering/tone.d.ts +0 -10
  121. package/dist/lowering/tone.js +0 -63
  122. package/dist/lowering/worker-backing.d.ts +0 -14
  123. package/dist/lowering/worker-backing.js +0 -79
  124. package/dist/lowering/worker.d.ts +0 -6
  125. package/dist/lowering/worker.js +0 -14
  126. package/dist/sdk/board-data.generated.d.ts +0 -2
  127. package/dist/sdk/board-data.generated.js +0 -4
  128. package/dist/sdk/catalog-walker.d.ts +0 -90
  129. package/dist/sdk/catalog-walker.js +0 -682
  130. package/dist/sdk/dts-reader.d.ts +0 -83
  131. package/dist/sdk/dts-reader.js +0 -596
  132. package/src/debug-codegen.ts +0 -207
package/LICENSE CHANGED
@@ -1,21 +1,202 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 typecad0
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,87 +1,49 @@
1
- # @typecad/framework-zephyr
2
-
3
- TypeCAD framework package that lowers HAL operation IR to **native Zephyr RTOS
4
- driver API calls**. Generates a real Zephyr application (`main` + `src/main.cpp`
5
- + `CMakeLists.txt` + `prj.conf`), compiled through Zephyr's `west` / CMake /
6
- Ninja build system.
7
-
8
- GPIO is lowered through devicetree specs (`gpio_pin_*_dt`) so an active-low
9
- LED's polarity is honored by the DT flags, not by the generated code.
10
-
11
- ## Requirements
12
-
13
- - Zephyr RTOS ≥ 3.x installed (the SDK + a west-enabled Python environment).
14
- - The framework auto-discovers `west` without requiring you to activate the
15
- venv first. Discovery cascade (first usable wins):
16
- 1. `west` already on `PATH` (env already activated / global install).
17
- 2. `$ZEPHYR_BASE` sibling venv: `${ZEPHYR_BASE}/../.venv/<python> -m west`.
18
- 3. Well-known workspace layouts (`~/zephyrproject/.venv`,
19
- `/opt/zephyrproject/.venv`, etc.).
20
- 4. System pythons (`python`, `python3`, `py`) via `-m west`.
21
-
22
- If none is found, the build errors with an actionable message pointing at the
23
- fix (`pip install west`, set `ZEPHYR_BASE`, or activate the venv).
24
-
25
- ## How it works
26
-
27
- - HAL ops (`gpio.write`, `i2c.reg_read`, etc.) lower to native Zephyr driver
28
- calls (`gpio_pin_set_dt`, `i2c_reg_read_byte`, etc.) — no Arduino API.
29
- - The generated `src/main.cpp` defines `int main(void)` — the standard Zephyr
30
- C entry point. Top-level statements lower straight into `main()` (no
31
- `setup()`/`loop()` pair); event-driven programs get their scheduler loop
32
- appended inside `main()` by the driver machinery.
33
- - The framework emits a complete Zephyr application: root `CMakeLists.txt`
34
- (`find_package(Zephyr)` + `file(GLOB src/*.cpp)`) and `prj.conf` (the Kconfig
35
- symbols for the lowered peripherals). Both are regenerated idempotently —
36
- only rewritten when their content changes, so Ninja's incremental build is
37
- preserved.
38
- - Board targets are not curated: **every board variant in the generated board
39
- catalog** resolves the same way (`resolveChipFromBoard` over the catalog's
40
- board data — there is no hardcoded chip registry or target list). The
41
- catalog is machine-local, generated from your Zephyr tree by
42
- `cuttlefish board sync` (and refreshed automatically by builds).
43
-
44
- ## Installation
45
-
46
- ```sh
47
- cuttlefish create # pick a board from the catalog; the Zephyr framework is the default
48
- ```
49
-
50
- Or in `cuttlefish.config.ts`:
51
-
52
- ```ts
53
- export default {
54
- entry: './src/main.ts',
55
- board: 'xiao_ble/nrf52840',
56
- framework: '@typecad/framework-zephyr',
57
- };
58
- ```
59
-
60
- ## HAL coverage
61
-
62
- The manifest (`src/framework.manifest.ts`) is the honest, complete record of
63
- what lowers. Fully lowered: **gpio, pwm, adc, dac** (pin-fact-gated),
64
- **i2c, spi, uart, interrupts, timing, wdt, counter, thread, shift, board
65
- constants**, **random** (xorshift32 PRNG seeded from the Zephyr entropy tap),
66
- **preferences (Store)**, **fs (File)**, **sensor**, **ble**, **snprintf**, and
67
- **wifi/http/mqtt** (ESP32-class radio targets only — nRF52840 has no WiFi).
68
- **Display** lowers via the generic `<zephyr/drivers/display.h>` GFX runtime.
69
- Declared unsupported on this target: **i2s, twai/CAN, ethernet, espnow,
70
- hardware crypto, pcnt, mcpwm**. USB CDC is board-gated: it lowers only on
71
- boards whose DTS enables the USB device controller.
72
-
73
- Run `npm test` (the manifest validator) to confirm the declared coverage matches
74
- the actual lowering behavior.
75
-
76
- ## Notes / limitations
77
-
78
- - **Minimal C++ libc.** Zephyr's default C++ support (`lib/cpp/minimal`) has no
79
- `<vector>`, `<string>`, `<iostream>`, `<functional>`, exceptions, or RTTI.
80
- `prj.conf` enables `CONFIG_NEWLIB_LIBC` for `std::string`/`std::vector`; array
81
- literals still promote to the StaticArray wrapper, not `std::vector`.
82
- - **Debug mode.** `cuttlefish build --debug` routes through `printk` (always
83
- available, no `CONFIG_CONSOLE` dependency) rather than `std::cout`, since the
84
- minimal libc has no iostream. Breakpoints halt on console input (`ENTER`
85
- continues, `s` skips).
86
- - **AUTOSAR compliance.** All emitted C++ uses `static_cast`/`reinterpret_cast`
87
- (no C-style casts) so the shim bytes pass `--autosar=strict`.
1
+ # `@typecad/framework-zephyr`
2
+
3
+ The Zephyr engine behind your [typeCAD/hal](https://typecad.dev) builds.
4
+
5
+ When you scaffold a firmware project with `npx @typecad/hal create` and pick
6
+ a board, this is the package that lands in your dependencies and does the
7
+ heavy lifting: your TypeScript compiles to **real Zephyr RTOS applications**,
8
+ built and flashed with Zephyr's own toolchain.
9
+
10
+ ## Why
11
+
12
+ Zephyr is a production-grade RTOS — but its devicetree, Kconfig, and CMake
13
+ layers demand real effort before your first blink. This package moves that
14
+ effort into the toolchain: you write TypeScript against `@typecad/hal`, and
15
+ the generated firmware calls the native Zephyr driver APIs directly. No
16
+ boilerplate project, no devicetree hand-editing, no Arduino compatibility
17
+ shims — just the RTOS, driven by code you can read.
18
+
19
+ ## What it does for you
20
+
21
+ - **Generates a complete Zephyr application** from your firmware — entry
22
+ point, devicetree overlays, and Kconfig — regenerated automatically
23
+ whenever your code changes.
24
+ - **Builds and flashes through Zephyr's `west` toolchain**, discovering
25
+ your environment without activation scripts (works from any terminal).
26
+ - **Knows your board.** Board definitions come from your Zephyr tree's
27
+ catalog — 1,300+ board variants, same workflow for every one.
28
+ - **Debugs on hardware.** Set breakpoints in your TypeScript in VS Code and
29
+ debug the running board (the TypeCAD Debug extension ships into every
30
+ project).
31
+ - **Installs the toolchain for you.** No Zephyr SDK yet? One command:
32
+
33
+ ```sh
34
+ npx --package @typecad/framework-zephyr zephyr-installer
35
+ ```
36
+
37
+ ## Start here
38
+
39
+ ```bash
40
+ npx @typecad/hal create my-firmware # pick a board — this framework is the default
41
+ cd my-firmware && npm run upload
42
+ ```
43
+
44
+ - [typeCAD](https://typecad.dev) — documentation and guides
45
+ - [`@typecad/hal`](https://www.npmjs.com/package/@typecad/hal) — the product
46
+
47
+ ## License
48
+
49
+ Apache-2.0
@@ -10,7 +10,7 @@ export interface AsBuiltFacts {
10
10
  pwm: AsBuiltRoute[];
11
11
  dac: AsBuiltRoute[];
12
12
  }
13
- /** The .cuttlefish/as-built.json shape (machine-authored facts file). */
13
+ /** The .typecad-hal/as-built.json shape (machine-authored facts file). */
14
14
  export interface AsBuiltFile {
15
15
  version: 1;
16
16
  board: string;
@@ -27,7 +27,7 @@ export interface AsBuiltFile {
27
27
  * its labels inline before the node name.
28
28
  */
29
29
  export declare function parseZephyrDts(text: string): AsBuiltFacts;
30
- /** Parse + shape-validate .cuttlefish/as-built.json; errors name the file. */
30
+ /** Parse + shape-validate .typecad-hal/as-built.json; errors name the file. */
31
31
  export declare function parseAsBuiltJson(text: string, source?: string): AsBuiltFile;
32
32
  /** Serialize the as-built snapshot (deterministic field order). */
33
33
  export declare function asBuiltJson(board: string, facts: AsBuiltFacts): string;
package/dist/as-built.js CHANGED
@@ -156,8 +156,8 @@ export function parseZephyrDts(text) {
156
156
  }
157
157
  return facts;
158
158
  }
159
- /** Parse + shape-validate .cuttlefish/as-built.json; errors name the file. */
160
- export function parseAsBuiltJson(text, source = '.cuttlefish/as-built.json') {
159
+ /** Parse + shape-validate .typecad-hal/as-built.json; errors name the file. */
160
+ export function parseAsBuiltJson(text, source = '.typecad-hal/as-built.json') {
161
161
  let parsed;
162
162
  try {
163
163
  parsed = JSON.parse(text);
@@ -19,14 +19,6 @@ export declare function socOfTarget(target: string): string;
19
19
  * network core declares no SAADC).
20
20
  */
21
21
  export declare function nrfSaadcAinPads(soc: string, identifier: string): readonly [number, number][] | undefined;
22
- /**
23
- * ESP32 DAC channel→GPIO pad map per SoC — [channel, pad] pairs, silicon-
24
- * fixed (no pinctrl group; the DAC outputs through the RTC IO mux on a fixed
25
- * pad). Only the original ESP32 and the ESP32-S2 carry the 8-bit DAC; the
26
- * S3/C3/C6/H2 dropped it. Sourced from the HAL's dac_periph.c
27
- * (`dac_channel_io_num[]`), like the nRF SAADC table is from the PS.
28
- */
29
- export declare function esp32DacPins(soc: string): readonly [number, number][] | undefined;
30
22
  /**
31
23
  * Parse a datasheet pin name into (controller nodelabel, controller-relative
32
24
  * bit) per the soc's naming family — the inverse of the sweep naming:
@@ -75,7 +67,7 @@ export interface UserBoardFacts {
75
67
  }[];
76
68
  };
77
69
  }
78
- /** The whole cuttlefish.facts.json shape. */
70
+ /** The whole typecad-hal.facts.json shape. */
79
71
  export interface UserFactsFile {
80
72
  boards: Record<string, UserBoardFacts>;
81
73
  }