# youssef-fd/stm32f429-lm35-driver architecture

> Architecture diagram of the GitHub repository youssef-fd/stm32f429-lm35-driver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/youssef-fd/stm32f429-lm35-driver
- Repository: https://github.com/youssef-fd/stm32f429-lm35-driver

## Overview

This is a bare-metal STM32F429 temperature monitor: the main loop samples an LM35 through ADC1, converts and formats the reading, then starts a non-blocking USART1 transmission; the USART interrupt handler advances that transmission. The README also documents reusable UART reception and error handling, although the demo does not use reception. The conversion currently formats pin millivolts as temperature-like output rather than applying the LM35’s 10 mV/°C scaling. Relationships below follow the excerpts and README; peripheral register interactions are not modeled as separately inspected source.

Main entry points: [`Src/USART_HAL.c`](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/USART_HAL.c) (USART driver), [`Src/main.c`](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/main.c) (Sampling loop), [`Src/ADC_HAL.c`](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/ADC_HAL.c) (ADC1 driver), [`Inc/GPIO_HAL.h`](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Inc/GPIO_HAL.h) (GPIO definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["Sampling loop<br/>[main.c]"]
  node_conversion["Value formatting<br/>[main.c]"]
  node_isr["USART1 handler<br/>[main.c]"]
end

subgraph group_adc["ADC acquisition"]
  node_adc_driver["ADC1 driver<br/>[ADC_HAL.c]"]
  node_adc_hardware["ADC1 hardware"]
end

subgraph group_uart["UART communication"]
  node_uart_driver["USART driver<br/>[USART_HAL.c]"]
  node_usart_hardware["USART1 hardware"]
end

subgraph group_registers["Register definitions"]
  node_adc_registers["ADC register map<br/>[ADC_HAL.h]"]
  node_gpio["GPIO definitions<br/>[GPIO_HAL.h]"]
  node_uart_api["USART API and types<br/>[USART_HAL.h]"]
  node_common["RCC and NVIC maps<br/>[Common_BASES.h]"]
end

node_sensor(("LM35 sensor"))
node_terminal(("Serial terminal"))
node_error_led(("PG13 error LED"))

node_main -->|"configures pins"| node_gpio
node_main -->|"initializes UART"| node_uart_driver
node_main -->|"starts and reads"| node_adc_driver
node_sensor -->|"provides analog signal"| node_adc_driver
node_adc_driver -->|"uses definitions"| node_adc_registers
node_adc_driver -->|"configures analog pin"| node_gpio
node_adc_driver -->|"reads and configures"| node_adc_hardware
node_conversion -->|"formats sample"| node_main
node_main -->|"passes ADC value"| node_conversion
node_main -->|"starts transmission"| node_uart_driver
node_uart_driver -->|"uses definitions"| node_uart_api
node_uart_driver -->|"uses definitions"| node_gpio
node_uart_driver -->|"uses register maps"| node_common
node_main -->|"enables NVIC IRQ"| node_common
node_uart_driver -->|"configures and transmits"| node_usart_hardware
node_usart_hardware -->|"raises interrupt"| node_isr
node_isr -->|"dispatches interrupt"| node_uart_driver
node_usart_hardware -->|"sends serial output"| node_terminal
node_uart_driver -->|"signals fatal error"| node_error_led
node_main -.->|"can request reception"| node_uart_driver

click node_main "https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/main.c"
click node_conversion "https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/main.c"
click node_isr "https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/main.c"
click node_adc_driver "https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/ADC_HAL.c"
click node_adc_registers "https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Inc/ADC_HAL.h"
click node_gpio "https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Inc/GPIO_HAL.h"
click node_uart_driver "https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/USART_HAL.c"
click node_uart_api "https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Inc/USART_HAL.h"
click node_common "https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Inc/Common_BASES.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_main,node_conversion,node_isr toneBlue
class node_adc_driver,node_adc_hardware toneAmber
class node_uart_driver,node_usart_hardware toneMint
class node_adc_registers,node_gpio,node_uart_api,node_common toneRose
class node_sensor,node_terminal,node_error_led toneIndigo
```

## Components

### Application

- [Sampling loop](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/main.c): `Src/main.c`
- [Value formatting](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/main.c): `Src/main.c`
- [USART1 handler](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/main.c): `Src/main.c`

### ADC acquisition

- [ADC1 driver](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/ADC_HAL.c): `Src/ADC_HAL.c`
- **ADC1 hardware**

### UART communication

- [USART driver](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Src/USART_HAL.c): `Src/USART_HAL.c`
- **USART1 hardware**

### Register definitions

- [ADC register map](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Inc/ADC_HAL.h): `Inc/ADC_HAL.h`
- [GPIO definitions](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Inc/GPIO_HAL.h): `Inc/GPIO_HAL.h`
- [USART API and types](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Inc/USART_HAL.h): `Inc/USART_HAL.h`
- [RCC and NVIC maps](https://github.com/youssef-fd/stm32f429-lm35-driver/blob/main/Inc/Common_BASES.h): `Inc/Common_BASES.h`

### Other components

- **LM35 sensor**
- **Serial terminal**
- **PG13 error LED**

## Connections

- Sampling loop → GPIO definitions: configures pins (evidence: `Src/main.c`)
- Sampling loop → USART driver: initializes UART (evidence: `Src/main.c`)
- Sampling loop → ADC1 driver: starts and reads (evidence: `Src/main.c`)
- LM35 sensor → ADC1 driver: provides analog signal (evidence: `README.md`)
- ADC1 driver → ADC register map: uses definitions (evidence: `Src/ADC_HAL.c`)
- ADC1 driver → GPIO definitions: configures analog pin (evidence: `Src/ADC_HAL.c`)
- ADC1 driver → ADC1 hardware: reads and configures (evidence: `Src/ADC_HAL.c`)
- Value formatting → Sampling loop: formats sample (evidence: `Src/main.c`)
- Sampling loop → Value formatting: passes ADC value (evidence: `Src/main.c`)
- Sampling loop → USART driver: starts transmission (evidence: `Src/main.c`)
- USART driver → USART API and types: uses definitions (evidence: `Src/USART_HAL.c`)
- USART driver → GPIO definitions: uses definitions (evidence: `Src/USART_HAL.c`)
- USART driver → RCC and NVIC maps: uses register maps
- Sampling loop → RCC and NVIC maps: enables NVIC IRQ (evidence: `Src/main.c`)
- USART driver → USART1 hardware: configures and transmits (evidence: `Src/USART_HAL.c`)
- USART1 hardware → USART1 handler: raises interrupt (evidence: `README.md`)
- USART1 handler → USART driver: dispatches interrupt (evidence: `Src/main.c`)
- USART1 hardware → Serial terminal: sends serial output (evidence: `README.md`)
- USART driver → PG13 error LED: signals fatal error (evidence: `Src/USART_HAL.c`)
- Sampling loop → USART driver: can request reception (evidence: `README.md`)
