How tomasdileo/stm32_trabajo_final works
Project Type and Purpose
• This is an embedded firmware project written in C for an STM32F103C6 microcontroller.
• Purpose: Drive an interactive shopping-mall kiosk system (keypad input, LCD output, temperature sensing, air-conditioning and alarm control).
High-Level File Structure Analysis
• Core/Inc & Core/Src: application entry point (main.c), system startup, ISR handlers, and syscalls.
• Core/Src/Drivers & Core/Inc/Drivers: application-level drivers for keypad, LCD, temperature sensor, AC and alarm.
• Drivers/CMSIS & Drivers/STM32F1xx_HAL_Driver: vendor libraries (CMSIS + STM32Cube HAL).
• Startup: MCU startup assembly.
• Project files (.ioc, linker script): hardware configuration and memory map.
README Insights
• Confirms final project for electronics course, focused on STM32 controlling mall locale system.
• User interacts via keypad; system displays status on LCD; monitors temperature; controls AC and triggers alarms.
a. Main Components
1. MCU Core (Cortex-M3)
2. HAL & CMSIS Layer
3. Application Drivers (Keypad, LCD, TempSensor, AC, Alarm)
4. Application Logic / State Machine (in main.c)
5. Peripherals:
– Keypad (User Input)
– LCD (User Feedback)
– Temperature Sensor (Data In)
– AC Unit (Control Out)
– Alarm Device (Control Out)
b. Relationships & Interactions
• On reset, Startup → HAL Init → Driver Init → Application Init.
• Main Loop polls keypad → sends commands to Application Logic → updates LCD and controls AC/Alarm based on logic and temperature readings.
• Temperature sensor read periodically → passed to Application Logic.
c. Architectural Patterns / Principles
• Layered design:
• Hardware Abstraction (CMSIS/HAL)
• Driver Layer (Core/Src/Drivers)
• Application Layer (Core/Src/main.c)
• Polling‐based main loop with simple state machine for user flow.
d. Key Technologies / Frameworks
• C language
• STM32Cube HAL (Drivers/STM32F1xx_HAL_Driver)
• CMSIS (Drivers/CMSIS)
• STM32CubeMX project configuration (trabajo-final.ioc)
Flow Chart of User Input / Usability Flow (Entry Point Focus)
• Start (power-on) → System Init → Display “Ready” on LCD
• Loop:
1. Wait for Keypad Input →
2. Parse Command (set temp, check status, arm/disarm alarm) →
3. Execute Action:
• Update internal state
• Send control signals to AC/Alarm
• Read Temperature Sensor → possibly auto-adjust AC
4. Update LCD Display → return to Wait
• Error/Alarm Condition: blink alarm indicator → display error → sound alarm