How ducthang321/embedded-system works
Project Type & Purpose
• The core of the project centers around embedded firmware for hardware control. There are firmware files for STM32 platforms (e.g., Button-Relay/main.c, Button-Relay/main.h, stm32f1xx_it.c, stm32uart.c) and an Arduino sketch for the ESP32 (esp32uart.ino).
• Supporting files such as liquidcrystal_i2c.c/h indicate that the system uses an I2C-controlled LCD display.
• There is a web-based or server-side component evidenced by PHP files (get.php, view.php) and a database script (database.sql), which may serve as an interface or visualization of system data. The presence of platformio.ini highlights the use of PlatformIO as a development tool for embedded projects.
• Overall, the project likely controls a button relay (hardware switching via buttons) and communicates system states/data to an external application or server (via UART or another communication protocol).
Analyzing the File Structure for Architectural Insights
• Embedded Firmware: The “Button-Relay” directory and associated main firmware files for STM32 indicate the core embedded functionality.
• Peripheral/Driver Libraries: The liquidcrystal_i2c files are libraries to drive an LCD display.
• Communication Modules: Files like stm32uart.c and esp32uart.ino suggest UART communication implementations on multiple platforms.
• Web Components: The get.php and view.php files, along with database.sql, hint at a web interface or backend logging/monitoring component.
• Additional Build/Configuration: The platformio.ini sets up project configurations for PlatformIO, and the “template code” folder could be offering reusable examples or base code for new features.
Elements
– Clear labels for each component: “STM32 Controller”, “ESP32 Controller”, “LCD Display (I2C)”, “UART Communication Interface”, “Web Server (PHP)”, “Database”, and “PlatformIO Build Environment”.
– Include any middleware or communication modules if applicable.
– Finally, add annotations that specify protocols (e.g., "UART", "I2C") and any communication details.