# khaled-magdy-deepblue/stm32_course_deepblue architecture

> Architecture diagram of the GitHub repository khaled-magdy-deepblue/stm32_course_deepblue, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/khaled-magdy-deepblue/stm32_course_deepblue
- Repository: https://github.com/khaled-magdy-deepblue/stm32_course_deepblue

## Overview

This repository is a collection of STM32 course firmware drivers, not a standalone application: it provides peripheral-facing input and sensing, actuation and display, storage middleware, and small math/utility facilities. The typical user-to-result path is application code calling a configured driver, which reads a sensor or input or sends output to a peripheral. The tree and excerpts support those driver responsibilities, but do not reveal a central application or how the modules are composed. Unsampled modules are represented by their exact directory paths; their wiring is omitted where source evidence is unavailable.

Main entry points: [`MIDWARE/FATFS_SD/FATFS_SD.c`](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/MIDWARE/FATFS_SD/FATFS_SD.c) (FATFS SD), [`ECUAL/JOYSTICK/JOYSTICK.c`](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/JOYSTICK/JOYSTICK.c) (Joystick ADC), [`ECUAL/HCSR04/HCSR04.c`](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/HCSR04/HCSR04.c) (HC-SR04), [`ECUAL/DC_MOTOR/DC_MOTOR.c`](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/DC_MOTOR/DC_MOTOR.c) (DC motor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and sensing"]
  node_keypad["Keypad<br/>[KEYPAD.c]"]
  node_buttons["Buttons<br/>[BUTTONS.c]"]
  node_joystick["Joystick ADC<br/>[JOYSTICK.c]"]
  node_ultrasonic["HC-SR04<br/>[HCSR04.c]"]
  node_temperature["LM35 sensor<br/>[LM35.c]"]
end

subgraph group_outputs["Actuation and display"]
  node_dc_motor["DC motor<br/>[DC_MOTOR.c]"]
  node_servo["Servo motor<br/>[SERVO.c]"]
  node_stepper["Stepper motor<br/>[STEPPER.c]"]
  node_leds["LEDs<br/>[LEDS.c]"]
  node_dot_matrix["Dot matrix<br/>[DOT_MATRIX.c]"]
  node_seven_segment["Seven segment<br/>[SEVEN_SEGMENTS.c]"]
  node_lcd_gpio["GPIO LCD<br/>[LCD16X2.c]"]
  node_lcd_i2c["I2C LCD<br/>[I2C_LCD.c]"]
end

subgraph group_storage["Storage middleware"]
  node_fatfs_sd["FATFS SD<br/>[FATFS_SD.c]"]
  node_fee["Flash EEPROM<br/>[FEE.c]"]
end

subgraph group_support["Math and utilities"]
  node_math["Math functions<br/>[MATH.c]"]
  node_fir["FIR filter<br/>[FIR.c]"]
  node_util["GPIO and delays<br/>[Util.h]"]
end

node_application(("Application caller"))
node_hal["STM32 HAL peripherals"]
node_sd_card[("SD card")]

node_application -->|"reads keys"| node_keypad
node_application -->|"reads buttons"| node_buttons
node_application -->|"reads axes"| node_joystick
node_application -->|"requests distance"| node_ultrasonic
node_application -->|"reads temperature"| node_temperature
node_application -->|"sets motor"| node_dc_motor
node_application -->|"sets position"| node_servo
node_application -->|"sets motion"| node_stepper
node_application -->|"controls LEDs"| node_leds
node_application -->|"updates display"| node_dot_matrix
node_application -->|"sets digits"| node_seven_segment
node_application -->|"writes display"| node_lcd_gpio
node_application -->|"writes display"| node_lcd_i2c
node_application -->|"requests storage"| node_fatfs_sd
node_application -->|"requests persistence"| node_fee
node_application -->|"calls functions"| node_math
node_application -->|"filters samples"| node_fir
node_joystick -->|"configures and reads ADC"| node_hal
node_ultrasonic -->|"drives GPIO and timer capture"| node_hal
node_dc_motor -->|"drives GPIO and PWM"| node_hal
node_servo -->|"drives PWM"| node_hal
node_stepper -->|"drives GPIO and timer"| node_hal
node_lcd_i2c -->|"transmits over I2C"| node_hal
node_fatfs_sd -->|"transfers over SPI"| node_hal
node_fatfs_sd -->|"reads and writes sectors"| node_sd_card

click node_keypad "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/KEYPAD/KEYPAD.c"
click node_buttons "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/BUTTONS/BUTTONS.c"
click node_joystick "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/JOYSTICK/JOYSTICK.c"
click node_ultrasonic "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/HCSR04/HCSR04.c"
click node_temperature "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/LM35/LM35.c"
click node_dc_motor "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/DC_MOTOR/DC_MOTOR.c"
click node_servo "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/SERVO/SERVO.c"
click node_stepper "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/STEPPER/STEPPER.c"
click node_leds "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/LEDS/LEDS.c"
click node_dot_matrix "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/DOT_MATRIX/DOT_MATRIX.c"
click node_seven_segment "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/SEVEN_SEGMENTS/SEVEN_SEGMENTS.c"
click node_lcd_gpio "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/LCD16X2/LCD16X2.c"
click node_lcd_i2c "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/I2C_LCD/I2C_LCD.c"
click node_fatfs_sd "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/MIDWARE/FATFS_SD/FATFS_SD.c"
click node_fee "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/MIDWARE/FEE/FEE.c"
click node_math "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/MATH/MATH.c"
click node_fir "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/MATH/FIR/FIR.c"
click node_util "https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/util/Util.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_keypad,node_buttons,node_joystick,node_ultrasonic,node_temperature toneBlue
class node_dc_motor,node_servo,node_stepper,node_leds,node_dot_matrix,node_seven_segment,node_lcd_gpio,node_lcd_i2c,node_sd_card toneAmber
class node_fatfs_sd,node_fee toneMint
class node_math,node_fir,node_util toneRose
class node_application,node_hal toneIndigo
```

## Components

### Inputs and sensing

- [Keypad](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/KEYPAD/KEYPAD.c): `ECUAL/KEYPAD/KEYPAD.c`
- [Buttons](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/BUTTONS/BUTTONS.c): `ECUAL/BUTTONS/BUTTONS.c`
- [Joystick ADC](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/JOYSTICK/JOYSTICK.c): `ECUAL/JOYSTICK/JOYSTICK.c`
- [HC-SR04](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/HCSR04/HCSR04.c): `ECUAL/HCSR04/HCSR04.c`
- [LM35 sensor](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/LM35/LM35.c): `ECUAL/LM35/LM35.c`

### Actuation and display

- [DC motor](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/DC_MOTOR/DC_MOTOR.c): `ECUAL/DC_MOTOR/DC_MOTOR.c`
- [Servo motor](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/SERVO/SERVO.c): `ECUAL/SERVO/SERVO.c`
- [Stepper motor](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/STEPPER/STEPPER.c): `ECUAL/STEPPER/STEPPER.c`
- [LEDs](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/LEDS/LEDS.c): `ECUAL/LEDS/LEDS.c`
- [Dot matrix](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/DOT_MATRIX/DOT_MATRIX.c): `ECUAL/DOT_MATRIX/DOT_MATRIX.c`
- [Seven segment](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/SEVEN_SEGMENTS/SEVEN_SEGMENTS.c): `ECUAL/SEVEN_SEGMENTS/SEVEN_SEGMENTS.c`
- [GPIO LCD](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/LCD16X2/LCD16X2.c): `ECUAL/LCD16X2/LCD16X2.c`
- [I2C LCD](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/ECUAL/I2C_LCD/I2C_LCD.c): `ECUAL/I2C_LCD/I2C_LCD.c`

### Storage middleware

- [FATFS SD](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/MIDWARE/FATFS_SD/FATFS_SD.c): `MIDWARE/FATFS_SD/FATFS_SD.c`
- [Flash EEPROM](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/MIDWARE/FEE/FEE.c): `MIDWARE/FEE/FEE.c`

### Math and utilities

- [Math functions](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/MATH/MATH.c): `MATH/MATH.c`
- [FIR filter](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/MATH/FIR/FIR.c): `MATH/FIR/FIR.c`
- [GPIO and delays](https://github.com/khaled-magdy-deepblue/stm32_course_deepblue/blob/master/util/Util.h): `util/Util.h`

### Other components

- **Application caller**
- **STM32 HAL peripherals**
- **SD card**

## Connections

- Application caller → Keypad: reads keys
- Application caller → Buttons: reads buttons
- Application caller → Joystick ADC: reads axes
- Application caller → HC-SR04: requests distance
- Application caller → LM35 sensor: reads temperature
- Application caller → DC motor: sets motor
- Application caller → Servo motor: sets position
- Application caller → Stepper motor: sets motion
- Application caller → LEDs: controls LEDs
- Application caller → Dot matrix: updates display
- Application caller → Seven segment: sets digits
- Application caller → GPIO LCD: writes display
- Application caller → I2C LCD: writes display
- Application caller → FATFS SD: requests storage
- Application caller → Flash EEPROM: requests persistence
- Application caller → Math functions: calls functions
- Application caller → FIR filter: filters samples
- Joystick ADC → STM32 HAL peripherals: configures and reads ADC
- HC-SR04 → STM32 HAL peripherals: drives GPIO and timer capture
- DC motor → STM32 HAL peripherals: drives GPIO and PWM
- Servo motor → STM32 HAL peripherals: drives PWM
- Stepper motor → STM32 HAL peripherals: drives GPIO and timer
- I2C LCD → STM32 HAL peripherals: transmits over I2C
- FATFS SD → STM32 HAL peripherals: transfers over SPI
- FATFS SD → SD card: reads and writes sectors
