# halbeshuhn/cardputer-webradio architecture

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

- Interactive diagram: https://gitdiagram.com/halbeshuhn/cardputer-webradio
- Repository: https://github.com/halbeshuhn/cardputer-webradio

## Overview

Cardputer WebRadio is firmware for finding and playing internet radio stations directly on an M5Stack Cardputer Adv. The user searches the online directory or selects a saved station, then the firmware resolves the stream, decodes it, and presents audio and playback information. The README also documents Wi-Fi setup, playlists, logos, equalization, visualizers, sleep and charging screens. The tree lacks the main sketch, so those firmware responsibilities use the existing enclosing source directory; their internal wiring is not inferred. AudioCompat and Wi-Fi behavior are represented from sampled headers.

Main entry points: [`v3.4.0/M5Cardputer_WebRadio`](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio) (Radio firmware), [`v3.4.0/M5Cardputer_WebRadio/AudioCompat.h`](https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/AudioCompat.h) (Audio decode and processing), [`v3.4.0/M5Cardputer_WebRadio/CardWifiSetup.h`](https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/CardWifiSetup.h) (Wi-Fi setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Device interaction"]
  node_firmware["Radio firmware"]
  node_display["Screens and controls"]
  node_wifi["Wi-Fi setup<br/>[CardWifiSetup.h]"]
  node_sleep["Sleep and charge screens"]
  node_fonts["Multiscript text"]
end

subgraph group_station["Station selection"]
  node_directory["Station directory"]
  node_search["Country and station search"]
  node_playlist["Playlist resolution"]
  node_logos["Station logos"]
  node_radio["Radio-browser service"]
end

subgraph group_playback["Stream playback"]
  node_stream["Station stream"]
  node_audio["Audio decode and processing<br/>[AudioCompat.h]"]
  node_speaker["Cardputer audio output"]
  node_visualizers["VU and spectrum"]
  node_equalizer["Five-band equalizer<br/>[AudioCompat.h]"]
end

subgraph group_state["Device state"]
  node_saved["Saved stations"]
  node_sd[("microSD card")]
  node_preferences[("Wi-Fi preferences<br/>[CardWifiSetup.h]")]
end

node_listener(("Listener"))

node_listener -->|"operates"| node_firmware
node_firmware -->|"renders and handles input"| node_display
node_firmware -->|"connects Wi-Fi"| node_wifi
node_wifi -->|"reads and writes"| node_preferences
node_firmware -->|"runs searches"| node_search
node_search -->|"queries directory"| node_radio
node_firmware -->|"loads and saves"| node_saved
node_saved -->|"persists on"| node_sd
node_firmware -->|"resolves station URL"| node_playlist
node_firmware -->|"opens station stream"| node_stream
node_playlist -->|"provides resolved URL"| node_stream
node_stream -->|"supplies audio data"| node_audio
node_firmware -->|"controls playback"| node_audio
node_audio -->|"outputs audio"| node_speaker
node_audio -->|"processes samples with"| node_equalizer
node_audio -->|"provides level data"| node_visualizers
node_firmware -->|"fetches station logo"| node_logos
node_logos -.->|"looks up station address"| node_radio
node_logos -->|"caches logo files"| node_sd
node_firmware -->|"manages timers and charging"| node_sleep
node_firmware -->|"renders localized text"| node_fonts

click node_firmware "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"
click node_display "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"
click node_wifi "https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/CardWifiSetup.h"
click node_directory "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"
click node_search "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"
click node_playlist "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"
click node_saved "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"
click node_logos "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"
click node_audio "https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/AudioCompat.h"
click node_visualizers "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"
click node_equalizer "https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/AudioCompat.h"
click node_preferences "https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/CardWifiSetup.h"
click node_sleep "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"
click node_fonts "https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio"

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_firmware,node_display,node_wifi,node_sleep,node_fonts toneBlue
class node_directory,node_search,node_playlist,node_logos,node_radio toneAmber
class node_stream,node_audio,node_speaker,node_visualizers,node_equalizer toneMint
class node_saved,node_sd,node_preferences toneRose
class node_listener toneIndigo
```

## Components

### Device interaction

- [Radio firmware](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`
- [Screens and controls](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`
- [Wi-Fi setup](https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/CardWifiSetup.h): `v3.4.0/M5Cardputer_WebRadio/CardWifiSetup.h`
- [Sleep and charge screens](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`
- [Multiscript text](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`

### Station selection

- [Station directory](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`
- [Country and station search](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`
- [Playlist resolution](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`
- [Station logos](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`
- **Radio-browser service**

### Stream playback

- **Station stream**
- [Audio decode and processing](https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/AudioCompat.h): `v3.4.0/M5Cardputer_WebRadio/AudioCompat.h`
- **Cardputer audio output**
- [VU and spectrum](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`
- [Five-band equalizer](https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/AudioCompat.h): `v3.4.0/M5Cardputer_WebRadio/AudioCompat.h`

### Device state

- [Saved stations](https://github.com/halbeshuhn/cardputer-webradio/tree/main/v3.4.0/M5Cardputer_WebRadio): `v3.4.0/M5Cardputer_WebRadio`
- **microSD card**
- [Wi-Fi preferences](https://github.com/halbeshuhn/cardputer-webradio/blob/main/v3.4.0/M5Cardputer_WebRadio/CardWifiSetup.h): `v3.4.0/M5Cardputer_WebRadio/CardWifiSetup.h`

### Other components

- **Listener**

## Connections

- Listener → Radio firmware: operates
- Radio firmware → Screens and controls: renders and handles input
- Radio firmware → Wi-Fi setup: connects Wi-Fi
- Wi-Fi setup → Wi-Fi preferences: reads and writes
- Radio firmware → Country and station search: runs searches
- Country and station search → Radio-browser service: queries directory
- Radio firmware → Saved stations: loads and saves
- Saved stations → microSD card: persists on
- Radio firmware → Playlist resolution: resolves station URL
- Radio firmware → Station stream: opens station stream
- Playlist resolution → Station stream: provides resolved URL
- Station stream → Audio decode and processing: supplies audio data
- Radio firmware → Audio decode and processing: controls playback
- Audio decode and processing → Cardputer audio output: outputs audio
- Audio decode and processing → Five-band equalizer: processes samples with
- Audio decode and processing → VU and spectrum: provides level data
- Radio firmware → Station logos: fetches station logo
- Station logos → Radio-browser service: looks up station address
- Station logos → microSD card: caches logo files
- Radio firmware → Sleep and charge screens: manages timers and charging
- Radio firmware → Multiscript text: renders localized text
