From d253056c71327003ea357ee601f5f8508788acf5 Mon Sep 17 00:00:00 2001 From: Matt Knight Date: Fri, 27 May 2022 08:58:42 -0700 Subject: [PATCH 1/3] cortex-m0plus and fix for missing hal (#49) --- src/core/microzig.zig | 2 ++ src/modules/cpus.zig | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/core/microzig.zig b/src/core/microzig.zig index 8df10fcc7..0353d355c 100644 --- a/src/core/microzig.zig +++ b/src/core/microzig.zig @@ -24,6 +24,8 @@ pub const board = if (config.has_board) @import("board") else void; /// Provides access to the low level features of the CPU. pub const cpu = @import("cpu"); +pub const hal = @import("hal"); + /// Module that helps with interrupt handling. pub const interrupts = @import("interrupts.zig"); diff --git a/src/modules/cpus.zig b/src/modules/cpus.zig index 95f37e447..3c739c1df 100644 --- a/src/modules/cpus.zig +++ b/src/modules/cpus.zig @@ -18,6 +18,17 @@ pub const avr5 = Cpu{ }, }; +pub const cortex_m0plus = Cpu{ + .name = "ARM Cortex-M0+", + .path = root_path ++ "cpus/cortex-m/cortex-m.zig", + .target = std.zig.CrossTarget{ + .cpu_arch = .thumb, + .cpu_model = .{ .explicit = &std.Target.arm.cpu.cortex_m0plus }, + .os_tag = .freestanding, + .abi = .none, + }, +}; + pub const cortex_m3 = Cpu{ .name = "ARM Cortex-M3", .path = root_path ++ "cpus/cortex-m/cortex-m.zig", From 423c886d2ec9d78579afcf6dfef47528c188487d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Quei=C3=9Fner?= Date: Sat, 28 May 2022 10:37:14 +0200 Subject: [PATCH 2/3] Master update (#51) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adds logo * Update to latest master. Co-authored-by: Felix "xq" Queißner --- design/logo-text-inkscape-variant-1.svg | 64 +++++++++++++++++++++++++ design/logo-text-inkscape-variant-2.svg | 64 +++++++++++++++++++++++++ design/logo-text-inkscape.svg | 64 +++++++++++++++++++++++++ design/logo-text-variant-1.svg | 15 ++++++ design/logo-text-variant-2.svg | 15 ++++++ design/logo.svg | 9 ++++ src/main.zig | 20 ++++---- 7 files changed, 241 insertions(+), 10 deletions(-) create mode 100644 design/logo-text-inkscape-variant-1.svg create mode 100644 design/logo-text-inkscape-variant-2.svg create mode 100644 design/logo-text-inkscape.svg create mode 100644 design/logo-text-variant-1.svg create mode 100644 design/logo-text-variant-2.svg create mode 100644 design/logo.svg diff --git a/design/logo-text-inkscape-variant-1.svg b/design/logo-text-inkscape-variant-1.svg new file mode 100644 index 000000000..f26743e96 --- /dev/null +++ b/design/logo-text-inkscape-variant-1.svg @@ -0,0 +1,64 @@ + + + + + + + + + MicroZig + + diff --git a/design/logo-text-inkscape-variant-2.svg b/design/logo-text-inkscape-variant-2.svg new file mode 100644 index 000000000..875cef6cc --- /dev/null +++ b/design/logo-text-inkscape-variant-2.svg @@ -0,0 +1,64 @@ + + + + + + + + + MicroZig + + diff --git a/design/logo-text-inkscape.svg b/design/logo-text-inkscape.svg new file mode 100644 index 000000000..69dba8b33 --- /dev/null +++ b/design/logo-text-inkscape.svg @@ -0,0 +1,64 @@ + + + + + + + + + MicroZig + + diff --git a/design/logo-text-variant-1.svg b/design/logo-text-variant-1.svg new file mode 100644 index 000000000..530592f7e --- /dev/null +++ b/design/logo-text-variant-1.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/design/logo-text-variant-2.svg b/design/logo-text-variant-2.svg new file mode 100644 index 000000000..9a732cbcb --- /dev/null +++ b/design/logo-text-variant-2.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/design/logo.svg b/design/logo.svg new file mode 100644 index 000000000..3e5f419ef --- /dev/null +++ b/design/logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/main.zig b/src/main.zig index afd868ae9..cd3098643 100644 --- a/src/main.zig +++ b/src/main.zig @@ -108,18 +108,18 @@ pub fn addEmbeddedExecutable( const config_pkg = Pkg{ .name = "microzig-config", - .path = .{ .path = config_file_name }, + .source = .{ .path = config_file_name }, }; const chip_pkg = Pkg{ .name = "chip", - .path = .{ .path = chip.path }, + .source = .{ .path = chip.path }, .dependencies = &.{pkgs.microzig}, }; const cpu_pkg = Pkg{ .name = "cpu", - .path = .{ .path = chip.cpu.path }, + .source = .{ .path = chip.cpu.path }, .dependencies = &.{pkgs.microzig}, }; @@ -148,7 +148,7 @@ pub fn addEmbeddedExecutable( break :blk std.build.Pkg{ .name = "app", - .path = .{ .path = source }, + .source = .{ .path = source }, .dependencies = app_pkgs.items, }; }; @@ -163,7 +163,7 @@ pub fn addEmbeddedExecutable( if (options.hal_package_path) |hal_package_path| exe.addPackage(.{ .name = "hal", - .path = hal_package_path, + .source = hal_package_path, .dependencies = &.{pkgs.microzig}, }); @@ -171,7 +171,7 @@ pub fn addEmbeddedExecutable( .board => |board| { exe.addPackage(std.build.Pkg{ .name = "board", - .path = .{ .path = board.path }, + .source = .{ .path = board.path }, .dependencies = &.{pkgs.microzig}, }); }, @@ -184,12 +184,12 @@ pub fn addEmbeddedExecutable( const pkgs = struct { const mmio = std.build.Pkg{ .name = "microzig-mmio", - .path = .{ .path = root_path ++ "core/mmio.zig" }, + .source = .{ .path = root_path ++ "core/mmio.zig" }, }; const microzig = std.build.Pkg{ .name = "microzig", - .path = .{ .path = root_path ++ "core/import-package.zig" }, + .source = .{ .path = root_path ++ "core/import-package.zig" }, }; }; @@ -197,13 +197,13 @@ const pkgs = struct { pub const drivers = struct { pub const quadrature = std.build.Pkg{ .name = "microzig.quadrature", - .path = .{ .path = root_path ++ "drivers/quadrature.zig" }, + .source = .{ .path = root_path ++ "drivers/quadrature.zig" }, .dependencies = &.{pkgs.microzig}, }; pub const button = std.build.Pkg{ .name = "microzig.button", - .path = .{ .path = root_path ++ "drivers/button.zig" }, + .source = .{ .path = root_path ++ "drivers/button.zig" }, .dependencies = &.{pkgs.microzig}, }; }; From 7fcaf17c468ed5301059ace4e4be595bf7aa46a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Quei=C3=9Fner?= Date: Sat, 28 May 2022 11:12:28 +0200 Subject: [PATCH 3/3] Adds logo (#50) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Creates logo with bright and dark variant * Adds logo to README.md Co-authored-by: Felix "xq" Queißner --- README.md | 19 ++--- design/logo-text-auto.svg | 13 +++ design/logo-text-brightmode.svg | 1 + design/logo-text-darkmode.svg | 1 + design/logo-text-inkscape-variant-1.svg | 64 --------------- design/logo-text-inkscape-variant-2.svg | 64 --------------- design/logo-text-inkscape.svg | 103 +++++++++++++++++------- design/logo-text-variant-1.svg | 15 ---- design/logo-text-variant-2.svg | 15 ---- design/logo.svg | 10 +-- 10 files changed, 101 insertions(+), 204 deletions(-) create mode 100644 design/logo-text-auto.svg create mode 100644 design/logo-text-brightmode.svg create mode 100644 design/logo-text-darkmode.svg delete mode 100644 design/logo-text-inkscape-variant-1.svg delete mode 100644 design/logo-text-inkscape-variant-2.svg delete mode 100644 design/logo-text-variant-1.svg delete mode 100644 design/logo-text-variant-2.svg diff --git a/README.md b/README.md index 1a44ae33f..0aaf89673 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# microzig +![microzig logo](design/logo-text-auto.svg) [![discord](https://img.shields.io/discord/824493524413710336.svg?logo=discord)](https://discord.gg/ShUWykk38X) @@ -6,15 +6,14 @@ APIs will likely break in the future -Table of Contents -================= +# Table of Contents - * [Contributing](#contributing) - * [Introduction](#introduction) - * [How to](#how-to) - * [Embedded project with "supported" chip/board](#embedded-project-with-supported-chipboard) - * [Embedded project with "unsupported" chip](#embedded-project-with-unsupported-chip) - * [Interrupts](#interrupts) +- [Contributing](#contributing) +- [Introduction](#introduction) +- [How to](#how-to) + - [Embedded project with "supported" chip/board](#embedded-project-with-supported-chipboard) + - [Embedded project with "unsupported" chip](#embedded-project-with-unsupported-chip) + - [Interrupts](#interrupts) @@ -26,6 +25,7 @@ There will be issues marked as `good first issue`, or drafts for larger ideas th ## Introduction This repo contains the infrastructure for getting started in an embedded Zig project, as well as some code to interact with some chips/boards. Specifically it offers: + - a single easy-to-use builder function that: - generates your linker script - sets up packages and start code @@ -87,6 +87,7 @@ pub fn main() !void { If you have a board/chip that isn't defined in microzig, you can set it up yourself! You need to have: + - SVD or ATDF file defining registers - flash and ram address and sizes diff --git a/design/logo-text-auto.svg b/design/logo-text-auto.svg new file mode 100644 index 000000000..ab4049446 --- /dev/null +++ b/design/logo-text-auto.svg @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/design/logo-text-brightmode.svg b/design/logo-text-brightmode.svg new file mode 100644 index 000000000..c048b67d2 --- /dev/null +++ b/design/logo-text-brightmode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/design/logo-text-darkmode.svg b/design/logo-text-darkmode.svg new file mode 100644 index 000000000..f744c990b --- /dev/null +++ b/design/logo-text-darkmode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/design/logo-text-inkscape-variant-1.svg b/design/logo-text-inkscape-variant-1.svg deleted file mode 100644 index f26743e96..000000000 --- a/design/logo-text-inkscape-variant-1.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - MicroZig - - diff --git a/design/logo-text-inkscape-variant-2.svg b/design/logo-text-inkscape-variant-2.svg deleted file mode 100644 index 875cef6cc..000000000 --- a/design/logo-text-inkscape-variant-2.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - MicroZig - - diff --git a/design/logo-text-inkscape.svg b/design/logo-text-inkscape.svg index 69dba8b33..210065c4c 100644 --- a/design/logo-text-inkscape.svg +++ b/design/logo-text-inkscape.svg @@ -2,16 +2,15 @@ + inkscape:current-layer="layer1" + showguides="true" + inkscape:guide-bbox="true"> + + + - - + + + MicroZig + style="font-size:112.46px;line-height:1.25;font-family:'Dash Horizon';-inkscape-font-specification:'Dash Horizon, Normal';fill:#acacac;stroke-width:2.86448;fill-opacity:1"> + + + + + + + + + + diff --git a/design/logo-text-variant-1.svg b/design/logo-text-variant-1.svg deleted file mode 100644 index 530592f7e..000000000 --- a/design/logo-text-variant-1.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/design/logo-text-variant-2.svg b/design/logo-text-variant-2.svg deleted file mode 100644 index 9a732cbcb..000000000 --- a/design/logo-text-variant-2.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/design/logo.svg b/design/logo.svg index 3e5f419ef..c48f7174f 100644 --- a/design/logo.svg +++ b/design/logo.svg @@ -1,9 +1 @@ - - - - - - - - - +