# zigembeddedgroup/microzig architecture

> Architecture diagram of the GitHub repository zigembeddedgroup/microzig, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zigembeddedgroup/microzig
- Repository: https://github.com/zigembeddedgroup/microzig

## Overview

MicroZig is an in-development Zig embedded-development project; the README points users to its website but documents no concrete workflow. The supplied tree shows supporting runtime modules: a freestanding libc interface, lwIP networking configuration/hooks, FreeRTOS/Pico SDK compatibility, and RP2040 register definitions. Edges below reflect the sampled headers and IRQ implementation or explicit comments; the main Zig application/platform entry points are not present, so no end-to-end firmware flow is inferred.

Main entry points: [`modules/freertos/src/picosdk_irq.c`](https://github.com/zigembeddedgroup/microzig/blob/main/modules/freertos/src/picosdk_irq.c) (IRQ support), [`modules/lwip/include/lwip.h`](https://github.com/zigembeddedgroup/microzig/blob/main/modules/lwip/include/lwip.h) (lwIP facade), [`modules/foundation-libc/include`](https://github.com/zigembeddedgroup/microzig/tree/main/modules/foundation-libc/include) (Libc headers), [`modules/freertos/include/freertos.h`](https://github.com/zigembeddedgroup/microzig/blob/main/modules/freertos/include/freertos.h) (FreeRTOS API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_libc["C Runtime"]
  node_libc_headers["Libc headers"]
  node_assert_api["Assert API<br/>[assert.h]"]
  node_panic_api["Libc API<br/>[libc.h]"]
end

subgraph group_network["Networking"]
  node_lwip_facade["lwIP facade<br/>[lwip.h]"]
  node_lwip_config["lwIP options<br/>[lwipopts.h]"]
  node_lwip_hooks["lwIP platform hooks<br/>[cc.h]"]
end

subgraph group_rtos["RTOS Support"]
  node_freertos_api["FreeRTOS API<br/>[freertos.h]"]
  node_irq_impl["IRQ support<br/>[picosdk_irq.c]"]
  node_sdk_stubs["Pico SDK stubs<br/>[picosdk_stubs.c]"]
end

subgraph group_hardware["Hardware Support"]
  node_rp_registers["RP2040 registers<br/>[m0plus.h]"]
end

node_author(("Firmware author"))
node_hardware_irq["Hardware IRQ API"]
node_spinlock_api["Spinlock API"]

node_author -->|"uses"| node_libc_headers
node_libc_headers -->|"includes"| node_assert_api
node_author -->|"uses"| node_lwip_facade
node_lwip_facade -->|"configured by"| node_lwip_config
node_lwip_facade -->|"platform hooks"| node_lwip_hooks
node_author -->|"uses"| node_freertos_api
node_irq_impl -->|"programs IRQs"| node_hardware_irq
node_irq_impl -->|"locks handlers"| node_spinlock_api
node_irq_impl -.->|"accesses NVIC"| node_rp_registers
node_sdk_stubs -->|"satisfies port refs"| node_freertos_api

click node_libc_headers "https://github.com/zigembeddedgroup/microzig/tree/main/modules/foundation-libc/include"
click node_assert_api "https://github.com/zigembeddedgroup/microzig/blob/main/modules/foundation-libc/include/assert.h"
click node_panic_api "https://github.com/zigembeddedgroup/microzig/blob/main/modules/foundation-libc/include/foundation/libc.h"
click node_lwip_facade "https://github.com/zigembeddedgroup/microzig/blob/main/modules/lwip/include/lwip.h"
click node_lwip_config "https://github.com/zigembeddedgroup/microzig/blob/main/modules/network/src/include/lwipopts.h"
click node_lwip_hooks "https://github.com/zigembeddedgroup/microzig/blob/main/modules/network/src/include/arch/cc.h"
click node_freertos_api "https://github.com/zigembeddedgroup/microzig/blob/main/modules/freertos/include/freertos.h"
click node_irq_impl "https://github.com/zigembeddedgroup/microzig/blob/main/modules/freertos/src/picosdk_irq.c"
click node_sdk_stubs "https://github.com/zigembeddedgroup/microzig/blob/main/modules/freertos/src/picosdk_stubs.c"
click node_rp_registers "https://github.com/zigembeddedgroup/microzig/blob/main/port/raspberrypi/rp2xxx/src/bootroms/RP2040/shared/m0plus.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_libc_headers,node_assert_api,node_panic_api toneBlue
class node_lwip_facade,node_lwip_config,node_lwip_hooks toneAmber
class node_freertos_api,node_irq_impl,node_sdk_stubs,node_hardware_irq,node_spinlock_api toneMint
class node_rp_registers toneRose
class node_author toneIndigo
```

## Components

### C Runtime

- [Libc headers](https://github.com/zigembeddedgroup/microzig/tree/main/modules/foundation-libc/include): `modules/foundation-libc/include`
- [Assert API](https://github.com/zigembeddedgroup/microzig/blob/main/modules/foundation-libc/include/assert.h): `modules/foundation-libc/include/assert.h`
- [Libc API](https://github.com/zigembeddedgroup/microzig/blob/main/modules/foundation-libc/include/foundation/libc.h): `modules/foundation-libc/include/foundation/libc.h`

### Networking

- [lwIP facade](https://github.com/zigembeddedgroup/microzig/blob/main/modules/lwip/include/lwip.h): `modules/lwip/include/lwip.h`
- [lwIP options](https://github.com/zigembeddedgroup/microzig/blob/main/modules/network/src/include/lwipopts.h): `modules/network/src/include/lwipopts.h`
- [lwIP platform hooks](https://github.com/zigembeddedgroup/microzig/blob/main/modules/network/src/include/arch/cc.h): `modules/network/src/include/arch/cc.h`

### RTOS Support

- [FreeRTOS API](https://github.com/zigembeddedgroup/microzig/blob/main/modules/freertos/include/freertos.h): `modules/freertos/include/freertos.h`
- [IRQ support](https://github.com/zigembeddedgroup/microzig/blob/main/modules/freertos/src/picosdk_irq.c): `modules/freertos/src/picosdk_irq.c`
- [Pico SDK stubs](https://github.com/zigembeddedgroup/microzig/blob/main/modules/freertos/src/picosdk_stubs.c): `modules/freertos/src/picosdk_stubs.c`

### Hardware Support

- [RP2040 registers](https://github.com/zigembeddedgroup/microzig/blob/main/port/raspberrypi/rp2xxx/src/bootroms/RP2040/shared/m0plus.h): `port/raspberrypi/rp2xxx/src/bootroms/RP2040/shared/m0plus.h`

### Other components

- **Firmware author**
- **Hardware IRQ API**
- **Spinlock API**

## Connections

- Firmware author → Libc headers: uses
- Libc headers → Assert API: includes
- Firmware author → lwIP facade: uses
- lwIP facade → lwIP options: configured by
- lwIP facade → lwIP platform hooks: platform hooks
- Firmware author → FreeRTOS API: uses
- IRQ support → Hardware IRQ API: programs IRQs
- IRQ support → Spinlock API: locks handlers
- IRQ support → RP2040 registers: accesses NVIC
- Pico SDK stubs → FreeRTOS API: satisfies port refs
