# j4spr/rustberrypi architecture

> Architecture diagram of the GitHub repository j4spr/rustberrypi, 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/j4spr/rustberrypi
- Repository: https://github.com/j4spr/rustberrypi

## Overview

RustBerrry Pi is a bare-metal Raspberry Pi program that configures GPIO pin 21 as an output, then repeatedly sets and clears it with busy-wait delays to blink an LED. The runtime implementation is concentrated in `src/main.rs`; the register interactions shown are explicit there. The repository does not document additional runtime subsystems.

Main entry points: [`src/main.rs`](https://github.com/j4spr/rustberrypi/blob/master/src/main.rs) (Entry loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_boot(("Pi boot"))
node_entry["Entry loop<br/>[main.rs]"]
node_configure["Configure pin<br/>[main.rs]"]
node_turn_on["Set pin<br/>[main.rs]"]
node_turn_off["Clear pin<br/>[main.rs]"]
node_wait["Busy wait<br/>[main.rs]"]
node_gpio{{"GPIO registers / LED"}}

node_boot -->|"enters"| node_entry
node_entry -->|"calls"| node_configure
node_entry -->|"calls"| node_turn_on
node_entry -->|"calls"| node_wait
node_entry -->|"calls"| node_turn_off
node_configure -->|"reads/writes"| node_gpio
node_turn_on -->|"reads/writes"| node_gpio
node_turn_off -->|"reads/writes"| node_gpio

click node_entry "https://github.com/j4spr/rustberrypi/blob/master/src/main.rs"
click node_configure "https://github.com/j4spr/rustberrypi/blob/master/src/main.rs"
click node_turn_on "https://github.com/j4spr/rustberrypi/blob/master/src/main.rs"
click node_turn_off "https://github.com/j4spr/rustberrypi/blob/master/src/main.rs"
click node_wait "https://github.com/j4spr/rustberrypi/blob/master/src/main.rs"

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_boot,node_gpio toneIndigo
class node_entry,node_configure,node_turn_on,node_turn_off,node_wait toneTeal
```

## Components

### Other components

- **Pi boot**
- [Entry loop](https://github.com/j4spr/rustberrypi/blob/master/src/main.rs): `src/main.rs`
- [Configure pin](https://github.com/j4spr/rustberrypi/blob/master/src/main.rs): `src/main.rs`
- [Set pin](https://github.com/j4spr/rustberrypi/blob/master/src/main.rs): `src/main.rs`
- [Clear pin](https://github.com/j4spr/rustberrypi/blob/master/src/main.rs): `src/main.rs`
- [Busy wait](https://github.com/j4spr/rustberrypi/blob/master/src/main.rs): `src/main.rs`
- **GPIO registers / LED**

## Connections

- Pi boot → Entry loop: enters
- Entry loop → Configure pin: calls
- Entry loop → Set pin: calls
- Entry loop → Busy wait: calls
- Entry loop → Clear pin: calls
- Configure pin → GPIO registers / LED: reads/writes
- Set pin → GPIO registers / LED: reads/writes
- Clear pin → GPIO registers / LED: reads/writes
