restructure for regz rewrite

wch-ch32v003
Matt Knight 2 years ago
commit d8e329d90b

2
.gitignore vendored

@ -0,0 +1,2 @@
zig-out
zig-cache

@ -0,0 +1,7 @@
= Nordic nrf5x
HALs and register definitions for nrf5x devices
== Renode supports:
- nrf52840 development kit

@ -0,0 +1,20 @@
const std = @import("std");
const microzig = @import("deps/microzig/src/main.zig");
const chips = @import("src/chips.zig");
pub fn build(b: *std.build.Builder) void {
const optimize = b.standardOptimizeOption(.{});
inline for (@typeInfo(chips).Struct.decls) |decl| {
if (!decl.is_pub)
continue;
const exe = microzig.addEmbeddedExecutable(
b,
decl.name ++ ".minimal",
"test/programs/minimal.zig",
.{ .chip = @field(chips, decl.name) },
.{ .optimize = optimize },
);
exe.install();
}
}

@ -0,0 +1,43 @@
const std = @import("std");
const micro = @import("../deps/microzig/src/main.zig");
const Chip = micro.Chip;
const MemoryRegion = micro.MemoryRegion;
fn root_dir() []const u8 {
return std.fs.path.dirname(@src().file) orelse unreachable;
}
pub const nrf52840 = Chip{
.name = "nrf52840",
.source = .{
.path = root_dir() ++ "/chips/nrf52840.zig",
},
.json_register_schema = .{
.path = root_dir() ++ "/chips.nrf52840.json",
},
.cpu = micro.cpus.cortex_m4,
.memory_regions = &.{
MemoryRegion{ .offset = 0x00000000, .length = 0x100000, .kind = .flash },
MemoryRegion{ .offset = 0x20000000, .length = 0x40000, .kind = .ram },
// EXTFLASH
MemoryRegion{ .offset = 0x12000000, .length = 0x8000000, .kind = .flash },
// CODE_RAM
MemoryRegion{ .offset = 0x800000, .length = 0x40000, .kind = .ram },
},
};
pub const nrf52832 = Chip{
.name = "nrf52",
.source = .{
.path = root_dir() ++ "/chips/nrf52.zig",
},
.json_register_schema = .{
.path = root_dir() ++ "/chips.nrf52.json",
},
.cpu = micro.cpus.cortex_m4,
.memory_regions = &.{
MemoryRegion{ .offset = 0x00000000, .length = 0x80000, .kind = .flash },
MemoryRegion{ .offset = 0x20000000, .length = 0x10000, .kind = .ram },
},
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,10 @@
*** Settings ***
Suite Setup Setup
Suite Teardown Teardown
Test Teardown Test Teardown
Resource ${RENODEKEYWORDS}
*** Test Cases ***
Should Print Help
${x}= Execute Command help
Should Contain ${x} Available commands:

@ -0,0 +1,5 @@
const micro = @import("microzig");
pub fn main() void {
// This function will contain the application logic.
}
Loading…
Cancel
Save