# aasaialangaram/python-lin-diagnostic-tool architecture

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

- Interactive diagram: https://gitdiagram.com/aasaialangaram/python-lin-diagnostic-tool
- Repository: https://github.com/aasaialangaram/python-lin-diagnostic-tool

## Overview

This repository is a Raspberry Pi LIN diagnostic/analyzer prototype, with separate PyQt exercises rather than one integrated application. The documented core workflow repeatedly sends a master request, then requests and prints a slave response; the driver handles LIN signaling, serial transfer, and checksum work. The request-form and LED GUIs are separate prototypes: the sampled request form only prints entered values, and the LED GUI controls GPIO. The README documents ECU diagnostics and the LIN hardware setup. Connections are limited to relationships shown in sampled source or explicitly documented; the many other Qt exercises are not mapped individually.

Main entry points: [`PyLinDriver.py`](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLinDriver.py) (LIN driver), [`PyLINTask.py`](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLINTask.py) (LIN task loop), [`QT Manual Exercise/Pyqt_LED control.py`](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/Pyqt_LED%20control.py) (LED control GUI), [`QT Manual Exercise/led gui.py`](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/led%20gui.py) (Blink thread)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Diagnostic workflow"]
  node_task["LIN task loop<br/>[PyLINTask.py]"]
end

subgraph group_io["LIN hardware I/O"]
  node_driver["LIN driver<br/>[PyLinDriver.py]"]
  node_header["Header signaling<br/>[PyLinDriver.py]"]
  node_frame["Master frame data<br/>[PyLinDriver.py]"]
  node_checksum["Checksum calculation<br/>[PyLinDriver.py]"]
end

subgraph group_prototypes["GUI prototypes"]
  node_request_ui["LIN request form"]
  node_tab_ui["Diagnostic tab prototype<br/>[Pyqt_Tab1.py]"]
  node_led_ui["LED control GUI"]
  node_led_thread["Blink thread<br/>[led gui.py]"]
end

node_user(("Operator"))
node_uart{{"Pi UART"}}
node_gpio{{"Pi GPIO"}}
node_transceiver{{"LIN transceiver"}}
node_ecu{{"Target ECU"}}

node_user -.->|"starts"| node_task
node_task -->|"calls"| node_driver
node_task -->|"prints response from"| node_driver
node_driver -->|"delegates"| node_header
node_driver -->|"delegates"| node_frame
node_frame -->|"calculates with"| node_checksum
node_header -->|"toggles"| node_gpio
node_header -->|"writes header to"| node_uart
node_frame -->|"writes frame to"| node_uart
node_driver -->|"reads response from"| node_uart
node_uart -.->|"connects through"| node_transceiver
node_transceiver -.->|"communicates with"| node_ecu
node_user -.->|"enters request"| node_request_ui
node_user -.->|"uses"| node_tab_ui
node_user -.->|"controls"| node_led_ui
node_led_ui -->|"sets output"| node_gpio
node_led_thread -->|"toggles output"| node_gpio

click node_task "https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLINTask.py"
click node_driver "https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLinDriver.py"
click node_header "https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLinDriver.py"
click node_frame "https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLinDriver.py"
click node_checksum "https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLinDriver.py"
click node_request_ui "https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/Pyqt_LIN_Master_Request.py"
click node_tab_ui "https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/Pyqt_Tab1.py"
click node_led_ui "https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/Pyqt_LED%20control.py"
click node_led_thread "https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/led%20gui.py"

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_task toneBlue
class node_driver,node_header,node_frame,node_checksum toneAmber
class node_request_ui,node_tab_ui,node_led_ui,node_led_thread toneMint
class node_user,node_uart,node_gpio,node_transceiver,node_ecu toneIndigo
```

## Components

### Diagnostic workflow

- [LIN task loop](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLINTask.py): `PyLINTask.py`

### LIN hardware I/O

- [LIN driver](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLinDriver.py): `PyLinDriver.py`
- [Header signaling](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLinDriver.py): `PyLinDriver.py`
- [Master frame data](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLinDriver.py): `PyLinDriver.py`
- [Checksum calculation](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/PyLinDriver.py): `PyLinDriver.py`

### GUI prototypes

- [LIN request form](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/Pyqt_LIN_Master_Request.py): `QT Manual Exercise/Pyqt_LIN_Master_Request.py`
- [Diagnostic tab prototype](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/Pyqt_Tab1.py): `QT Manual Exercise/Pyqt_Tab1.py`
- [LED control GUI](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/Pyqt_LED%20control.py): `QT Manual Exercise/Pyqt_LED control.py`
- [Blink thread](https://github.com/aasaialangaram/python-lin-diagnostic-tool/blob/master/QT%20Manual%20Exercise/led%20gui.py): `QT Manual Exercise/led gui.py`

### Other components

- **Operator**
- **Pi UART**
- **Pi GPIO**
- **LIN transceiver**
- **Target ECU**

## Connections

- Operator → LIN task loop: starts
- LIN task loop → LIN driver: calls (evidence: `PyLINTask.py`)
- LIN task loop → LIN driver: prints response from (evidence: `PyLINTask.py`)
- LIN driver → Header signaling: delegates (evidence: `PyLinDriver.py`)
- LIN driver → Master frame data: delegates (evidence: `PyLinDriver.py`)
- Master frame data → Checksum calculation: calculates with (evidence: `PyLinDriver.py`)
- Header signaling → Pi GPIO: toggles (evidence: `PyLinDriver.py`)
- Header signaling → Pi UART: writes header to (evidence: `PyLinDriver.py`)
- Master frame data → Pi UART: writes frame to (evidence: `PyLinDriver.py`)
- LIN driver → Pi UART: reads response from (evidence: `PyLinDriver.py`)
- Pi UART → LIN transceiver: connects through
- LIN transceiver → Target ECU: communicates with
- Operator → LIN request form: enters request
- Operator → Diagnostic tab prototype: uses
- Operator → LED control GUI: controls
- LED control GUI → Pi GPIO: sets output (evidence: `QT Manual Exercise/Pyqt_LED control.py`)
- Blink thread → Pi GPIO: toggles output (evidence: `QT Manual Exercise/led gui.py`)
