Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions port/nordic/nrf5x/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ boards: struct {
microbit_v1: *const microzig.Target,
microbit_v2: *const microzig.Target,
},
nicekeyboards: struct {
nice_nano: *const microzig.Target,
},
},

pub fn init(dep: *std.Build.Dependency) Self {
Expand Down Expand Up @@ -191,6 +194,30 @@ pub fn init(dep: *std.Build.Dependency) Self {
},
}),
},
.nicekeyboards = .{
.nice_nano = chip_nrf52840.derive(.{
.preferred_binary_format = .{ .uf2 = .{ .family_id = .NRF52840 } },
.chip = .{
.name = "nrf52840",
.url = "https://www.nordicsemi.com/products/nrf52840",
.register_definition = .{
.svd = nrfx.path("mdk/nrf52840.svd"),
},
.memory_regions = &.{
.{ .tag = .flash, .offset = 0x00026000, .length = 0x100000 - 0x26000, .access = .rx },
.{ .tag = .ram, .offset = 0x20000008, .length = 0x40000 - 8, .access = .rwx },
},
.patch_files = &.{
b.path("patches/nrf528xx.zon"),
},
},
.board = .{
.name = "nice!nano",
.url = "https://nicekeyboards.com/docs/nice-nano",
.root_source_file = b.path("src/boards/nice_nano.zig"),
},
}),
},
},
};
}
Expand Down
12 changes: 12 additions & 0 deletions port/nordic/nrf5x/src/boards/nice_nano.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const microzig = @import("microzig");
const nrf = microzig.hal;
const gpio = nrf.gpio;

pub const led = gpio.num(0, 15);
pub const uart_tx = gpio.num(0, 9);
pub const uart_rx = gpio.num(0, 10);

pub fn init() void {
led.set_direction(.out);
led.put(0);
}
Loading