# amiruddinsiddiqui/digital_oscilloscope architecture

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

- Interactive diagram: https://gitdiagram.com/amiruddinsiddiqui/digital_oscilloscope
- Repository: https://github.com/amiruddinsiddiqui/digital_oscilloscope

## Overview

This is an STM32F401RE digital oscilloscope: button input selects a channel, timer-triggered ADC and DMA capture a 240-sample frame, and the application sends that frame to a PC over UART and draws it on an ILI9341 display. The graph also shows debounce timing, status LEDs, and the Python visualization client. Application orchestration and display/SPI calls are visible in excerpts; acquisition, UART, timer, LED, and Python implementation details are represented from the README and source index, not inferred beyond their documented roles.

Main entry points: [`Core/App/app.c`](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/App/app.c) (Oscilloscope app), [`Core/Custom_Drivers/adc.c`](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/adc.c) (ADC channel), [`Core/Custom_Drivers/exti.c`](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/exti.c) (Button events), [`Core/Custom_Drivers/dma.c`](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/dma.c) (DMA capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Application and controls"]
  node_main["Firmware entry<br/>[main.c]"]
  node_app["Oscilloscope app<br/>[app.c]"]
end

subgraph group_capture["Signal acquisition"]
  node_adc["ADC channel<br/>[adc.c]"]
  node_sample_timer["Sampling timer<br/>[timer.c]"]
  node_dma["DMA capture<br/>[dma.c]"]
  node_frame[("240-sample frame<br/>[dma.c]")]
end

subgraph group_outputs["Frame outputs"]
  node_uart["UART transmitter<br/>[uart.c]"]
  node_python["PC waveform viewer<br/>[waveform.py]"]
  node_display["ILI9341 waveform<br/>[ili9341.c]"]
end

subgraph group_platform["Peripheral drivers"]
  node_button_irq["Button events<br/>[exti.c]"]
  node_tick["Debounce tick<br/>[timer.c]"]
  node_led["Status LEDs<br/>[led.c]"]
  node_spi["SPI2 driver<br/>[spi.c]"]
end

node_operator(("Button operator"))
node_signal(("Analog signal"))
node_tft["ILI9341 TFT"]
node_pc(("PC"))

node_main -->|"starts"| node_app
node_app -->|"reads events"| node_button_irq
node_button_irq -->|"sets button event"| node_app
node_app -->|"initializes"| node_sample_timer
node_app -->|"initializes"| node_tick
node_app -->|"selects channel"| node_adc
node_app -->|"starts and stops"| node_dma
node_app -->|"updates indicators"| node_led
node_tick -->|"provides debounce time"| node_button_irq
node_sample_timer -->|"triggers conversions"| node_adc
node_signal -->|"supplies input"| node_adc
node_adc -->|"feeds conversions"| node_dma
node_dma -->|"writes samples"| node_frame
node_app -->|"reads completed frame"| node_frame
node_app -->|"sends frame"| node_uart
node_app -->|"draws waveform"| node_display
node_display -->|"sends display bytes"| node_spi
node_spi -->|"communicates"| node_tft
node_uart -->|"transmits samples"| node_pc
node_pc -->|"visualizes waveform"| node_python
node_operator -->|"presses buttons"| node_button_irq

click node_main "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Src/main.c"
click node_app "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/App/app.c"
click node_button_irq "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/exti.c"
click node_tick "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/timer.c"
click node_led "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/App/led.c"
click node_adc "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/adc.c"
click node_sample_timer "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/timer.c"
click node_dma "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/dma.c"
click node_frame "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/dma.c"
click node_uart "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/uart.c"
click node_python "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/utils/waveform.py"
click node_display "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/ili9341.c"
click node_spi "https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/spi.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_app toneBlue
class node_adc,node_sample_timer,node_dma,node_frame toneAmber
class node_uart,node_python,node_display toneMint
class node_button_irq,node_tick,node_led,node_spi toneRose
class node_operator,node_signal,node_tft,node_pc toneIndigo
```

## Components

### Application and controls

- [Firmware entry](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Src/main.c): `Core/Src/main.c`
- [Oscilloscope app](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/App/app.c): `Core/App/app.c`

### Signal acquisition

- [ADC channel](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/adc.c): `Core/Custom_Drivers/adc.c`
- [Sampling timer](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/timer.c): `Core/Custom_Drivers/timer.c`
- [DMA capture](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/dma.c): `Core/Custom_Drivers/dma.c`
- [240-sample frame](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/dma.c): `Core/Custom_Drivers/dma.c`

### Frame outputs

- [UART transmitter](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/uart.c): `Core/Custom_Drivers/uart.c`
- [PC waveform viewer](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/utils/waveform.py): `utils/waveform.py`
- [ILI9341 waveform](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/ili9341.c): `Core/Custom_Drivers/ili9341.c`

### Peripheral drivers

- [Button events](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/exti.c): `Core/Custom_Drivers/exti.c`
- [Debounce tick](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/timer.c): `Core/Custom_Drivers/timer.c`
- [Status LEDs](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/App/led.c): `Core/App/led.c`
- [SPI2 driver](https://github.com/amiruddinsiddiqui/digital_oscilloscope/blob/main/Core/Custom_Drivers/spi.c): `Core/Custom_Drivers/spi.c`

### Other components

- **Button operator**
- **Analog signal**
- **ILI9341 TFT**
- **PC**

## Connections

- Firmware entry → Oscilloscope app: starts (evidence: `Core/Src/main.c`)
- Oscilloscope app → Button events: reads events (evidence: `Core/App/app.c`)
- Button events → Oscilloscope app: sets button event (evidence: `Core/Custom_Drivers/exti.c`)
- Oscilloscope app → Sampling timer: initializes (evidence: `Core/App/app.c`)
- Oscilloscope app → Debounce tick: initializes (evidence: `Core/App/app.c`)
- Oscilloscope app → ADC channel: selects channel (evidence: `Core/App/app.c`)
- Oscilloscope app → DMA capture: starts and stops (evidence: `Core/App/app.c`)
- Oscilloscope app → Status LEDs: updates indicators (evidence: `Core/App/app.c`)
- Debounce tick → Button events: provides debounce time (evidence: `readme.md`)
- Sampling timer → ADC channel: triggers conversions (evidence: `readme.md`)
- Analog signal → ADC channel: supplies input (evidence: `readme.md`)
- ADC channel → DMA capture: feeds conversions (evidence: `readme.md`)
- DMA capture → 240-sample frame: writes samples (evidence: `readme.md`)
- Oscilloscope app → 240-sample frame: reads completed frame (evidence: `Core/App/app.c`)
- Oscilloscope app → UART transmitter: sends frame (evidence: `Core/App/app.c`)
- Oscilloscope app → ILI9341 waveform: draws waveform (evidence: `Core/App/app.c`)
- ILI9341 waveform → SPI2 driver: sends display bytes (evidence: `Core/Custom_Drivers/ili9341.c`)
- SPI2 driver → ILI9341 TFT: communicates (evidence: `readme.md`)
- UART transmitter → PC: transmits samples (evidence: `readme.md`)
- PC → PC waveform viewer: visualizes waveform (evidence: `readme.md`)
- Button operator → Button events: presses buttons (evidence: `readme.md`)
