# hnainiamohamedamine29/stm32-drivers architecture

> Architecture diagram of the GitHub repository hnainiamohamedamine29/stm32-drivers, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hnainiamohamedamine29/stm32-drivers
- Repository: https://github.com/hnainiamohamedamine29/stm32-drivers

## Overview

This is a small STM32 bare-metal driver example. On startup, the firmware configures an LED GPIO and USART2, then repeatedly blinks the LED and echoes received UART characters. The GPIO and UART drivers access STM32 registers directly; UART also configures its TX/RX pins. The graph reflects the sampled implementation and README description, without assuming additional peripherals or behavior.

Main entry points: [`main.c`](https://github.com/hnainiamohamedamine29/stm32-drivers/blob/main/main.c) (Firmware loop), [`gpio.c`](https://github.com/hnainiamohamedamine29/stm32-drivers/blob/main/gpio.c) (GPIO operations), [`uart.c`](https://github.com/hnainiamohamedamine29/stm32-drivers/blob/main/uart.c) (UART operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["Firmware"]
  node_main["Firmware loop<br/>[main.c]"]
end

subgraph group_gpio["GPIO driver"]
  node_gpio_driver["GPIO operations<br/>[gpio.c]"]
end

subgraph group_uart["UART driver"]
  node_uart_driver["UART operations<br/>[uart.c]"]
end

node_stm32["STM32 peripherals"]

node_main -->|"initializes and toggles"| node_gpio_driver
node_main -->|"initializes and exchanges"| node_uart_driver
node_main -->|"checks USART status"| node_stm32
node_gpio_driver -->|"accesses GPIO registers"| node_stm32
node_uart_driver -->|"configures and accesses"| node_stm32

click node_main "https://github.com/hnainiamohamedamine29/stm32-drivers/blob/main/main.c"
click node_gpio_driver "https://github.com/hnainiamohamedamine29/stm32-drivers/blob/main/gpio.c"
click node_uart_driver "https://github.com/hnainiamohamedamine29/stm32-drivers/blob/main/uart.c"

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_main toneBlue
class node_gpio_driver toneAmber
class node_uart_driver toneMint
class node_stm32 toneIndigo
```

## Components

### Firmware

- [Firmware loop](https://github.com/hnainiamohamedamine29/stm32-drivers/blob/main/main.c): `main.c`

### GPIO driver

- [GPIO operations](https://github.com/hnainiamohamedamine29/stm32-drivers/blob/main/gpio.c): `gpio.c`

### UART driver

- [UART operations](https://github.com/hnainiamohamedamine29/stm32-drivers/blob/main/uart.c): `uart.c`

### Other components

- **STM32 peripherals**

## Connections

- Firmware loop → GPIO operations: initializes and toggles (evidence: `main.c`)
- Firmware loop → UART operations: initializes and exchanges (evidence: `main.c`)
- Firmware loop → STM32 peripherals: checks USART status (evidence: `main.c`)
- GPIO operations → STM32 peripherals: accesses GPIO registers (evidence: `gpio.c`)
- UART operations → STM32 peripherals: configures and accesses (evidence: `uart.c`)
