How dresnaught/swr-stm32f4-cmake works
This is STM32F401 prototype firmware and controller-board design for an RF SWR and power meter. The runtime workflow samples three detector channels, calibrates readings and computes SWR, then refreshes the LCD when readings or button states change; buttons navigate measurement and calibration menus. The README also documents the target STC8 board and planned protection features, which are hardware/product branches rather than implemented firmware here. Firmware relationships are based on the shown main, menu and LCD code plus the source index; protection and PCB details are README-documented.
Main entry points: main.c Firmware Loop · menu.c Menu State and Rendering · lcd.c I2C LCD Driver · adc.c ADC Sampling
Components 16
Measurement Runtime
- Firmware Loop
Core/Src/main.c - ADC Sampling
Core/Src/adc.c - Calibration and SWR
Core/Src/conversion.c
Display and Navigation
- Button GPIO
Core/Src/button.c - Menu State and Rendering
Core/Src/menu.c - I2C LCD Driver
Core/Src/lcd.c
STM32 Platform
- SysTick Timing
Core/Src/sytick.c - System Initialization
Core/Src/system_stm32f4xx.c - STM32F401 Device Definitions
Drivers/CMSIS/Device/stm32f401xc.h
Board and Protection
- STC8 Controller PCB
PCB and Schematic/SCH_Schematic1_2026-09-30.pdf - PCB Fabrication Files
PCB and Schematic/Gerber - Relay Protection Circuit
PCB and Schematic/SCH_Schematic1_2026-09-30.pdf
Other components
- RF Coupler
- Operator
- Character LCD
- Transmitter PTT
Connections 16
- RF Coupler → ADC Sampling: provides detector signals
README.md - Firmware Loop → ADC Sampling: initializes
Core/Src/main.c - Firmware Loop → Calibration and SWR: reads measurements
Core/Src/main.c - Calibration and SWR → ADC Sampling: samples channels
Core/Src/conversion.c - Firmware Loop → Menu State and Rendering: updates and displays
Core/Src/main.c - Operator → Button GPIO: presses controls
README.md - Menu State and Rendering → Button GPIO: reads button states
Core/Src/menu.c - Menu State and Rendering → I2C LCD Driver: renders screens
Core/Src/menu.c - I2C LCD Driver → Character LCD: drives over I2C
README.md - Firmware Loop → SysTick Timing: initializes timing
Core/Src/main.c - I2C LCD Driver → SysTick Timing: uses delays
Core/Src/lcd.c - Firmware Loop → STM32F401 Device Definitions: accesses registers
Core/Src/main.c - System Initialization → STM32F401 Device Definitions: uses device definitions
Core/Src/system_stm32f4xx.c - STC8 Controller PCB → PCB Fabrication Files: documented fabrication outputs
README.md - STC8 Controller PCB → Relay Protection Circuit: includes relay circuitry
README.md - Relay Protection Circuit → Transmitter PTT: cuts off PTT
README.md