# niclson/nppcontact.generator.611 architecture

> Architecture diagram of the GitHub repository niclson/nppcontact.generator.611, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/niclson/nppcontact.generator.611
- Repository: https://github.com/niclson/nppcontact.generator.611

## Overview

This is embedded generator-controller firmware for an STM32H5, with generator start/stop and load-transfer control as its central domain workflow. The sampled controller code shows it checking protection parameters and operating outputs and relays; the tree also indicates sensing, configuration, display, and network capabilities. Source excerpts are limited, and there is no README, so links to unsampled subsystems are omitted rather than inferred.

Main entry points: [`Generator_Main/Core/Src/GeneratorController.c`](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/GeneratorController.c) (Generator state machine), [`Generator_Main/Core/Src/main.c`](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/main.c) (Startup), [`Generator_Main/Core/Src/app_freertos.c`](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/app_freertos.c) (RTOS tasks), [`Generator_Main/Core/Src/UserParameters.c`](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/UserParameters.c) (Settings and limits)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Firmware runtime"]
  node_boot["Startup<br/>[main.c]"]
  node_tasks["RTOS tasks<br/>[app_freertos.c]"]
end

subgraph group_control["Generator control"]
  node_controller["Generator state machine"]
  node_parameters["Settings and limits<br/>[UserParameters.c]"]
  node_parameter_limits["Parameter limits"]
  node_sensors["Sensor acquisition<br/>[Sensors.c]"]
  node_mpu["Engine monitoring<br/>[MPU.c]"]
end

subgraph group_io["Hardware I/O"]
  node_outputs["Output control<br/>[Output_Pin.c]"]
  node_relays["Relay control<br/>[relays.c]"]
  node_shift["LED shift register<br/>[hc595.c]"]
  node_metering["Power metering<br/>[atm90e36.c]"]
end

subgraph group_interfaces["Operator interfaces"]
  node_ui["Menu interface<br/>[UI_Menu.c]"]
  node_display["LCD driver<br/>[LCD.c]"]
  node_lvgl_port["LVGL integration<br/>[LVGL_Deriver.c]"]
end

subgraph group_connectivity["Communications and storage"]
  node_network["Ethernet controller<br/>[w5500.c]"]
  node_socket["Socket API<br/>[socket.c]"]
  node_network_init["Network setup<br/>[w5500_init.c]"]
  node_flash["SPI flash<br/>[w25q.c]"]
end

node_controller -->|"sets outputs"| node_outputs
node_controller -->|"switches relays"| node_relays
node_controller -->|"updates indicators"| node_shift
node_controller -->|"checks errors"| node_parameters
node_boot -->|"starts scheduler"| node_tasks

click node_boot "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/main.c"
click node_tasks "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/app_freertos.c"
click node_controller "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/GeneratorController.c"
click node_parameters "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/UserParameters.c"
click node_parameter_limits "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/UserParameters_limits.c"
click node_sensors "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/Sensors.c"
click node_mpu "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/MPU.c"
click node_outputs "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/Output_Pin.c"
click node_relays "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/relays.c"
click node_shift "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/hc595.c"
click node_metering "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/atm90e36.c"
click node_ui "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/UI_Menu.c"
click node_display "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/LCD.c"
click node_lvgl_port "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/LVGL_Deriver.c"
click node_network "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/w5500.c"
click node_socket "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/socket.c"
click node_network_init "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/w5500_init.c"
click node_flash "https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/w25q.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_boot,node_tasks toneBlue
class node_controller,node_parameters,node_parameter_limits,node_sensors,node_mpu toneAmber
class node_outputs,node_relays,node_shift,node_metering toneMint
class node_ui,node_display,node_lvgl_port toneRose
class node_network,node_socket,node_network_init,node_flash toneIndigo
```

## Components

### Firmware runtime

- [Startup](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/main.c): `Generator_Main/Core/Src/main.c`
- [RTOS tasks](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/app_freertos.c): `Generator_Main/Core/Src/app_freertos.c`

### Generator control

- [Generator state machine](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/GeneratorController.c): `Generator_Main/Core/Src/GeneratorController.c`
- [Settings and limits](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/UserParameters.c): `Generator_Main/Core/Src/UserParameters.c`
- [Parameter limits](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/UserParameters_limits.c): `Generator_Main/Core/Src/UserParameters_limits.c`
- [Sensor acquisition](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/Sensors.c): `Generator_Main/Core/Src/Sensors.c`
- [Engine monitoring](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/MPU.c): `Generator_Main/Core/Src/MPU.c`

### Hardware I/O

- [Output control](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/Output_Pin.c): `Generator_Main/Core/Src/Output_Pin.c`
- [Relay control](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/relays.c): `Generator_Main/Core/Src/relays.c`
- [LED shift register](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/hc595.c): `Generator_Main/Core/Src/hc595.c`
- [Power metering](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/atm90e36.c): `Generator_Main/Core/Src/atm90e36.c`

### Operator interfaces

- [Menu interface](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/UI_Menu.c): `Generator_Main/Core/Src/UI_Menu.c`
- [LCD driver](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/LCD.c): `Generator_Main/Core/Src/LCD.c`
- [LVGL integration](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/LVGL_Deriver.c): `Generator_Main/Core/Src/LVGL_Deriver.c`

### Communications and storage

- [Ethernet controller](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/w5500.c): `Generator_Main/Core/Src/w5500.c`
- [Socket API](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/socket.c): `Generator_Main/Core/Src/socket.c`
- [Network setup](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/w5500_init.c): `Generator_Main/Core/Src/w5500_init.c`
- [SPI flash](https://github.com/niclson/nppcontact.generator.611/blob/main/Generator_Main/Core/Src/w25q.c): `Generator_Main/Core/Src/w25q.c`

## Connections

- Generator state machine → Output control: sets outputs (evidence: `Generator_Main/Core/Src/GeneratorController.c`)
- Generator state machine → Relay control: switches relays (evidence: `Generator_Main/Core/Src/GeneratorController.c`)
- Generator state machine → LED shift register: updates indicators (evidence: `Generator_Main/Core/Src/GeneratorController.c`)
- Generator state machine → Settings and limits: checks errors (evidence: `Generator_Main/Core/Src/GeneratorController.c`)
- Startup → RTOS tasks: starts scheduler (evidence: `Generator_Main/Core/Src/main.c`)
