How abhishekkaisar/parkguard-stm32-smart-parking works
ParkGuard is STM32 firmware for parking access control with fail-open flood/fire response. The main loop samples vehicle, keypad, and hazard inputs, applies access and hazard state rules, drives the barrier and indicators, and refreshes the OLED. The README documents several behaviors not visible in the partial main.c excerpt; those branches are retained, with documented relationships cited to the README. Sensor polling and most control details share one implementation file, so their internal call sequence is not expanded beyond supported evidence.
Main entry points: main.c Main loop · ssd1306.c OLED status · fonts.c Display fonts · Src STM32 HAL
Components 13
Access control
- Main loop
firmware/Core/Src/main.c - Vehicle sensing
firmware/Core/Src/main.c - Gate control
firmware/Core/Src/main.c - Occupancy rules
firmware/Core/Src/main.c - Lane re-arm
firmware/Core/Src/main.c
Hazard response
- Hazard assessment
firmware/Core/Src/main.c - LED indicators
firmware/Core/Src/main.c
User interface
- Keypad and PIN
firmware/Core/Src/main.c - OLED status
firmware/Core/Src/ssd1306.c - Display fonts
firmware/Core/Src/fonts.c
Firmware platform
- STM32 HAL
firmware/Drivers/STM32F1xx_HAL_Driver/Src
Other components
- Vehicle / supervisor
- Garage hardware
Connections 17
- Vehicle / supervisor → Main loop: requests access
- Garage hardware → Vehicle sensing: provides distance
- Garage hardware → Hazard assessment: provides hazard readings
- Garage hardware → Keypad and PIN: provides key presses
- Main loop → Vehicle sensing: samples lane
firmware/Core/Src/main.c - Main loop → Occupancy rules: checks capacity
firmware/Core/Src/main.c - Main loop → Gate control: commands barrier
firmware/Core/Src/main.c - Main loop → Lane re-arm: enforces clear interval
firmware/Core/Src/main.c - Main loop → Keypad and PIN: scans keys
firmware/Core/Src/main.c - Main loop → Hazard assessment: evaluates readings
firmware/Core/Src/main.c - Hazard assessment → Gate control: holds open
firmware/Core/Src/main.c - Hazard assessment → LED indicators: signals alarm
firmware/Core/Src/main.c - Main loop → OLED status: renders status
firmware/Core/Src/main.c - OLED status → Display fonts: uses glyphs
- Main loop → STM32 HAL: uses peripheral APIs
- Gate control → Garage hardware: drives servo
- LED indicators → Garage hardware: drives LEDs