# Course_Design **Repository Path**: flypigbaby/Course_Design ## Basic Information - **Project Name**: Course_Design - **Description**: 22级嵌入式系统课程设计 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-31 - **Last Updated**: 2025-09-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Course Design Project This is an embedded system project based on the STM32F103C8Tx microcontroller, primarily used for sensor data acquisition, display, and communication. The project uses the STM32 HAL library and the u8g2 graphics library to drive the OLED display, and implements serial communication via UART. ## Project Features - **Sensor Data Acquisition**: Supports data acquisition from the DHT11 temperature and humidity sensor and ADC light sensor. - **Real-Time Clock (RTC)**: Provides time and date functionality. - **OLED Display**: Uses the u8g2 graphics library to drive the OLED screen, displaying sensor data and system information. - **Serial Communication**: Sends and receives data via UART, supporting formatted output and buffered reception. - **Button Interrupts**: Supports external button interrupt handling for user interaction. - **System Clock Configuration**: Provides system clock initialization and error handling. ## Hardware Platform - Microcontroller: STM32F103C8Tx - Peripherals: - DHT11 temperature and humidity sensor - ADC light sensor - OLED display (via I2C interface) - UART serial communication - Buttons and LEDs ## Software Architecture ### Core Components - **Core/Src/main.c**: Main program entry point, including system initialization, main loop, and interrupt handling. - **Core/Src/gpio.c**: GPIO pin initialization. - **Core/Src/usart.c**: UART initialization and communication functions. - **Core/Src/rtc.c**: RTC real-time clock initialization. - **Core/Src/i2c.c**: I2C bus initialization for OLED display. - **Core/Src/adc.c**: ADC initialization for light sensor data acquisition. - **Core/Src/dma.c**: DMA initialization for efficient data transfer. ### Driver Modules - **Drivers/BSP/Src/dht11.c**: Driver for the DHT11 temperature and humidity sensor. - **Drivers/BSP/Src/light_adc.c**: ADC acquisition functions for the light sensor. - **Drivers/BSP/Src/oled.c**: OLED display driver. - **Drivers/BSP/Src/u8g2_stm32_hw_iic.c**: I2C hardware interface implementation for the u8g2 graphics library. - **Drivers/BSP/Src/uart.c**: UART serial communication functions, including formatted transmission and receive buffer. ### Interrupt Handling - **Core/Src/stm32f1xx_it.c**: Interrupt service routines, including RTC, UART, and button interrupts. ### Graphics Interface - **Third_party/csrc/mui.c / mui.h**: Menu interface library for building user interaction interfaces on the OLED. - **Third_party/csrc/u8g2.c / u8g2.h**: u8g2 graphics library, providing OLED drawing capabilities. ## Usage Instructions ### Compilation and Flashing 1. Open the project using STM32CubeIDE or Keil MDK. 2. Compile the project. 3. Use a debugger or serial flashing tool to program the code into the STM32F103C8Tx microcontroller. ### Running Features - After power-on, the system initializes all peripherals. - The OLED displays temperature, humidity, light intensity, time, and other information. - Data can be sent and received via the serial port. - Buttons can be used to switch OLED display interfaces or trigger specific functions. ## Development and Debugging - **Debugging Tools**: Supports debugging tools such as STM32CubeIDE, Keil, and OpenOCD. - **Log Output**: Debug information is output via the serial port. - **Interrupt Debugging**: Breakpoints can be set in `stm32f1xx_it.c` for interrupt debugging. ## Dependencies - **STM32 HAL Library**: Used for peripheral drivers. - **u8g2 Graphics Library**: Used for OLED display. - **mui Menu Library**: Used for building user interfaces. ## License This project is licensed under the MIT License. Please refer to the LICENSE file for details. ## Contribution Pull Requests and Issue submissions are welcome. Please follow the project's coding style and submission guidelines. ## Contact For any questions, please contact the project maintainer.