# bve/openosc architecture

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

- Interactive diagram: https://gitdiagram.com/bve/openosc
- Repository: https://github.com/bve/openosc

## Overview

OpenOSC is embedded firmware for handheld oscilloscope-multimeters, with oscilloscope, multimeter, signal-generator, protocol-decoder and Bode-analysis capabilities, plus a recovery bootloader. The primary runtime begins in the application controller, which initializes instrument data and serves local UI and remote-control sessions; acquisition and measurement results feed instrument functions. Recovery provides a separate boot-time path for firmware updates and storage maintenance. The excerpts show only selected wiring, so unsampled feature relationships are left out rather than inferred from filenames.

Main entry points: [`src/application/controller.cpp`](https://github.com/bve/openosc/blob/main/src/application/controller.cpp) (Application controller), [`src/recovery/controller.cpp`](https://github.com/bve/openosc/blob/main/src/recovery/controller.cpp) (Recovery controller), [`src/scpi/engine.cpp`](https://github.com/bve/openosc/blob/main/src/scpi/engine.cpp) (SCPI engine), [`src/main.cpp`](https://github.com/bve/openosc/blob/main/src/main.cpp) (Recovery startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Instrument application"]
  node_app_controller["Application controller<br/>[controller.cpp]"]
  node_data_access["Instrument data access<br/>[data_access.hpp]"]
end

subgraph group_measurement["Measurement capabilities"]
  node_scope_capture["Scope acquisition<br/>[capture.cpp]"]
  node_scope_analysis["Signal analysis<br/>[analysis.hpp]"]
  node_trigger_level["Trigger levels<br/>[trigger_level.hpp]"]
  node_dmm_session["Multimeter session<br/>[session.cpp]"]
  node_dmm_functions["Meter functions<br/>[function.hpp]"]
  node_generator["Signal generator<br/>[output.cpp]"]
  node_decoder["Protocol decoder<br/>[decoder.hpp]"]
  node_bode["Bode analysis<br/>[bode_analysis.cpp]"]
end

subgraph group_interface["User and remote interfaces"]
  node_ui["Instrument UI"]
  node_scpi["SCPI engine<br/>[engine.cpp]"]
  node_usb["USB instrument transport<br/>[class.cpp]"]
end

subgraph group_persistence["Data and calibration"]
  node_session_log["Session logging<br/>[session_log.cpp]"]
  node_storage[("Storage layout<br/>[layout.hpp]")]
  node_calibration["Calibration profiles<br/>[data.cpp]"]
end

subgraph group_platform["Platform and recovery"]
  node_recovery_entry["Recovery startup<br/>[main.cpp]"]
  node_recovery["Recovery controller<br/>[controller.cpp]"]
  node_update["Firmware update"]
  node_board["Board services<br/>[board.hpp]"]
  node_input["Input service<br/>[service.cpp]"]
  node_watchdog["Watchdog<br/>[watchdog.hpp]"]
end

node_operator(("Instrument user"))

node_operator -->|"uses instruments"| node_app_controller
node_app_controller -->|"initializes data"| node_data_access
node_app_controller -->|"creates engines"| node_scpi
node_app_controller -->|"enables input"| node_input
node_data_access -.->|"captures samples"| node_scope_capture
node_scope_capture -.->|"analyzes samples"| node_scope_analysis
node_scope_analysis -.->|"uses trigger settings"| node_trigger_level
node_app_controller -.->|"owns meter session"| node_dmm_session
node_dmm_session -->|"uses functions"| node_dmm_functions
node_app_controller -->|"restores output"| node_generator
node_app_controller -->|"steps decoder"| node_decoder
node_app_controller -.->|"presents instruments"| node_ui
node_scpi -.->|"serves USB session"| node_usb
node_app_controller -.->|"manages sessions"| node_session_log
node_app_controller -.->|"loads calibration"| node_calibration
node_recovery_entry -->|"starts recovery"| node_recovery
node_recovery -->|"inspects and installs"| node_update
node_recovery -->|"uses layout"| node_storage
node_recovery_entry -->|"initializes board"| node_board
node_recovery -->|"feeds watchdog"| node_watchdog
node_operator -.->|"views readings"| node_ui
node_operator -.->|"sends commands"| node_scpi

click node_app_controller "https://github.com/bve/openosc/blob/main/src/application/controller.cpp"
click node_data_access "https://github.com/bve/openosc/blob/main/include/openosc/instrument/data_access.hpp"
click node_scope_capture "https://github.com/bve/openosc/blob/main/src/acquisition/capture.cpp"
click node_scope_analysis "https://github.com/bve/openosc/blob/main/include/openosc/acquisition/analysis.hpp"
click node_trigger_level "https://github.com/bve/openosc/blob/main/include/openosc/acquisition/trigger_level.hpp"
click node_dmm_session "https://github.com/bve/openosc/blob/main/src/measurement/dmm/session.cpp"
click node_dmm_functions "https://github.com/bve/openosc/blob/main/include/openosc/measurement/dmm/function.hpp"
click node_generator "https://github.com/bve/openosc/blob/main/src/generator/output.cpp"
click node_decoder "https://github.com/bve/openosc/blob/main/include/openosc/decode/decoder.hpp"
click node_bode "https://github.com/bve/openosc/blob/main/src/acquisition/bode_analysis.cpp"
click node_ui "https://github.com/bve/openosc/blob/main/src/ui/application_view.cpp"
click node_scpi "https://github.com/bve/openosc/blob/main/src/scpi/engine.cpp"
click node_usb "https://github.com/bve/openosc/blob/main/src/usb/instrument/class.cpp"
click node_session_log "https://github.com/bve/openosc/blob/main/src/data/session_log.cpp"
click node_storage "https://github.com/bve/openosc/blob/main/include/openosc/storage/layout.hpp"
click node_calibration "https://github.com/bve/openosc/blob/main/src/calibration/data.cpp"
click node_recovery_entry "https://github.com/bve/openosc/blob/main/src/main.cpp"
click node_recovery "https://github.com/bve/openosc/blob/main/src/recovery/controller.cpp"
click node_update "https://github.com/bve/openosc/blob/main/include/openosc/update/update_operation.hpp"
click node_board "https://github.com/bve/openosc/blob/main/include/openosc/platform/board.hpp"
click node_input "https://github.com/bve/openosc/blob/main/src/input/service.cpp"
click node_watchdog "https://github.com/bve/openosc/blob/main/include/openosc/platform/watchdog.hpp"

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_app_controller,node_data_access,node_operator toneBlue
class node_scope_capture,node_scope_analysis,node_trigger_level,node_dmm_session,node_dmm_functions,node_generator,node_decoder,node_bode toneAmber
class node_ui,node_scpi,node_usb toneMint
class node_session_log,node_storage,node_calibration toneRose
class node_recovery_entry,node_recovery,node_update,node_board,node_input,node_watchdog toneIndigo
```

## Components

### Instrument application

- [Application controller](https://github.com/bve/openosc/blob/main/src/application/controller.cpp): `src/application/controller.cpp`
- [Instrument data access](https://github.com/bve/openosc/blob/main/include/openosc/instrument/data_access.hpp): `include/openosc/instrument/data_access.hpp`

### Measurement capabilities

- [Scope acquisition](https://github.com/bve/openosc/blob/main/src/acquisition/capture.cpp): `src/acquisition/capture.cpp`
- [Signal analysis](https://github.com/bve/openosc/blob/main/include/openosc/acquisition/analysis.hpp): `include/openosc/acquisition/analysis.hpp`
- [Trigger levels](https://github.com/bve/openosc/blob/main/include/openosc/acquisition/trigger_level.hpp): `include/openosc/acquisition/trigger_level.hpp`
- [Multimeter session](https://github.com/bve/openosc/blob/main/src/measurement/dmm/session.cpp): `src/measurement/dmm/session.cpp`
- [Meter functions](https://github.com/bve/openosc/blob/main/include/openosc/measurement/dmm/function.hpp): `include/openosc/measurement/dmm/function.hpp`
- [Signal generator](https://github.com/bve/openosc/blob/main/src/generator/output.cpp): `src/generator/output.cpp`
- [Protocol decoder](https://github.com/bve/openosc/blob/main/include/openosc/decode/decoder.hpp): `include/openosc/decode/decoder.hpp`
- [Bode analysis](https://github.com/bve/openosc/blob/main/src/acquisition/bode_analysis.cpp): `src/acquisition/bode_analysis.cpp`

### User and remote interfaces

- [Instrument UI](https://github.com/bve/openosc/blob/main/src/ui/application_view.cpp): `src/ui/application_view.cpp`
- [SCPI engine](https://github.com/bve/openosc/blob/main/src/scpi/engine.cpp): `src/scpi/engine.cpp`
- [USB instrument transport](https://github.com/bve/openosc/blob/main/src/usb/instrument/class.cpp): `src/usb/instrument/class.cpp`

### Data and calibration

- [Session logging](https://github.com/bve/openosc/blob/main/src/data/session_log.cpp): `src/data/session_log.cpp`
- [Storage layout](https://github.com/bve/openosc/blob/main/include/openosc/storage/layout.hpp): `include/openosc/storage/layout.hpp`
- [Calibration profiles](https://github.com/bve/openosc/blob/main/src/calibration/data.cpp): `src/calibration/data.cpp`

### Platform and recovery

- [Recovery startup](https://github.com/bve/openosc/blob/main/src/main.cpp): `src/main.cpp`
- [Recovery controller](https://github.com/bve/openosc/blob/main/src/recovery/controller.cpp): `src/recovery/controller.cpp`
- [Firmware update](https://github.com/bve/openosc/blob/main/include/openosc/update/update_operation.hpp): `include/openosc/update/update_operation.hpp`
- [Board services](https://github.com/bve/openosc/blob/main/include/openosc/platform/board.hpp): `include/openosc/platform/board.hpp`
- [Input service](https://github.com/bve/openosc/blob/main/src/input/service.cpp): `src/input/service.cpp`
- [Watchdog](https://github.com/bve/openosc/blob/main/include/openosc/platform/watchdog.hpp): `include/openosc/platform/watchdog.hpp`

### Other components

- **Instrument user**

## Connections

- Instrument user → Application controller: uses instruments (evidence: `README.md`)
- Application controller → Instrument data access: initializes data (evidence: `src/application/controller.cpp`)
- Application controller → SCPI engine: creates engines (evidence: `src/application/controller.cpp`)
- Application controller → Input service: enables input (evidence: `src/application/controller.cpp`)
- Instrument data access → Scope acquisition: captures samples
- Scope acquisition → Signal analysis: analyzes samples
- Signal analysis → Trigger levels: uses trigger settings
- Application controller → Multimeter session: owns meter session
- Multimeter session → Meter functions: uses functions (evidence: `src/measurement/dmm/session.cpp`)
- Application controller → Signal generator: restores output (evidence: `src/application/controller.cpp`)
- Application controller → Protocol decoder: steps decoder (evidence: `src/application/controller.cpp`)
- Application controller → Instrument UI: presents instruments
- SCPI engine → USB instrument transport: serves USB session
- Application controller → Session logging: manages sessions
- Application controller → Calibration profiles: loads calibration
- Recovery startup → Recovery controller: starts recovery (evidence: `src/main.cpp`)
- Recovery controller → Firmware update: inspects and installs
- Recovery controller → Storage layout: uses layout (evidence: `src/recovery/controller.cpp`)
- Recovery startup → Board services: initializes board (evidence: `src/main.cpp`)
- Recovery controller → Watchdog: feeds watchdog (evidence: `src/recovery/controller.cpp`)
- Instrument user → Instrument UI: views readings
- Instrument user → SCPI engine: sends commands (evidence: `README.md`)
