Ports raspberrypi-rp2040 to microzig-package.json style, reorders fields to have nicer file.

wch-ch32v003
Felix "xq" Queißner 8 months ago
parent a253584a01
commit 243c263150

@ -1,24 +1,28 @@
const std = @import("std");
const rp2040 = @import("microzig-bsp-rp2040");
const MicroZig = @import("microzig");
const MicroZig = @import("microzig-build");
const available_examples = [_]Example{
.{ .name = "pico_adc", .target = "board:raspberry_pi/pico", .file = "src/adc.zig" },
.{ .name = "pico_blinky", .target = "board:raspberry_pi/pico", .file = "src/blinky.zig" },
// TODO: Fix multicore hal! .{ .name = "pico", .target = "board:raspberry_pi/pico", .file = "src/blinky_core1.zig" },
.{ .name = "pico_flash-program", .target = "board:raspberry_pi/pico", .file = "src/flash_program.zig" },
.{ .name = "pico_gpio-clk", .target = "board:raspberry_pi/pico", .file = "src/gpio_clk.zig" },
.{ .name = "pico_i2c-bus-scan", .target = "board:raspberry_pi/pico", .file = "src/i2c_bus_scan.zig" },
.{ .name = "pico_pwm", .target = "board:raspberry_pi/pico", .file = "src/pwm.zig" },
.{ .name = "pico_random", .target = "board:raspberry_pi/pico", .file = "src/random.zig" },
.{ .name = "pico_spi-master", .target = "board:raspberry_pi/pico", .file = "src/spi_master.zig" },
.{ .name = "pico_squarewave", .target = "board:raspberry_pi/pico", .file = "src/squarewave.zig" },
.{ .name = "pico_uart", .target = "board:raspberry_pi/pico", .file = "src/uart.zig" },
.{ .name = "pico_usb-device", .target = "board:raspberry_pi/pico", .file = "src/usb_device.zig" },
.{ .name = "pico_usb-hid", .target = "board:raspberry_pi/pico", .file = "src/usb_hid.zig" },
.{ .name = "pico_ws2812", .target = "board:raspberry_pi/pico", .file = "src/ws2812.zig" },
.{ .name = "rp2040-matrix_tiles", .target = "board:waveshare/rp2040_matrix", .file = "src/tiles.zig" },
// RaspberryPi Boards:
.{ .target = "board:raspberry_pi/pico", .name = "pico_adc", .file = "src/adc.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_blinky", .file = "src/blinky.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_flash-program", .file = "src/flash_program.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_gpio-clk", .file = "src/gpio_clk.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_i2c-bus-scan", .file = "src/i2c_bus_scan.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_pwm", .file = "src/pwm.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_random", .file = "src/random.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_spi-master", .file = "src/spi_master.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_squarewave", .file = "src/squarewave.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_uart", .file = "src/uart.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_usb-device", .file = "src/usb_device.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_usb-hid", .file = "src/usb_hid.zig" },
.{ .target = "board:raspberry_pi/pico", .name = "pico_ws2812", .file = "src/ws2812.zig" },
// TODO: Fix multicore hal! .{ .name = "pico", .target = "board:raspberry_pi/pico" , .file = "src/blinky_core1.zig" },
// WaveShare Boards:
.{ .target = "board:waveshare/rp2040_matrix", .name = "rp2040-matrix_tiles", .file = "src/tiles.zig" },
// .{ .target = "board:waveshare/rp2040_eth", .name = "rp2040-eth" },
// .{ .target = "board:waveshare/rp2040_plus_4m", .name = "rp2040-plus-4m" },
// .{ .target = "board:waveshare/rp2040_plus_16m", .name = "rp2040-plus-16m" },
};
pub fn build(b: *std.Build) void {
@ -26,6 +30,9 @@ pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const show_targets_step = b.step("show-targets", "Shows all available MicroZig targets");
show_targets_step.dependOn(microzig.getShowTargetsStep());
for (available_examples) |example| {
const target = microzig.findTarget(example.target).?;

@ -1,18 +0,0 @@
.{
.name = "microzig-raspberrypi-rp2040-examples",
.version = "0.1.0",
.dependencies = .{
.microzig = .{
.url = "http://localhost:8080/microzig-build.tar.gz",
.hash = "1220db1de385b765aa45a04719c199d7ab8306fcca6ac1a12b487ed589a69d05a665",
},
.@"microzig-core" = .{
.url = "http://localhost:8080/microzig-core.tar.gz",
.hash = "122006d6343021c1502ceba7948fd61ac813f2bb498a74df27a50e34398ccdfb92e3",
},
.@"microzig-bsp-rp2040" = .{
.url = "http://localhost:8080/board-support/raspberrypi/rp2040.tar.gz",
.hash = "12200319b02d9d0237984fd7acb15a4945e5547b750e0a3309d13d62440983b5b67f",
},
},
}

@ -0,0 +1,7 @@
{
"package_name": "raspberrypi/rp2040",
"package_type": "example",
"inner_dependencies": [
"raspberrypi/rp2040"
]
}
Loading…
Cancel
Save