# saulius1005/avr64dd32-sunflower-weather-station architecture

> Architecture diagram of the GitHub repository saulius1005/avr64dd32-sunflower-weather-station, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saulius1005/avr64dd32-sunflower-weather-station
- Repository: https://github.com/saulius1005/avr64dd32-sunflower-weather-station

## Overview

This AVR weather-station firmware collects environmental and light data, maintains date/time and location, computes solar angles, applies a weather-related elevation correction, presents readings and settings through display windows, and transmits tower data with CRC. The README documents these product stages and the user interactions; sampled source confirms sensor, I2C, display, command-parsing, and CRC implementation details. Main-loop orchestration and several domain modules were not excerpted, so connections that depend on their runtime calls are left unverified rather than asserted.

Main entry points: [`AVR64DD32-SUNFLOWER-WEATHER-STATION/main.c`](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/main.c) (Station runtime), [`AVR64DD32-SUNFLOWER-WEATHER-STATION/Windows.c`](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Windows.c) (Display windows), [`AVR64DD32-SUNFLOWER-WEATHER-STATION/i2c.c`](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/i2c.c) (I2C bus), [`AVR64DD32-SUNFLOWER-WEATHER-STATION/SSD1306.c`](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/SSD1306.c) (SSD1306 display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_solar["Time and solar"]
  node_clock["Clock and RTC<br/>[RTC.c]"]
  node_solar_angles["Solar angles<br/>[ElAndAzComp.c]"]
  node_altitude["Altitude correction<br/>[Altitude.c]"]
end

subgraph group_environment["Weather sensing"]
  node_pressure["Pressure sensor<br/>[BMP390.c]"]
  node_temperature_humidity["Temperature humidity<br/>[SHT45.c]"]
  node_wind["Wind sensing<br/>[Wind.c]"]
  node_ambient_light["Ambient light<br/>[ADC.c]"]
end

subgraph group_interaction["User interface"]
  node_windows["Display windows<br/>[Windows.c]"]
  node_keypad["3x4 keypad<br/>[Keypad3x4.c]"]
  node_display_ssd["SSD1306 display<br/>[SSD1306.c]"]
  node_display_st["ST7567 display<br/>[ST7567S.c]"]
  node_font["Display font<br/>[font.h]"]
end

subgraph group_transport["Communications"]
  node_command_parse["Date-time parsing<br/>[Communications.c]"]
  node_outbound["Tower data formatting<br/>[Communications.c]"]
  node_crc["CRC checksums<br/>[CRC.c]"]
  node_rs485["RS485 USART<br/>[RS485USART.c]"]
end

subgraph group_hardware["Device interfaces"]
  node_i2c["I2C bus<br/>[i2c.c]"]
  node_usart["USART interface<br/>[USART.c]"]
  node_settings["Shared configuration<br/>[Settings.h]"]
end

node_operator(("Operator"))
node_tower(("Solar towers"))
node_firmware["Station runtime<br/>[main.c]"]

node_firmware -.->|"maintains time"| node_clock
node_firmware -.->|"calculates angles"| node_solar_angles
node_solar_angles -->|"weather-corrects"| node_altitude
node_operator -->|"enters settings"| node_keypad
node_keypad -.->|"navigates"| node_windows
node_windows -.->|"renders views"| node_display_ssd
node_windows -.->|"renders views"| node_display_st
node_display_ssd -->|"reads glyphs"| node_font
node_display_st -->|"reads glyphs"| node_font
node_pressure -->|"reads sensor"| node_i2c
node_temperature_humidity -->|"reads sensor"| node_i2c
node_display_ssd -->|"sends display data"| node_i2c
node_display_st -->|"sends display data"| node_i2c
node_firmware -->|"collects pressure"| node_pressure
node_firmware -->|"collects weather"| node_temperature_humidity
node_firmware -->|"collects wind"| node_wind
node_firmware -->|"collects light"| node_ambient_light
node_firmware -->|"displays readings"| node_windows
node_firmware -->|"sends calculated data"| node_outbound
node_outbound -->|"computes checksum"| node_crc
node_firmware -.->|"receives commands"| node_command_parse
node_command_parse -->|"reads characters"| node_usart
node_outbound -.->|"transmits data"| node_rs485
node_rs485 -->|"delivers data"| node_tower

click node_firmware "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/main.c"
click node_clock "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/RTC.c"
click node_solar_angles "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/ElAndAzComp.c"
click node_altitude "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Altitude.c"
click node_command_parse "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Communications.c"
click node_pressure "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/BMP390.c"
click node_temperature_humidity "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/SHT45.c"
click node_wind "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Wind.c"
click node_ambient_light "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/ADC.c"
click node_windows "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Windows.c"
click node_keypad "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Keypad3x4.c"
click node_display_ssd "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/SSD1306.c"
click node_display_st "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/ST7567S.c"
click node_font "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/font.h"
click node_outbound "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Communications.c"
click node_crc "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/CRC.c"
click node_rs485 "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/RS485USART.c"
click node_i2c "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/i2c.c"
click node_usart "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/USART.c"
click node_settings "https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Settings.h"

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_clock,node_solar_angles,node_altitude toneBlue
class node_pressure,node_temperature_humidity,node_wind,node_ambient_light toneAmber
class node_windows,node_keypad,node_display_ssd,node_display_st,node_font toneMint
class node_command_parse,node_outbound,node_crc,node_rs485 toneRose
class node_i2c,node_usart,node_settings,node_operator,node_tower toneIndigo
class node_firmware toneTeal
```

## Components

### Time and solar

- [Clock and RTC](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/RTC.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/RTC.c`
- [Solar angles](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/ElAndAzComp.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/ElAndAzComp.c`
- [Altitude correction](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Altitude.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/Altitude.c`

### Weather sensing

- [Pressure sensor](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/BMP390.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/BMP390.c`
- [Temperature humidity](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/SHT45.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/SHT45.c`
- [Wind sensing](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Wind.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/Wind.c`
- [Ambient light](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/ADC.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/ADC.c`

### User interface

- [Display windows](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Windows.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/Windows.c`
- [3x4 keypad](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Keypad3x4.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/Keypad3x4.c`
- [SSD1306 display](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/SSD1306.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/SSD1306.c`
- [ST7567 display](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/ST7567S.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/ST7567S.c`
- [Display font](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/font.h): `AVR64DD32-SUNFLOWER-WEATHER-STATION/font.h`

### Communications

- [Date-time parsing](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Communications.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/Communications.c`
- [Tower data formatting](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Communications.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/Communications.c`
- [CRC checksums](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/CRC.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/CRC.c`
- [RS485 USART](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/RS485USART.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/RS485USART.c`

### Device interfaces

- [I2C bus](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/i2c.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/i2c.c`
- [USART interface](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/USART.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/USART.c`
- [Shared configuration](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/Settings.h): `AVR64DD32-SUNFLOWER-WEATHER-STATION/Settings.h`

### Other components

- **Operator**
- **Solar towers**
- [Station runtime](https://github.com/saulius1005/avr64dd32-sunflower-weather-station/blob/main/AVR64DD32-SUNFLOWER-WEATHER-STATION/main.c): `AVR64DD32-SUNFLOWER-WEATHER-STATION/main.c`

## Connections

- Station runtime → Clock and RTC: maintains time
- Station runtime → Solar angles: calculates angles
- Solar angles → Altitude correction: weather-corrects
- Operator → 3x4 keypad: enters settings
- 3x4 keypad → Display windows: navigates
- Display windows → SSD1306 display: renders views
- Display windows → ST7567 display: renders views
- SSD1306 display → Display font: reads glyphs (evidence: `AVR64DD32-SUNFLOWER-WEATHER-STATION/SSD1306.c`)
- ST7567 display → Display font: reads glyphs (evidence: `AVR64DD32-SUNFLOWER-WEATHER-STATION/ST7567S.c`)
- Pressure sensor → I2C bus: reads sensor (evidence: `AVR64DD32-SUNFLOWER-WEATHER-STATION/BMP390.c`)
- Temperature humidity → I2C bus: reads sensor (evidence: `AVR64DD32-SUNFLOWER-WEATHER-STATION/SHT45.c`)
- SSD1306 display → I2C bus: sends display data (evidence: `AVR64DD32-SUNFLOWER-WEATHER-STATION/SSD1306.c`)
- ST7567 display → I2C bus: sends display data (evidence: `AVR64DD32-SUNFLOWER-WEATHER-STATION/ST7567S.c`)
- Station runtime → Pressure sensor: collects pressure
- Station runtime → Temperature humidity: collects weather
- Station runtime → Wind sensing: collects wind
- Station runtime → Ambient light: collects light
- Station runtime → Display windows: displays readings
- Station runtime → Tower data formatting: sends calculated data
- Tower data formatting → CRC checksums: computes checksum (evidence: `AVR64DD32-SUNFLOWER-WEATHER-STATION/CRC.c`)
- Station runtime → Date-time parsing: receives commands
- Date-time parsing → USART interface: reads characters (evidence: `AVR64DD32-SUNFLOWER-WEATHER-STATION/Communications.c`)
- Tower data formatting → RS485 USART: transmits data
- RS485 USART → Solar towers: delivers data
