# fagci/hawk5 architecture

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

## Overview

hawk5 is embedded firmware for a handheld radio. The principal workflow is user input selecting a radio app, which configures the radio or scans channels/frequencies, then presents status or measurements on the display. The tree also shows channel/VFO management, settings, and persistent storage. The excerpts confirm app dispatch, scan-to-radio/spectrum/loot interactions, and radio chip drivers; wiring for other listed app capabilities is inferred only at subsystem level and is not expanded into unsupported call chains.

Main entry points: [`src/apps/apps.c`](https://github.com/fagci/hawk5/blob/main/src/apps/apps.c) (App manager), [`src/radio.c`](https://github.com/fagci/hawk5/blob/main/src/radio.c) (Radio control), [`src/helper/scan.c`](https://github.com/fagci/hawk5/blob/main/src/helper/scan.c) (Scan engine), [`src/ui/spectrum.c`](https://github.com/fagci/hawk5/blob/main/src/ui/spectrum.c) (Spectrum view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Firmware runtime"]
  node_main["Startup<br/>[main.c]"]
  node_system["System runtime<br/>[system.c]"]
  node_scheduler["Scheduler<br/>[scheduler.c]"]
  node_appmgr["App manager<br/>[apps.c]"]
end

subgraph group_apps["Radio applications"]
  node_appscan["Scan apps<br/>[scaner.c]"]
  node_appband["Band scan<br/>[bandscan.c]"]
  node_appchannels["Channel apps<br/>[chlist.c]"]
  node_appvfo["VFO control<br/>[vfo1.c]"]
  node_appsettings["Settings UI<br/>[settings.c]"]
  node_spectrum["Spectrum view<br/>[spectrum.c]"]
end

subgraph group_domain["Radio domain"]
  node_radio["Radio control<br/>[radio.c]"]
  node_scan["Scan engine<br/>[scan.c]"]
  node_channels["Channel data<br/>[channels.c]"]
  node_bands["Band data<br/>[bands.c]"]
  node_loot["Signal log<br/>[lootlist.c]"]
  node_settings["Radio settings<br/>[settings.c]"]
  node_measurements["Measurements<br/>[measurements.c]"]
end

subgraph group_hardware["Device hardware"]
  node_graphics["UI graphics<br/>[graphics.c]"]
  node_statusline["Status line<br/>[statusline.c]"]
  node_keyboard["Keyboard<br/>[keyboard.c]"]
  node_display["LCD driver<br/>[st7565.c]"]
  node_bk4819["BK4819 radio<br/>[bk4819.c]"]
  node_si473x["SI473x receiver<br/>[si473x.c]"]
  node_eeprom[("EEPROM<br/>[eeprom.c]")]
  node_board["Board drivers<br/>[board.c]"]
end

node_user(("Radio user"))

node_main -->|"initializes"| node_board
node_main -->|"starts"| node_system
node_system -->|"runs"| node_scheduler
node_user -->|"presses keys"| node_keyboard
node_keyboard -->|"key events"| node_appmgr
node_appmgr -->|"dispatches"| node_appscan
node_appmgr -->|"dispatches"| node_appband
node_appmgr -->|"dispatches"| node_appchannels
node_appmgr -->|"dispatches"| node_appvfo
node_appmgr -->|"dispatches"| node_appsettings
node_appmgr -->|"sets text"| node_statusline
node_appmgr -->|"clears screen"| node_graphics
node_appscan -->|"uses"| node_scan
node_appband -->|"uses"| node_scan
node_scan -->|"tunes and measures"| node_radio
node_scan -->|"loads channels"| node_channels
node_scan -->|"uses band limits"| node_bands
node_scan -->|"updates signals"| node_loot
node_scan -->|"adds points"| node_spectrum
node_spectrum -->|"reads measurements"| node_measurements
node_spectrum -->|"draws graph"| node_graphics
node_appvfo -->|"configures VFO"| node_radio
node_appchannels -->|"manages channels"| node_channels
node_appsettings -->|"edits settings"| node_settings
node_radio -->|"reads settings"| node_settings
node_radio -->|"controls transceiver"| node_bk4819
node_radio -->|"controls receiver"| node_si473x
node_radio -->|"uses channel data"| node_channels
node_radio -->|"stores VFO data"| node_eeprom
node_graphics -->|"draws pixels"| node_display
node_board -->|"initializes"| node_keyboard
node_board -->|"initializes"| node_display

click node_main "https://github.com/fagci/hawk5/blob/main/src/main.c"
click node_system "https://github.com/fagci/hawk5/blob/main/src/system.c"
click node_scheduler "https://github.com/fagci/hawk5/blob/main/src/scheduler.c"
click node_appmgr "https://github.com/fagci/hawk5/blob/main/src/apps/apps.c"
click node_appscan "https://github.com/fagci/hawk5/blob/main/src/apps/scaner.c"
click node_appband "https://github.com/fagci/hawk5/blob/main/src/apps/bandscan.c"
click node_appchannels "https://github.com/fagci/hawk5/blob/main/src/apps/chlist.c"
click node_appvfo "https://github.com/fagci/hawk5/blob/main/src/apps/vfo1.c"
click node_appsettings "https://github.com/fagci/hawk5/blob/main/src/apps/settings.c"
click node_radio "https://github.com/fagci/hawk5/blob/main/src/radio.c"
click node_scan "https://github.com/fagci/hawk5/blob/main/src/helper/scan.c"
click node_channels "https://github.com/fagci/hawk5/blob/main/src/helper/channels.c"
click node_bands "https://github.com/fagci/hawk5/blob/main/src/helper/bands.c"
click node_loot "https://github.com/fagci/hawk5/blob/main/src/helper/lootlist.c"
click node_settings "https://github.com/fagci/hawk5/blob/main/src/settings.c"
click node_measurements "https://github.com/fagci/hawk5/blob/main/src/helper/measurements.c"
click node_spectrum "https://github.com/fagci/hawk5/blob/main/src/ui/spectrum.c"
click node_graphics "https://github.com/fagci/hawk5/blob/main/src/ui/graphics.c"
click node_statusline "https://github.com/fagci/hawk5/blob/main/src/ui/statusline.c"
click node_keyboard "https://github.com/fagci/hawk5/blob/main/src/driver/keyboard.c"
click node_display "https://github.com/fagci/hawk5/blob/main/src/driver/st7565.c"
click node_bk4819 "https://github.com/fagci/hawk5/blob/main/src/driver/bk4819.c"
click node_si473x "https://github.com/fagci/hawk5/blob/main/src/driver/si473x.c"
click node_eeprom "https://github.com/fagci/hawk5/blob/main/src/driver/eeprom.c"
click node_board "https://github.com/fagci/hawk5/blob/main/src/board.c"

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_main,node_system,node_scheduler,node_appmgr,node_user toneBlue
class node_appscan,node_appband,node_appchannels,node_appvfo,node_appsettings,node_spectrum toneAmber
class node_radio,node_scan,node_channels,node_bands,node_loot,node_settings,node_measurements toneMint
class node_graphics,node_statusline,node_keyboard,node_display,node_bk4819,node_si473x,node_eeprom,node_board toneRose
```

## Components

### Firmware runtime

- [Startup](https://github.com/fagci/hawk5/blob/main/src/main.c): `src/main.c`
- [System runtime](https://github.com/fagci/hawk5/blob/main/src/system.c): `src/system.c`
- [Scheduler](https://github.com/fagci/hawk5/blob/main/src/scheduler.c): `src/scheduler.c`
- [App manager](https://github.com/fagci/hawk5/blob/main/src/apps/apps.c): `src/apps/apps.c`

### Radio applications

- [Scan apps](https://github.com/fagci/hawk5/blob/main/src/apps/scaner.c): `src/apps/scaner.c`
- [Band scan](https://github.com/fagci/hawk5/blob/main/src/apps/bandscan.c): `src/apps/bandscan.c`
- [Channel apps](https://github.com/fagci/hawk5/blob/main/src/apps/chlist.c): `src/apps/chlist.c`
- [VFO control](https://github.com/fagci/hawk5/blob/main/src/apps/vfo1.c): `src/apps/vfo1.c`
- [Settings UI](https://github.com/fagci/hawk5/blob/main/src/apps/settings.c): `src/apps/settings.c`
- [Spectrum view](https://github.com/fagci/hawk5/blob/main/src/ui/spectrum.c): `src/ui/spectrum.c`

### Radio domain

- [Radio control](https://github.com/fagci/hawk5/blob/main/src/radio.c): `src/radio.c`
- [Scan engine](https://github.com/fagci/hawk5/blob/main/src/helper/scan.c): `src/helper/scan.c`
- [Channel data](https://github.com/fagci/hawk5/blob/main/src/helper/channels.c): `src/helper/channels.c`
- [Band data](https://github.com/fagci/hawk5/blob/main/src/helper/bands.c): `src/helper/bands.c`
- [Signal log](https://github.com/fagci/hawk5/blob/main/src/helper/lootlist.c): `src/helper/lootlist.c`
- [Radio settings](https://github.com/fagci/hawk5/blob/main/src/settings.c): `src/settings.c`
- [Measurements](https://github.com/fagci/hawk5/blob/main/src/helper/measurements.c): `src/helper/measurements.c`

### Device hardware

- [UI graphics](https://github.com/fagci/hawk5/blob/main/src/ui/graphics.c): `src/ui/graphics.c`
- [Status line](https://github.com/fagci/hawk5/blob/main/src/ui/statusline.c): `src/ui/statusline.c`
- [Keyboard](https://github.com/fagci/hawk5/blob/main/src/driver/keyboard.c): `src/driver/keyboard.c`
- [LCD driver](https://github.com/fagci/hawk5/blob/main/src/driver/st7565.c): `src/driver/st7565.c`
- [BK4819 radio](https://github.com/fagci/hawk5/blob/main/src/driver/bk4819.c): `src/driver/bk4819.c`
- [SI473x receiver](https://github.com/fagci/hawk5/blob/main/src/driver/si473x.c): `src/driver/si473x.c`
- [EEPROM](https://github.com/fagci/hawk5/blob/main/src/driver/eeprom.c): `src/driver/eeprom.c`
- [Board drivers](https://github.com/fagci/hawk5/blob/main/src/board.c): `src/board.c`

### Other components

- **Radio user**

## Connections

- Startup → Board drivers: initializes
- Startup → System runtime: starts
- System runtime → Scheduler: runs
- Radio user → Keyboard: presses keys
- Keyboard → App manager: key events
- App manager → Scan apps: dispatches
- App manager → Band scan: dispatches
- App manager → Channel apps: dispatches
- App manager → VFO control: dispatches
- App manager → Settings UI: dispatches
- App manager → Status line: sets text
- App manager → UI graphics: clears screen
- Scan apps → Scan engine: uses
- Band scan → Scan engine: uses
- Scan engine → Radio control: tunes and measures
- Scan engine → Channel data: loads channels
- Scan engine → Band data: uses band limits
- Scan engine → Signal log: updates signals
- Scan engine → Spectrum view: adds points
- Spectrum view → Measurements: reads measurements
- Spectrum view → UI graphics: draws graph
- VFO control → Radio control: configures VFO
- Channel apps → Channel data: manages channels
- Settings UI → Radio settings: edits settings
- Radio control → Radio settings: reads settings
- Radio control → BK4819 radio: controls transceiver
- Radio control → SI473x receiver: controls receiver
- Radio control → Channel data: uses channel data
- Radio control → EEPROM: stores VFO data
- UI graphics → LCD driver: draws pixels
- Board drivers → Keyboard: initializes
- Board drivers → LCD driver: initializes
