# heaven1925/stm32_dyxx-audio_playback_driver architecture

> Architecture diagram of the GitHub repository heaven1925/stm32_dyxx-audio_playback_driver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/heaven1925/stm32_dyxx-audio_playback_driver
- Repository: https://github.com/heaven1925/stm32_dyxx-audio_playback_driver

## Overview

##### Main Components

a. Hardware Layer:
- STM32F407VGT Microcontroller
- DYXX Audio Playback Module
- SD Card (External Storage)
- UART Interface

b. Software Layer:
- HAL Drivers (STM32F4xx_HAL)
- DYPlayer Library
- Core Application

##### Implementation Details
Notes about:
- UART Transmit-only mode
- Future expansion possibilities (One-Line & IO mode)
- SD Card formatting requirements

- The clear separation between hardware and software layers
- The central role of the DYPlayer library
- The UART communication path
- The file system requirements
- The HAL driver architecture

Use standardized symbols:
- Rectangles for software components
- Rounded rectangles for hardware components
- Diamonds for storage elements

- The system's overall architecture
- How components interact
- The data flow through the system
- Hardware dependencies
- Software layer organization

Remember to maintain a balance between detail and clarity, focusing on the UART communication aspect while showing the potential for future expansion to other modes.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style definitions
    classDef hardware fill:#b3d9ff,stroke:#333,stroke-width:2px
    classDef software fill:#90EE90,stroke:#333,stroke-width:2px
    classDef application fill:#FFEB99,stroke:#333,stroke-width:2px
    classDef storage fill:#E6E6E6,stroke:#333,stroke-width:2px
    classDef driver fill:#98FB98,stroke:#333,stroke-width:2px

    %% Application Layer
    subgraph AppLayer["Application Layer"]
        MainApp["Main Application"]:::application
        SysConfig["System Configuration"]:::application
        IntHandler["Interrupt Handlers"]:::application
    end

    %% Driver Layer
    subgraph DriverLayer["Driver Layer"]
        DYLib["DYPlayer Library"]:::driver
        HALCore["Core HAL"]:::driver
        HALUART["UART Driver"]:::driver
        HALGPIO["GPIO Driver"]:::driver
    end

    %% Hardware Layer
    subgraph HWLayer["Hardware Layer"]
        MCU["STM32F407VGT MCU"]:::hardware
        AudioModule["DYXX Audio Module"]:::hardware
        SDCard["SD Card (FAT32)"]:::storage
        Startup["MCU Startup & Init"]:::hardware
    end

    %% Connections
    MainApp --> DYLib
    MainApp --> SysConfig
    MainApp --> IntHandler
    DYLib --> HALUART
    DYLib --> HALGPIO
    HALUART --> HALCore
    HALGPIO --> HALCore
    HALUART --> MCU
    HALGPIO --> MCU
    MCU -.->|UART| AudioModule
    AudioModule -.->|File Access| SDCard

    %% Click events
    click MainApp "https://github.com/heaven1925/STM32_DYXX-AUDIO_Playback_DRIVER/blob/main/STM32_DYPlayer_Example/Core/Src/main.c"
    click SysConfig "https://github.com/heaven1925/STM32_DYXX-AUDIO_Playback_DRIVER/blob/main/STM32_DYPlayer_Example/Core/Inc/stm32f4xx_hal_conf.h"
    click DYLib "https://github.com/heaven1925/STM32_DYXX-AUDIO_Playback_DRIVER/blob/main/STM32_DYPlayer_Example/Core/Src/DYPlayer.c"
    click HALUART "https://github.com/heaven1925/STM32_DYXX-AUDIO_Playback_DRIVER/blob/main/STM32_DYPlayer_Example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c"
    click HALGPIO "https://github.com/heaven1925/STM32_DYXX-AUDIO_Playback_DRIVER/blob/main/STM32_DYPlayer_Example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c"
    click HALCore "https://github.com/heaven1925/STM32_DYXX-AUDIO_Playback_DRIVER/blob/main/STM32_DYPlayer_Example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c"
    click MCU "https://github.com/heaven1925/STM32_DYXX-AUDIO_Playback_DRIVER/blob/main/STM32_DYPlayer_Example/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h"
    click Startup "https://github.com/heaven1925/STM32_DYXX-AUDIO_Playback_DRIVER/blob/main/STM32_DYPlayer_Example/Core/Startup/startup_stm32f407vgtx.s"
    click IntHandler "https://github.com/heaven1925/STM32_DYXX-AUDIO_Playback_DRIVER/blob/main/STM32_DYPlayer_Example/Core/Src/stm32f4xx_it.c"

    %% Legend
    subgraph Legend
        H["Hardware Component"]:::hardware
        S["Software Component"]:::software
        A["Application Component"]:::application
        St["Storage Component"]:::storage
        D["Driver Component"]:::driver
    end
```
