# fujinetwifi/fujinet-firmware architecture

> Architecture diagram of the GitHub repository fujinetwifi/fujinet-firmware, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fujinetwifi/fujinet-firmware
- Repository: https://github.com/fujinetwifi/fujinet-firmware

## Overview

##### Main Components Overview

a) Hardware Layer:
- ESP32 Core (central component)
- Physical Interfaces (SIO, IWM, IEC, etc.)
- Storage (SD Card, Flash)
- Network (WiFi, Bluetooth)

b) Bus Communication Layer:
- Multiple bus protocols (/lib/bus/)
- SIO (Atari)
- IWM (Apple)
- IEC (Commodore)
- ADAMNET (Coleco)
- Others (RC2014, S100, etc.)

c) Device Emulation Layer:
- Virtual Devices (/lib/device/)
- Disk drives
- Printers
- Modems
- Network adapters

d) File System Layer:
- Multiple filesystem support (/lib/FileSystem/)
- Local (SD, SPIFFS, LittleFS)
- Network (TNFS, SMB, FTP)
- Virtual filesystems

e) Network Protocol Layer:
- Protocol implementations (/lib/network-protocol/)
- TCP/IP
- HTTP/HTTPS
- FTP
- TNFS
- SMB
- SSH

##### Connection Flow
- Hardware → Bus Communication → Device Emulation → File System → Network
- Bidirectional connections where appropriate

##### Component Details
For each major component, show:
- Input/Output interfaces
- Dependencies
- Key features
- Supported formats/protocols

##### Notes
- Version information
- Supported platforms
- Major capabilities
- Expansion possibilities

This system design should reflect the project's multi-platform nature while showing how the core ESP32 firmware manages different interfaces, protocols, and emulation layers to provide a unified experience across various 8-bit systems.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Hardware
        ESP32[ESP32 Core]:::hardware
        PhysInt[Physical Interfaces]:::hardware
        Storage[Storage Controllers]:::hardware
        Network[Network Hardware]:::hardware
    end

    subgraph BusLayer[Bus Communication]
        SIO[SIO Protocol]:::bus
        IWM[IWM Protocol]:::bus
        IEC[IEC Protocol]:::bus
        ADAMNET[ADAMNET Protocol]:::bus
        OtherBus[Other Protocols]:::bus
    end

    subgraph DeviceLayer[Device Emulation]
        DiskDrives[Disk Drives]:::device
        Printers[Printers]:::device
        Modems[Modems]:::device
        NetAdapters[Network Adapters]:::device
    end

    subgraph FSLayer[File System]
        LocalFS[Local Filesystems]:::fs
        NetworkFS[Network Filesystems]:::fs
        VirtualFS[Virtual Filesystems]:::fs
    end

    subgraph NetLayer[Network Protocols]
        TCP[TCP/IP]:::network
        HTTP[HTTP/HTTPS]:::network
        FTP[FTP]:::network
        TNFS[TNFS]:::network
        SMB[SMB]:::network
        SSH[SSH]:::network
    end

    %% Hardware Connections
    ESP32 --> PhysInt
    ESP32 --> Storage
    ESP32 --> Network

    %% Bus Layer Connections
    PhysInt --> SIO
    PhysInt --> IWM
    PhysInt --> IEC
    PhysInt --> ADAMNET
    PhysInt --> OtherBus

    %% Device Layer Connections
    SIO & IWM & IEC & ADAMNET --> DiskDrives
    SIO & IWM & IEC & ADAMNET --> Printers
    SIO & IWM & IEC & ADAMNET --> Modems
    SIO & IWM & IEC & ADAMNET --> NetAdapters

    %% FileSystem Connections
    Storage --> LocalFS
    Network --> NetworkFS
    DiskDrives & Printers --> VirtualFS

    %% Network Layer Connections
    Network --> TCP
    TCP --> HTTP & FTP & TNFS & SMB & SSH
    NetworkFS --> TNFS & SMB & FTP

    %% Styling
    classDef hardware fill:#E0E0E0,stroke:#333
    classDef bus fill:#B3E0FF,stroke:#333
    classDef device fill:#B3FFB3,stroke:#333
    classDef fs fill:#FFE0B3,stroke:#333
    classDef network fill:#FFB3B3,stroke:#333

    %% Click Events
    click ESP32 "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/hardware/"
    click PhysInt "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/include/pinmap/"
    click Storage "https://github.com/FujiNetWIFI/fujinet-firmware/blob/master/lib/FileSystem/fnFsSD.cpp"
    click Network "https://github.com/FujiNetWIFI/fujinet-firmware/blob/master/lib/hardware/fnWiFi.cpp"
    click SIO "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/bus/sio/"
    click IWM "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/bus/iwm/"
    click IEC "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/bus/iec/"
    click ADAMNET "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/bus/adamnet/"
    click DiskDrives "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/device/"
    click Printers "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/printer-emulator/"
    click LocalFS "https://github.com/FujiNetWIFI/fujinet-firmware/blob/master/lib/FileSystem/fnFsLittleFS.cpp"
    click NetworkFS "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/FileSystem/"
    click TNFS "https://github.com/FujiNetWIFI/fujinet-firmware/blob/master/lib/FileSystem/fnFsTNFS.cpp"
    click SMB "https://github.com/FujiNetWIFI/fujinet-firmware/blob/master/lib/network-protocol/SMB.cpp"
    click SSH "https://github.com/FujiNetWIFI/fujinet-firmware/blob/master/lib/network-protocol/SSH.cpp"
    click TCP "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/tcpip/"
    click HTTP "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/http/"
    click FTP "https://github.com/FujiNetWIFI/fujinet-firmware/tree/master/lib/ftp/"
```
