# peredozo/arduino_gfx architecture

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

- Interactive diagram: https://gitdiagram.com/peredozo/arduino_gfx
- Repository: https://github.com/peredozo/arduino_gfx

## Overview

##### Main Components Architecture

**┌─────────────────────────────────────────────┐**
- Application Layer              │
- ┬─────────────────────────┘
- ↓
**┌─────────────────────────────────────────────┐**
- Arduino_GFX Library              │
- ┤
- Graphics Engine   │    Font System          │
- ┤
- Display Drivers   │    Data Bus Drivers     │
- ┬─────────────────────────┘
- ↓
**┌─────────────────────────────────────────────┐**
- Hardware Layer                   │
- ┘

##### Detailed Component Breakdown

a. Graphics Engine Components:
**┌─────────────────────────────────────────┐**
- Arduino_GFX Core              │
- ┬───────────────────┤
- Basic Graphics    │  Advanced Graphics │
- ┼───────────────────┤
- Line Drawing      │ - Bitmap Support  │
- Text Rendering    │ - GIF Support     │
- ┴───────────────────┘

b. Data Bus Interface Layer:
**┌─────────────────────────────────────────┐**
- Data Bus Interfaces           │
- ┬───────────────────┤
- Hardware        │     Software      │
- ┼───────────────────┤
- 8/9-bit SPI      │ - Soft SPI        │
- Parallel 8-bit   │ - Soft Parallel   │
- Parallel 16-bit  │                   │
- RGB+SPI          │                   │
- ┴───────────────────┘

c. Driver Layer:
**┌─────────────────────────────────────────┐**
- Display Drivers               │
- ┬───────────────────┤
- ┼───────────────────┤
- ILI Series       │ - RGB565          │
- ST7789 Series    │ - RGB666          │
- GC Series        │ - RGB888          │
- HX Series        │                   │
- ┴───────────────────┘

##### Canvas System
**┌─────────────────────────────────────────┐**
- Canvas System                 │
- ┬───────────────────┤
- Canvas Types      │  Memory Usage     │
- ┼───────────────────┤
- Standard (16-bit) │ - Full Buffer    │
- Indexed          │ - Half Buffer    │
- 3-bit            │ - Quarter Buffer │
- Mono             │ - 1/16 Buffer    │
- ┴───────────────────┘

##### Font System Integration
**┌─────────────────────────────────────────┐**
- Font System                   │
- ┬───────────────────┤
- Font Types       │  Character Sets   │
- ┼───────────────────┤
- Built-in         │ - ASCII          │
- U8g2 Fonts      │ - UTF8           │
- GFX Fonts       │ - CJK            │
- ┴───────────────────┘

##### Important Notes

- Blue: Core components
- Green: Hardware interfaces
- Orange: Display drivers
- Purple: Font system
- Yellow: Canvas system

- Use different line styles:

- Notes about supported platforms and hardware

##### Implementation Details

- Supported display resolutions
- Memory requirements
- Performance characteristics
- Hardware compatibility matrix

This system design should be created using a professional diagramming tool that supports:
- Clear hierarchical layout
- Proper connection routing
- Export to high-resolution formats
- Easy maintenance and updates

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Application["Application Layer"]
        APP[User Application]
        GFXLIB["Arduino GFX Library"]:::main
    end

    subgraph Core["Core Layer"]
        GFX["Graphics Engine Core"]:::core
        FONT["Font System"]:::font
        CANVAS["Canvas System"]:::canvas
    end

    subgraph Drivers["Drivers Layer"]
        subgraph DisplayDrivers["Display Drivers"]
            TFT["TFT Display Base"]:::display
            ILI["ILI Series"]:::display
            ST7["ST7789 Series"]:::display
            GC["GC Series"]:::display
            HX["HX Series"]:::display
        end

        subgraph DataBus["Data Bus Interfaces"]
            DB["Data Bus Base"]:::databus
            HW["Hardware Interfaces"]:::databus
            SW["Software Interfaces"]:::databus
        end
    end

    subgraph Graphics["Graphics Components"]
        BASIC["Basic Graphics"]:::graphics
        ADV["Advanced Graphics"]:::graphics
    end

    subgraph FontSystem["Font Components"]
        BASICF["Basic Font Support"]:::font
        UTF["UTF8/CJK Support"]:::font
    end

    APP --> GFXLIB
    GFXLIB --> GFX
    GFX --> BASIC
    GFX --> ADV
    GFX --> FONT
    GFX --> CANVAS
    FONT --> BASICF
    FONT --> UTF
    GFX --> TFT
    TFT --> ILI
    TFT --> ST7
    TFT --> GC
    TFT --> HX
    TFT --> DB
    DB --> HW
    DB --> SW

    %% Click events
    click GFX "https://github.com/peredozo/Arduino_GFX/blob/master/src/Arduino_GFX.h"
    click FONT "https://github.com/peredozo/Arduino_GFX/tree/master/src/font/"
    click TFT "https://github.com/peredozo/Arduino_GFX/blob/master/src/Arduino_TFT.h"
    click GFXLIB "https://github.com/peredozo/Arduino_GFX/blob/master/src/Arduino_GFX_Library.h"
    click DB "https://github.com/peredozo/Arduino_GFX/blob/master/src/Arduino_DataBus.h"
    click BASICF "https://github.com/peredozo/Arduino_GFX/blob/master/src/font/glcdfont.h"
    click UTF "https://github.com/peredozo/Arduino_GFX/blob/master/src/font/u8g2_font_unifont_t_cjk.h"
    click DisplayDrivers "https://github.com/peredozo/Arduino_GFX/tree/master/src/display/"
    click DataBus "https://github.com/peredozo/Arduino_GFX/tree/master/src/databus/"
    click CANVAS "https://github.com/peredozo/Arduino_GFX/tree/master/src/canvas/"

    %% Styling
    classDef main fill:#f9f,stroke:#333,stroke-width:2px
    classDef core fill:#9cf,stroke:#333,stroke-width:2px
    classDef font fill:#c9f,stroke:#333,stroke-width:2px
    classDef canvas fill:#fc9,stroke:#333,stroke-width:2px
    classDef display fill:#9fc,stroke:#333,stroke-width:2px
    classDef databus fill:#ff9,stroke:#333,stroke-width:2px
    classDef graphics fill:#f99,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Main Library"]:::main
        L2["Core Components"]:::core
        L3["Font System"]:::font
        L4["Canvas System"]:::canvas
        L5["Display Drivers"]:::display
        L6["Data Bus"]:::databus
        L7["Graphics"]:::graphics
    end
```
