rp2350

#zig#raspberry-pi

git clone https://git.pyrossh.dev/rp2350

code to drive rp2350


6a7717epyrossh 2025-04-18T21:06:22+05:30
initial commit
.gitignore ADDED
@@ -0,0 +1 @@
1
+ .zig-cache
aa.zig ADDED
@@ -0,0 +1,17 @@
1
+ const std = @import("std");
2
+ const stdout = std.io.getStdOut().writer();
3
+
4
+ pub fn main() !void {
5
+ var i: usize = 1;
6
+ while (i <= 16) : (i += 1) {
7
+ if (i % 15 == 0) {
8
+ try stdout.writeAll("ZiggZagg\n");
9
+ } else if (i % 3 == 0) {
10
+ try stdout.writeAll("Zigg\n");
11
+ } else if (i % 5 == 0) {
12
+ try stdout.writeAll("Zagg\n");
13
+ } else {
14
+ try stdout.print("{d}\n", .{i});
15
+ }
16
+ }
17
+ }
blinky.zig ADDED
@@ -0,0 +1,22 @@
1
+ const std = @import("std");
2
+ const microzig = @import("microzig");
3
+ const rp2xxx = microzig.hal;
4
+ const time = rp2xxx.time;
5
+
6
+ const pin_config = rp2xxx.pins.GlobalConfiguration{
7
+ .GPIO25 = .{
8
+ .name = "led",
9
+ .direction = .out,
10
+ },
11
+ };
12
+
13
+ const pins = pin_config.pins();
14
+
15
+ pub fn main() !void {
16
+ pin_config.apply();
17
+
18
+ while (true) {
19
+ pins.led.toggle();
20
+ time.sleep_ms(250);
21
+ }
22
+ }
build.zig ADDED
@@ -0,0 +1,143 @@
1
+ const std = @import("std");
2
+ const microzig = @import("microzig");
3
+
4
+ const MicroBuild = microzig.MicroBuild(.{
5
+ .rp2xxx = true,
6
+ });
7
+
8
+ pub fn build(b: *std.Build) void {
9
+ const mz_dep = b.dependency("microzig", .{});
10
+ const mb = MicroBuild.init(b, mz_dep) orelse return;
11
+
12
+ const firmware = mb.add_firmware(.{
13
+ .name = "blinky",
14
+ .target = mb.ports.rp2xxx.boards.raspberrypi.pico,
15
+ .optimize = .ReleaseSmall,
16
+ .root_source_file = b.path("src/main.zig"),
17
+ });
18
+
19
+ // We call this twice to demonstrate that the default binary output for
20
+ // RP2040 is UF2, but we can also output other formats easily
21
+ mb.install_firmware(firmware, .{});
22
+ mb.install_firmware(firmware, .{ .format = .elf });
23
+ }
24
+
25
+ // const std = @import("std");
26
+ // const microzig = @import("microzig");
27
+
28
+ // const MicroBuild = microzig.MicroBuild(.{
29
+ // .rp2xxx = true,
30
+ // });
31
+
32
+ // pub fn build(b: *std.Build) void {
33
+ // const optimize = b.standardOptimizeOption(.{});
34
+ // const maybe_example = b.option([]const u8, "example", "only build matching examples");
35
+
36
+ // const mz_dep = b.dependency("microzig", .{});
37
+ // const mb = MicroBuild.init(b, mz_dep) orelse return;
38
+
39
+ // const rp2040_only_examples: []const Example = &.{
40
+ // // RaspberryPi Boards:
41
+ // .{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "pico_flash-program", .file = "src/rp2040_only/flash_program.zig" },
42
+ // .{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "pico_flash-id", .file = "src/rp2040_only/flash_id.zig" },
43
+ // .{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "pico_random", .file = "src/rp2040_only/random.zig" },
44
+ // .{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "pico_rtc", .file = "src/rp2040_only/rtc.zig" },
45
+ // .{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "pico_usb-hid", .file = "src/rp2040_only/usb_hid.zig" },
46
+ // .{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "pico_multicore", .file = "src/rp2040_only/blinky_core1.zig" },
47
+ // .{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "pico_hd44780", .file = "src/rp2040_only/hd44780.zig" },
48
+ // .{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "pico_pcf8574", .file = "src/rp2040_only/pcf8574.zig" },
49
+ // .{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "pico_i2c_slave", .file = "src/rp2040_only/i2c_slave.zig" },
50
+
51
+ // // WaveShare Boards:
52
+ // .{ .target = mb.ports.rp2xxx.boards.waveshare.rp2040_matrix, .name = "rp2040-matrix_tiles", .file = "src/rp2040_only/tiles.zig" },
53
+ // // .{ .target = "board:waveshare/rp2040_eth", .name = "rp2040-eth" },
54
+ // // .{ .target = "board:waveshare/rp2040_plus_4m", .name = "rp2040-plus-4m" },
55
+ // // .{ .target = "board:waveshare/rp2040_plus_16m", .name = "rp2040-plus-16m" },
56
+ // };
57
+
58
+ // const rp2350_only_examples: []const Example = &.{
59
+ // // TODO: No RP2350 feature specific examples to show off yet
60
+ // };
61
+
62
+ // const chip_agnostic_examples: []const ChipAgnosticExample = &.{
63
+ // .{ .name = "adc", .file = "src/adc.zig" },
64
+ // .{ .name = "i2c-bus-scan", .file = "src/i2c_bus_scan.zig" },
65
+ // .{ .name = "pwm", .file = "src/pwm.zig" },
66
+ // .{ .name = "uart-echo", .file = "src/uart_echo.zig" },
67
+ // .{ .name = "uart-log", .file = "src/uart_log.zig" },
68
+ // .{ .name = "spi-master", .file = "src/spi_master.zig" },
69
+ // .{ .name = "spi-slave", .file = "src/spi_slave.zig" },
70
+ // .{ .name = "squarewave", .file = "src/squarewave.zig" },
71
+ // .{ .name = "ws2812", .file = "src/ws2812.zig" },
72
+ // .{ .name = "blinky", .file = "src/blinky.zig" },
73
+ // .{ .name = "gpio-clock-output", .file = "src/gpio_clock_output.zig" },
74
+ // .{ .name = "changing-system-clocks", .file = "src/changing_system_clocks.zig" },
75
+ // .{ .name = "custom-clock-config", .file = "src/custom_clock_config.zig" },
76
+ // .{ .name = "watchdog-timer", .file = "src/watchdog_timer.zig" },
77
+ // .{ .name = "interrupts", .file = "src/interrupts.zig" },
78
+ // .{ .name = "stepper", .file = "src/stepper.zig" },
79
+ // .{ .name = "usb-cdc", .file = "src/usb_cdc.zig" },
80
+ // };
81
+
82
+ // var available_examples = std.ArrayList(Example).init(b.allocator);
83
+ // available_examples.appendSlice(rp2040_only_examples) catch @panic("out of memory");
84
+ // available_examples.appendSlice(rp2350_only_examples) catch @panic("out of memory");
85
+ // for (chip_agnostic_examples) |example| {
86
+ // available_examples.append(.{
87
+ // .target = mb.ports.rp2xxx.boards.raspberrypi.pico,
88
+ // .name = b.fmt("pico_{s}", .{example.name}),
89
+ // .file = example.file,
90
+ // }) catch @panic("out of memory");
91
+
92
+ // available_examples.append(.{
93
+ // .target = mb.ports.rp2xxx.boards.raspberrypi.pico2_arm,
94
+ // .name = b.fmt("pico2_arm_{s}", .{example.name}),
95
+ // .file = example.file,
96
+ // }) catch @panic("out of memory");
97
+
98
+ // available_examples.append(.{
99
+ // .target = mb.ports.rp2xxx.boards.raspberrypi.pico2_riscv,
100
+ // .name = b.fmt("pico2_riscv_{s}", .{example.name}),
101
+ // .file = example.file,
102
+ // }) catch @panic("out of memory");
103
+ // }
104
+
105
+ // for (available_examples.items) |example| {
106
+ // // If we specify example, only select the ones that match
107
+ // if (maybe_example) |selected_example|
108
+ // if (!std.mem.containsAtLeast(u8, example.name, 1, selected_example))
109
+ // continue;
110
+
111
+ // // `add_firmware` basically works like addExecutable, but takes a
112
+ // // `microzig.Target` for target instead of a `std.zig.CrossTarget`.
113
+ // //
114
+ // // The target will convey all necessary information on the chip,
115
+ // // cpu and potentially the board as well.
116
+ // const firmware = mb.add_firmware(.{
117
+ // .name = example.name,
118
+ // .target = example.target,
119
+ // .optimize = optimize,
120
+ // .root_source_file = b.path(example.file),
121
+ // });
122
+
123
+ // // `install_firmware()` is the MicroZig pendant to `Build.installArtifact()`
124
+ // // and allows installing the firmware as a typical firmware file.
125
+ // //
126
+ // // This will also install into `$prefix/firmware` instead of `$prefix/bin`.
127
+ // mb.install_firmware(firmware, .{});
128
+
129
+ // // For debugging, we also always install the firmware as an ELF file
130
+ // mb.install_firmware(firmware, .{ .format = .elf });
131
+ // }
132
+ // }
133
+
134
+ // const Example = struct {
135
+ // target: *const microzig.Target,
136
+ // name: []const u8,
137
+ // file: []const u8,
138
+ // };
139
+
140
+ // const ChipAgnosticExample = struct {
141
+ // name: []const u8,
142
+ // file: []const u8,
143
+ // };
build.zig.zon ADDED
@@ -0,0 +1,69 @@
1
+ .{
2
+ // This is the default name used by packages depending on this one. For
3
+ // example, when a user runs `zig fetch --save <url>`, this field is used
4
+ // as the key in the `dependencies` table. Although the user can choose a
5
+ // different name, most users will stick with this provided value.
6
+ //
7
+ // It is redundant to include "zig" in this name because it is already
8
+ // within the Zig package namespace.
9
+ .name = .rp2040,
10
+
11
+ // This is a [Semantic Version](https://semver.org/).
12
+ // In a future version of Zig it will be used for package deduplication.
13
+ .version = "0.0.0",
14
+
15
+ // Together with name, this represents a globally unique package
16
+ // identifier. This field is generated by the Zig toolchain when the
17
+ // package is first created, and then *never changes*. This allows
18
+ // unambiguous detection of one package being an updated version of
19
+ // another.
20
+ //
21
+ // When forking a Zig project, this id should be regenerated (delete the
22
+ // field and run `zig build`) if the upstream project is still maintained.
23
+ // Otherwise, the fork is *hostile*, attempting to take control over the
24
+ // original project's identity. Thus it is recommended to leave the comment
25
+ // on the following line intact, so that it shows up in code reviews that
26
+ // modify the field.
27
+ .fingerprint = 0xed40fb47bc802c59, // Changing this has security and trust implications.
28
+
29
+ // Tracks the earliest Zig version that the package considers to be a
30
+ // supported use case.
31
+ .minimum_zig_version = "0.14.0",
32
+
33
+ // This field is optional.
34
+ // Each dependency must either provide a `url` and `hash`, or a `path`.
35
+ // `zig build --fetch` can be used to fetch all dependencies of a package, recursively.
36
+ // Once all dependencies are fetched, `zig build` no longer requires
37
+ // internet connectivity.
38
+ .dependencies = .{
39
+ .microzig = .{
40
+ .url = "https://microzig.tech/downloads/microzig/0.13.2/microzig.tar.gz",
41
+ .hash = "microzig-0.13.2-AAAAAEAoCACJtVQID09BdlBX63hCLqdwobnQC5A_1QfO",
42
+ },
43
+ },
44
+ .paths = .{
45
+ "build.zig",
46
+ "build.zig.zon",
47
+ "src",
48
+ // For example...
49
+ //"LICENSE",
50
+ //"README.md",
51
+ },
52
+ }
53
+
54
+ // .{
55
+ // .name = .examples_raspberrypi_rp2xxx,
56
+ // .fingerprint = 0xffa4bfa151162a57,
57
+ // .version = "0.0.0",
58
+ // .dependencies = .{
59
+ // .microzig = .{ .path = "../../.." },
60
+ // },
61
+ // .paths = .{
62
+ // "LICENSE",
63
+ // "README.md",
64
+ // "build.zig",
65
+ // "build.zig.zon",
66
+ // "src",
67
+ // "scripts",
68
+ // },
69
+ // }
eda/.gitignore ADDED
@@ -0,0 +1,26 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Build output
5
+ dist/
6
+ build/
7
+
8
+ # Environment variables
9
+ .env
10
+ .env.local
11
+ .env.*.local
12
+
13
+ # IDE files
14
+ .vscode/
15
+ .idea/
16
+ *.swp
17
+ *.swo
18
+
19
+ # OS files
20
+ .DS_Store
21
+ Thumbs.db
22
+
23
+ # Debug logs
24
+ npm-debug.log*
25
+ yarn-debug.log*
26
+ yarn-error.log*
eda/.npmrc ADDED
@@ -0,0 +1 @@
1
+ @tsci:registry=https://npm.tscircuit.com
eda/index.tsx ADDED
@@ -0,0 +1,10 @@
1
+ export default () => (
2
+ <board width="20mm" height="20mm" schTraceAutoLabelEnabled schAutoLayoutEnabled>
3
+ <resistor name="R1" resistance="1k" footprint="0402" />
4
+ <capacitor name="C1" capacitance="1000pF" footprint="0402" />
5
+ <resistor name="R2" resistance="2k" footprint="0402" />
6
+ <capacitor name="C2" capacitance="1000pF" footprint="0402" />
7
+ <trace from=".R1 > .pin1" to=".C1 > .pin1" />
8
+ <trace from=".R2 > .pin1" to=".C2 > .pin2" />
9
+ </board>
10
+ );
eda/manual-edits.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "schematic_placements": [],
3
+ "pcb_placements": [
4
+ {
5
+ "selector": "C2",
6
+ "center": {
7
+ "x": -8.023810013025601,
8
+ "y": 6.234023579882503
9
+ },
10
+ "relative_to": "group_center"
11
+ }
12
+ ]
13
+ }
eda/package-lock.json ADDED
@@ -0,0 +1,468 @@
1
+ {
2
+ "name": "tss",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "tss",
9
+ "version": "1.0.0",
10
+ "devDependencies": {
11
+ "@tscircuit/core": "^0.0.359",
12
+ "@types/react": "^19.0.12"
13
+ }
14
+ },
15
+ "node_modules/@lume/kiwi": {
16
+ "version": "0.4.4",
17
+ "resolved": "https://registry.npmjs.org/@lume/kiwi/-/kiwi-0.4.4.tgz",
18
+ "integrity": "sha512-ie0YTKgiZqD4TXlJ4eUbfi4UEoKs6YlLRYNTfPm5eUXwfudTBmPRs7Qcxz2SWKDpVTwThv3sWG6zwtyAA0nPpw==",
19
+ "dev": true,
20
+ "license": "BSD-3-Clause"
21
+ },
22
+ "node_modules/@tscircuit/capacity-autorouter": {
23
+ "version": "0.0.44",
24
+ "resolved": "https://registry.npmjs.org/@tscircuit/capacity-autorouter/-/capacity-autorouter-0.0.44.tgz",
25
+ "integrity": "sha512-goSarNo4khFeworI0rLGYKBGMnXF6UDSeO53DjbNvoo9Fxbt8827+a1iET17d1LiTXAltXdJrA9g6Zb0X4VQTA==",
26
+ "dev": true,
27
+ "peerDependencies": {
28
+ "typescript": "^5.7.3"
29
+ }
30
+ },
31
+ "node_modules/@tscircuit/checks": {
32
+ "version": "0.0.30",
33
+ "resolved": "https://registry.npmjs.org/@tscircuit/checks/-/checks-0.0.30.tgz",
34
+ "integrity": "sha512-2kB/XDSIWlJCfQqqHzGgStLWsaBEqPIyP5PyLHh79OUNswQPFglHHoYtNsOmcuGR/JpQni6TXg9Ngp/BBdNGIA==",
35
+ "dev": true,
36
+ "dependencies": {
37
+ "@tscircuit/math-utils": "^0.0.12",
38
+ "circuit-json-to-connectivity-map": "^0.0.19"
39
+ },
40
+ "peerDependencies": {
41
+ "circuit-json": "*",
42
+ "typescript": "^5.5.3"
43
+ }
44
+ },
45
+ "node_modules/@tscircuit/checks/node_modules/circuit-json-to-connectivity-map": {
46
+ "version": "0.0.19",
47
+ "resolved": "https://registry.npmjs.org/circuit-json-to-connectivity-map/-/circuit-json-to-connectivity-map-0.0.19.tgz",
48
+ "integrity": "sha512-EJgeuBjCCvlKC+CjnR+yKppSi+/027x3uvXr0PR77iofR629BnVDgWv/0wKLJU7YlklcbpyUvOPyPCE1k2+WQQ==",
49
+ "dev": true,
50
+ "dependencies": {
51
+ "@tscircuit/math-utils": "^0.0.9"
52
+ },
53
+ "peerDependencies": {
54
+ "typescript": "^5.0.0"
55
+ }
56
+ },
57
+ "node_modules/@tscircuit/checks/node_modules/circuit-json-to-connectivity-map/node_modules/@tscircuit/math-utils": {
58
+ "version": "0.0.9",
59
+ "resolved": "https://registry.npmjs.org/@tscircuit/math-utils/-/math-utils-0.0.9.tgz",
60
+ "integrity": "sha512-sPzfXndijet8z29X6f5vnSZddiso2tRg7m6rB+268bVj60mxnxUMD14rKuMlLn6n84fMOpD/X7pRTZUfi6M+Tg==",
61
+ "dev": true,
62
+ "peerDependencies": {
63
+ "typescript": "^5.0.0"
64
+ }
65
+ },
66
+ "node_modules/@tscircuit/circuit-json-util": {
67
+ "version": "0.0.45",
68
+ "resolved": "https://registry.npmjs.org/@tscircuit/circuit-json-util/-/circuit-json-util-0.0.45.tgz",
69
+ "integrity": "sha512-zIcI5Fp1UllIm/JsjJsXhmgRDYReDUddJtylh5PZnkRK3ZVkMj+HV34A39qGHeYDg3bhf/89OQoxz+1fL68jug==",
70
+ "dev": true,
71
+ "license": "MIT",
72
+ "dependencies": {
73
+ "parsel-js": "^1.1.2"
74
+ },
75
+ "peerDependencies": {
76
+ "circuit-json": "*",
77
+ "transformation-matrix": "*",
78
+ "zod": "*"
79
+ }
80
+ },
81
+ "node_modules/@tscircuit/core": {
82
+ "version": "0.0.359",
83
+ "resolved": "https://registry.npmjs.org/@tscircuit/core/-/core-0.0.359.tgz",
84
+ "integrity": "sha512-cq9H7SAD46bd4GMD3OS7ALXSPHQnabWFnB85R05vYQBNLC49n/3se1cM9EVfuk7DBWY4Gpk6oUlcGnErF7vdgQ==",
85
+ "dev": true,
86
+ "dependencies": {
87
+ "@lume/kiwi": "^0.4.3",
88
+ "@tscircuit/capacity-autorouter": "^0.0.44",
89
+ "@tscircuit/checks": "^0.0.30",
90
+ "@tscircuit/circuit-json-util": "^0.0.45",
91
+ "@tscircuit/infgrid-ijump-astar": "^0.0.33",
92
+ "@tscircuit/math-utils": "^0.0.12",
93
+ "@tscircuit/props": "^0.0.163",
94
+ "@tscircuit/schematic-autolayout": "^0.0.6",
95
+ "@tscircuit/soup-util": "^0.0.41",
96
+ "circuit-json": "^0.0.153",
97
+ "circuit-json-to-connectivity-map": "^0.0.17",
98
+ "format-si-unit": "^0.0.3",
99
+ "nanoid": "^5.0.7",
100
+ "performance-now": "^2.1.0",
101
+ "react-reconciler": "^0.31.0",
102
+ "react-reconciler-18": "npm:[email protected]",
103
+ "schematic-symbols": "^0.0.121",
104
+ "transformation-matrix": "^2.16.1",
105
+ "zod": "^3.23.8"
106
+ },
107
+ "peerDependencies": {
108
+ "@tscircuit/footprinter": "*",
109
+ "typescript": "^5.0.0"
110
+ }
111
+ },
112
+ "node_modules/@tscircuit/core/node_modules/react": {
113
+ "version": "18.3.1",
114
+ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
115
+ "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
116
+ "dev": true,
117
+ "license": "MIT",
118
+ "peer": true,
119
+ "dependencies": {
120
+ "loose-envify": "^1.1.0"
121
+ },
122
+ "engines": {
123
+ "node": ">=0.10.0"
124
+ }
125
+ },
126
+ "node_modules/@tscircuit/core/node_modules/react-reconciler-18": {
127
+ "name": "react-reconciler",
128
+ "version": "0.29.2",
129
+ "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.29.2.tgz",
130
+ "integrity": "sha512-zZQqIiYgDCTP/f1N/mAR10nJGrPD2ZR+jDSEsKWJHYC7Cm2wodlwbR3upZRdC3cjIjSlTLNVyO7Iu0Yy7t2AYg==",
131
+ "dev": true,
132
+ "license": "MIT",
133
+ "dependencies": {
134
+ "loose-envify": "^1.1.0",
135
+ "scheduler": "^0.23.2"
136
+ },
137
+ "engines": {
138
+ "node": ">=0.10.0"
139
+ },
140
+ "peerDependencies": {
141
+ "react": "^18.3.1"
142
+ }
143
+ },
144
+ "node_modules/@tscircuit/core/node_modules/scheduler": {
145
+ "version": "0.23.2",
146
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
147
+ "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",
148
+ "dev": true,
149
+ "license": "MIT",
150
+ "dependencies": {
151
+ "loose-envify": "^1.1.0"
152
+ }
153
+ },
154
+ "node_modules/@tscircuit/footprinter": {
155
+ "version": "0.0.151",
156
+ "resolved": "https://registry.npmjs.org/@tscircuit/footprinter/-/footprinter-0.0.151.tgz",
157
+ "integrity": "sha512-+n8lSqNFcw9vbymkA3brMmKuZL5rvnhHvOH04A7lcUl6XQHUTUB800Ypse3O6NRirBxiVYWmn5DgTpxwlbX0Lw==",
158
+ "dev": true,
159
+ "license": "ISC",
160
+ "peer": true,
161
+ "dependencies": {
162
+ "@tscircuit/mm": "^0.0.8",
163
+ "zod": "^3.23.8"
164
+ },
165
+ "peerDependencies": {
166
+ "circuit-json": "*"
167
+ }
168
+ },
169
+ "node_modules/@tscircuit/infgrid-ijump-astar": {
170
+ "version": "0.0.33",
171
+ "resolved": "https://registry.npmjs.org/@tscircuit/infgrid-ijump-astar/-/infgrid-ijump-astar-0.0.33.tgz",
172
+ "integrity": "sha512-tmX4Esp+HqyIGCUD43steVUH8pKRuyBNs21r4NlApGGLu+K1XSrK9FinhVJyMiEsuwJdajLnMTzmVt8vSYSafA==",
173
+ "dev": true
174
+ },
175
+ "node_modules/@tscircuit/layout": {
176
+ "version": "0.0.29",
177
+ "resolved": "https://registry.npmjs.org/@tscircuit/layout/-/layout-0.0.29.tgz",
178
+ "integrity": "sha512-3V1SikE147UT/ag8/BRX5oBjYc6H0ZdV+7Et+ljp8fMyQy2P9EMbNKjS0yaXI1SSNgxfnEmDWqImw1JB0oWeXg==",
179
+ "dev": true,
180
+ "license": "ISC",
181
+ "peer": true,
182
+ "dependencies": {
183
+ "@tscircuit/soup-util": "*",
184
+ "transformation-matrix": "^2.16.1",
185
+ "zod": "*"
186
+ },
187
+ "peerDependencies": {
188
+ "@tscircuit/manual-edit-events": "*",
189
+ "@tscircuit/schematic-autolayout": "*",
190
+ "@tscircuit/soup-util": "*",
191
+ "circuit-json": "*",
192
+ "zod": "*"
193
+ }
194
+ },
195
+ "node_modules/@tscircuit/manual-edit-events": {
196
+ "version": "0.0.6",
197
+ "resolved": "https://registry.npmjs.org/@tscircuit/manual-edit-events/-/manual-edit-events-0.0.6.tgz",
198
+ "integrity": "sha512-PLgy+/Dsw1YcnNVNqfieNGTNIaRKRJ70Jt2LcSMljwaBOtsiOwtdzj24xCYO9XzJUZc7opKytShMlx863PehTQ==",
199
+ "dev": true,
200
+ "license": "ISC",
201
+ "peer": true,
202
+ "dependencies": {
203
+ "zod": "^3.23.8"
204
+ }
205
+ },
206
+ "node_modules/@tscircuit/math-utils": {
207
+ "version": "0.0.12",
208
+ "resolved": "https://registry.npmjs.org/@tscircuit/math-utils/-/math-utils-0.0.12.tgz",
209
+ "integrity": "sha512-pYk39tdEdgyaoT2kHd+1QKVVfztOKVn+BoyxTH9HREWaPsf3C90VkY2blRUKS26VcEzvcbxKlURW0JGkUgqlOg==",
210
+ "dev": true,
211
+ "peerDependencies": {
212
+ "typescript": "^5.0.0"
213
+ }
214
+ },
215
+ "node_modules/@tscircuit/mm": {
216
+ "version": "0.0.8",
217
+ "resolved": "https://registry.npmjs.org/@tscircuit/mm/-/mm-0.0.8.tgz",
218
+ "integrity": "sha512-nl7nxE7AhARbKuobflI0LUzoir7+wJyvwfPw6bzA/O0Q3YTcH3vBkU/Of+V/fp6ht+AofiCXj7YAH9E446138Q==",
219
+ "dev": true,
220
+ "peer": true,
221
+ "peerDependencies": {
222
+ "typescript": "^5.0.0"
223
+ }
224
+ },
225
+ "node_modules/@tscircuit/props": {
226
+ "version": "0.0.163",
227
+ "resolved": "https://registry.npmjs.org/@tscircuit/props/-/props-0.0.163.tgz",
228
+ "integrity": "sha512-AVs17q0L7IqpXJ00k1QWTjGZ2neP/GsJwxlu5zI4+WxA6uaVJ3F9peVH3+pfmPQzXcrO1E+JFUGcXHbdGaF0oQ==",
229
+ "dev": true,
230
+ "license": "ISC",
231
+ "peerDependencies": {
232
+ "@tscircuit/layout": "*",
233
+ "circuit-json": "*",
234
+ "react": "*",
235
+ "zod": "*"
236
+ }
237
+ },
238
+ "node_modules/@tscircuit/schematic-autolayout": {
239
+ "version": "0.0.6",
240
+ "resolved": "https://registry.npmjs.org/@tscircuit/schematic-autolayout/-/schematic-autolayout-0.0.6.tgz",
241
+ "integrity": "sha512-34cQxtlSylBKyHkzaMBCynaWJgN9c/mWm7cz63StTYIafKmfFs383K8Xoc4QX8HXCvVrHYl1aK15onZua9MxeA==",
242
+ "dev": true,
243
+ "dependencies": {
244
+ "@tscircuit/soup-util": "^0.0.38",
245
+ "transformation-matrix": "^2.16.1"
246
+ }
247
+ },
248
+ "node_modules/@tscircuit/schematic-autolayout/node_modules/@tscircuit/soup-util": {
249
+ "version": "0.0.38",
250
+ "resolved": "https://registry.npmjs.org/@tscircuit/soup-util/-/soup-util-0.0.38.tgz",
251
+ "integrity": "sha512-GdcuFxk+qnJZv+eI7ZoJ1MJEseFgRyaztMtQ/OXA2SUnxyPEH0UTy9vkhKTm+8GTePryEgdXcc65TgUyrr44ww==",
252
+ "dev": true,
253
+ "license": "ISC",
254
+ "dependencies": {
255
+ "parsel-js": "^1.1.2"
256
+ },
257
+ "peerDependencies": {
258
+ "circuit-json": "*",
259
+ "transformation-matrix": "*",
260
+ "zod": "*"
261
+ }
262
+ },
263
+ "node_modules/@tscircuit/soup-util": {
264
+ "version": "0.0.41",
265
+ "resolved": "https://registry.npmjs.org/@tscircuit/soup-util/-/soup-util-0.0.41.tgz",
266
+ "integrity": "sha512-47JKWBUKkRVHhad0HhBbdOJxB6v/eiac46beiKRBMlJqiZ1gPGI276v9iZfpF7c4hXR69cURcgiwuA5vowrFEg==",
267
+ "dev": true,
268
+ "license": "ISC",
269
+ "dependencies": {
270
+ "parsel-js": "^1.1.2"
271
+ },
272
+ "peerDependencies": {
273
+ "circuit-json": "*",
274
+ "transformation-matrix": "*",
275
+ "zod": "*"
276
+ }
277
+ },
278
+ "node_modules/@types/react": {
279
+ "version": "19.0.12",
280
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.12.tgz",
281
+ "integrity": "sha512-V6Ar115dBDrjbtXSrS+/Oruobc+qVbbUxDFC1RSbRqLt5SYvxxyIDrSC85RWml54g+jfNeEMZhEj7wW07ONQhA==",
282
+ "dev": true,
283
+ "license": "MIT",
284
+ "dependencies": {
285
+ "csstype": "^3.0.2"
286
+ }
287
+ },
288
+ "node_modules/circuit-json": {
289
+ "version": "0.0.153",
290
+ "resolved": "https://registry.npmjs.org/circuit-json/-/circuit-json-0.0.153.tgz",
291
+ "integrity": "sha512-gRjXgFOZam7yhVhXtwNa5YxFF4syd2hB/gIndEsuuwuy6YjDRSAhZk93oeiDY9+V81RuiBUYK11jahDn+dDEsQ==",
292
+ "dev": true,
293
+ "license": "ISC",
294
+ "dependencies": {
295
+ "nanoid": "^5.0.7",
296
+ "zod": "^3.23.6"
297
+ }
298
+ },
299
+ "node_modules/circuit-json-to-connectivity-map": {
300
+ "version": "0.0.17",
301
+ "resolved": "https://registry.npmjs.org/circuit-json-to-connectivity-map/-/circuit-json-to-connectivity-map-0.0.17.tgz",
302
+ "integrity": "sha512-0IlFTwGWFXzlrYSvXQocXi6pYriF/JKnfihfvnVZ4p60kMC+1QvtJdivW9C4I0VNXEe922xak70v3YZNJrjI1g==",
303
+ "dev": true,
304
+ "dependencies": {
305
+ "@tscircuit/math-utils": "^0.0.4"
306
+ },
307
+ "peerDependencies": {
308
+ "typescript": "^5.0.0"
309
+ }
310
+ },
311
+ "node_modules/circuit-json-to-connectivity-map/node_modules/@tscircuit/math-utils": {
312
+ "version": "0.0.4",
313
+ "resolved": "https://registry.npmjs.org/@tscircuit/math-utils/-/math-utils-0.0.4.tgz",
314
+ "integrity": "sha512-8Bu/C+go95Zk9AXb4Pe37OgObGhOd5F7UIzXV+u1PKuhpJpGjr+X/WHBzSI7xHrBSvwsf39/Luooe4b3djuzgQ==",
315
+ "dev": true,
316
+ "peerDependencies": {
317
+ "typescript": "^5.0.0"
318
+ }
319
+ },
320
+ "node_modules/csstype": {
321
+ "version": "3.1.3",
322
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
323
+ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
324
+ "dev": true,
325
+ "license": "MIT"
326
+ },
327
+ "node_modules/format-si-unit": {
328
+ "version": "0.0.3",
329
+ "resolved": "https://registry.npmjs.org/format-si-unit/-/format-si-unit-0.0.3.tgz",
330
+ "integrity": "sha512-rhw1g1mOoLV497FtKNbzBPE4fJXfWRmIEPRO0DKXpEPvS54vRLjG8e1jE4vOcjZg4bsoOPJkM9jB6yGk+0XKmQ==",
331
+ "dev": true,
332
+ "peerDependencies": {
333
+ "typescript": "^5.0.0"
334
+ }
335
+ },
336
+ "node_modules/js-tokens": {
337
+ "version": "4.0.0",
338
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
339
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
340
+ "dev": true,
341
+ "license": "MIT"
342
+ },
343
+ "node_modules/loose-envify": {
344
+ "version": "1.4.0",
345
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
346
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
347
+ "dev": true,
348
+ "license": "MIT",
349
+ "dependencies": {
350
+ "js-tokens": "^3.0.0 || ^4.0.0"
351
+ },
352
+ "bin": {
353
+ "loose-envify": "cli.js"
354
+ }
355
+ },
356
+ "node_modules/nanoid": {
357
+ "version": "5.1.5",
358
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.5.tgz",
359
+ "integrity": "sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==",
360
+ "dev": true,
361
+ "funding": [
362
+ {
363
+ "type": "github",
364
+ "url": "https://github.com/sponsors/ai"
365
+ }
366
+ ],
367
+ "license": "MIT",
368
+ "bin": {
369
+ "nanoid": "bin/nanoid.js"
370
+ },
371
+ "engines": {
372
+ "node": "^18 || >=20"
373
+ }
374
+ },
375
+ "node_modules/parsel-js": {
376
+ "version": "1.2.1",
377
+ "resolved": "https://registry.npmjs.org/parsel-js/-/parsel-js-1.2.1.tgz",
378
+ "integrity": "sha512-omFBig09mUh/NjBGba4DxVFAsqCY4C/6UYIaJuDOxJw2GlpgUJdPlNF301971gCP3Gt727+F+NZIXN483VAKIg==",
379
+ "dev": true,
380
+ "license": "MIT"
381
+ },
382
+ "node_modules/performance-now": {
383
+ "version": "2.1.0",
384
+ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
385
+ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==",
386
+ "dev": true,
387
+ "license": "MIT"
388
+ },
389
+ "node_modules/react": {
390
+ "version": "19.1.0",
391
+ "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz",
392
+ "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==",
393
+ "dev": true,
394
+ "license": "MIT",
395
+ "peer": true,
396
+ "engines": {
397
+ "node": ">=0.10.0"
398
+ }
399
+ },
400
+ "node_modules/react-reconciler": {
401
+ "version": "0.31.0",
402
+ "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.31.0.tgz",
403
+ "integrity": "sha512-7Ob7Z+URmesIsIVRjnLoDGwBEG/tVitidU0nMsqX/eeJaLY89RISO/10ERe0MqmzuKUUB1rmY+h1itMbUHg9BQ==",
404
+ "dev": true,
405
+ "license": "MIT",
406
+ "dependencies": {
407
+ "scheduler": "^0.25.0"
408
+ },
409
+ "engines": {
410
+ "node": ">=0.10.0"
411
+ },
412
+ "peerDependencies": {
413
+ "react": "^19.0.0"
414
+ }
415
+ },
416
+ "node_modules/scheduler": {
417
+ "version": "0.25.0",
418
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0.tgz",
419
+ "integrity": "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==",
420
+ "dev": true,
421
+ "license": "MIT"
422
+ },
423
+ "node_modules/schematic-symbols": {
424
+ "version": "0.0.121",
425
+ "resolved": "https://registry.npmjs.org/schematic-symbols/-/schematic-symbols-0.0.121.tgz",
426
+ "integrity": "sha512-xqWY43VC10wIVL+Kf8PlHj27Ojr7JdFeFHTRoSvmc6zvHirPQiXlnb3l70BerZQy6S/EOH+Q9yGRADYU0m8T1w==",
427
+ "dev": true,
428
+ "peerDependencies": {
429
+ "typescript": "^5.5.4"
430
+ }
431
+ },
432
+ "node_modules/transformation-matrix": {
433
+ "version": "2.16.1",
434
+ "resolved": "https://registry.npmjs.org/transformation-matrix/-/transformation-matrix-2.16.1.tgz",
435
+ "integrity": "sha512-tdtC3wxVEuzU7X/ydL131Q3JU5cPMEn37oqVLITjRDSDsnSHVFzW2JiCLfZLIQEgWzZHdSy3J6bZzvKEN24jGA==",
436
+ "dev": true,
437
+ "license": "MIT",
438
+ "funding": {
439
+ "url": "https://github.com/sponsors/chrvadala"
440
+ }
441
+ },
442
+ "node_modules/typescript": {
443
+ "version": "5.8.2",
444
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
445
+ "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
446
+ "dev": true,
447
+ "license": "Apache-2.0",
448
+ "peer": true,
449
+ "bin": {
450
+ "tsc": "bin/tsc",
451
+ "tsserver": "bin/tsserver"
452
+ },
453
+ "engines": {
454
+ "node": ">=14.17"
455
+ }
456
+ },
457
+ "node_modules/zod": {
458
+ "version": "3.24.2",
459
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz",
460
+ "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==",
461
+ "dev": true,
462
+ "license": "MIT",
463
+ "funding": {
464
+ "url": "https://github.com/sponsors/colinhacks"
465
+ }
466
+ }
467
+ }
468
+ }
eda/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "tss",
3
+ "version": "1.0.0",
4
+ "description": "A TSCircuit project",
5
+ "main": "index.tsx",
6
+ "keywords": [
7
+ "tscircuit",
8
+ "electronics"
9
+ ],
10
+ "scripts": {
11
+ "dev": "tsci dev",
12
+ "build": "tsci build"
13
+ },
14
+ "devDependencies": {
15
+ "@tscircuit/core": "^0.0.359",
16
+ "@types/react": "^19.0.12"
17
+ }
18
+ }
eda/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES6",
4
+ "module": "ESNext",
5
+ "jsx": "react-jsx",
6
+ "outDir": "dist",
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "moduleResolution": "node",
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "sourceMap": true,
14
+ "allowSyntheticDefaultImports": true,
15
+ "experimentalDecorators": true,
16
+ "types": [
17
+ "@tscircuit/core"
18
+ ]
19
+ }
20
+ }
kaluma-rp2-pico2-w-1.2.0.uf2 ADDED
Binary file
main.js ADDED
@@ -0,0 +1,13 @@
1
+ pinMode(0, OUTPUT);
2
+ pinMode(1, INPUT_PULLUP);
3
+ pinMode(26, INPUT)
4
+
5
+ attachInterrupt(1, (pin, mode) => {
6
+ console.log(analogRead(26));
7
+ if (digitalRead(1) === LOW) {
8
+ digitalWrite(0, HIGH)
9
+ }
10
+ if (digitalRead(1) === HIGH) {
11
+ digitalWrite(0, LOW)
12
+ }
13
+ }, CHANGE);
src/main.zig ADDED
@@ -0,0 +1,24 @@
1
+ const std = @import("std");
2
+ const microzig = @import("microzig");
3
+ const rp2xxx = microzig.hal;
4
+ const time = rp2xxx.time;
5
+
6
+ // Compile-time pin configuration
7
+ const pin_config = rp2xxx.pins.GlobalConfiguration{
8
+ .GPIO25 = .{
9
+ .name = "led",
10
+ .direction = .out,
11
+ },
12
+ };
13
+
14
+ const pins = pin_config.pins();
15
+
16
+ pub fn main() !void {
17
+ pin_config.apply();
18
+ pin_config.apply();
19
+
20
+ while (true) {
21
+ pins.led.toggle();
22
+ time.sleep_ms(250);
23
+ }
24
+ }