How youssef-fd/stm32f429-lm35-driver works
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: USART_HAL.c USART driver · main.c Sampling loop · ADC_HAL.c ADC1 driver · GPIO_HAL.h GPIO definitions
Components 14
Application
- Sampling loop
Src/main.c - Value formatting
Src/main.c - USART1 handler
Src/main.c
ADC acquisition
- ADC1 driver
Src/ADC_HAL.c - ADC1 hardware
UART communication
- USART driver
Src/USART_HAL.c - USART1 hardware
Register definitions
- ADC register map
Inc/ADC_HAL.h - GPIO definitions
Inc/GPIO_HAL.h - USART API and types
Inc/USART_HAL.h - RCC and NVIC maps
Inc/Common_BASES.h
Other components
- LM35 sensor
- Serial terminal
- PG13 error LED
Connections 20
- Sampling loop → GPIO definitions: configures pins
Src/main.c - Sampling loop → USART driver: initializes UART
Src/main.c - Sampling loop → ADC1 driver: starts and reads
Src/main.c - LM35 sensor → ADC1 driver: provides analog signal
README.md - ADC1 driver → ADC register map: uses definitions
Src/ADC_HAL.c - ADC1 driver → GPIO definitions: configures analog pin
Src/ADC_HAL.c - ADC1 driver → ADC1 hardware: reads and configures
Src/ADC_HAL.c - Value formatting → Sampling loop: formats sample
Src/main.c - Sampling loop → Value formatting: passes ADC value
Src/main.c - Sampling loop → USART driver: starts transmission
Src/main.c - USART driver → USART API and types: uses definitions
Src/USART_HAL.c - USART driver → GPIO definitions: uses definitions
Src/USART_HAL.c - USART driver → RCC and NVIC maps: uses register maps
- Sampling loop → RCC and NVIC maps: enables NVIC IRQ
Src/main.c - USART driver → USART1 hardware: configures and transmits
Src/USART_HAL.c - USART1 hardware → USART1 handler: raises interrupt
README.md - USART1 handler → USART driver: dispatches interrupt
Src/main.c - USART1 hardware → Serial terminal: sends serial output
README.md - USART driver → PG13 error LED: signals fatal error
Src/USART_HAL.c - Sampling loop → USART driver: can request reception
README.md