# tweetydabird/lotus-58-classic architecture

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

- Interactive diagram: https://gitdiagram.com/tweetydabird/lotus-58-classic
- Repository: https://github.com/tweetydabird/lotus-58-classic

## Overview

##### Main Components

a. Hardware Components Layer:
- Split Keyboard Halves (Left and Right PCBs)
- MCU (Microcontroller Units) for each half
- RGB LED System (Per-key and underglow)
- Optional Components (OLED displays, rotary encoders)
- USB-C/TRRS Connectivity

b. Firmware Layer:
- Bootloader
- Keyboard Firmware
- LED Control System
- Input Processing

**[Physical Layer]**

- Left Half PCB  |<--->|  Right Half PCB  |
- (Master/Host)   |     |    (Slave)       |

- ↑                        ↑

**[Component Layer]**

- MCU            |     | - MCU            |
- RGB LEDs       |     | - RGB LEDs       |
- Hot-swap       |     | - Hot-swap       |
- OLED (Optional)|     | - OLED (Optional)|
- Encoder (Opt.) |     | - Encoder (Opt.) |

- ↑                        ↑

**[Firmware Layer]**

- Bootloader     |     | - Bootloader     |
- Main Firmware  |     | - Main Firmware  |
- LED Control    |     | - LED Control    |

##### Important Elements to Highlight

a. Connectivity:
- USB-C connection (main input)
- TRRS connection between halves
- Data flow directions

b. Component Interactions:
- MCU to LED matrix
- MCU to input matrix
- MCU to optional components

##### Technical Details to Note

- Hot-swap socket compatibility
- RGB LED matrix configuration
- OLED and encoder positioning options
- Master/slave relationship between halves

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Physical
        L_PCB["Left PCB (Master)"]
        R_PCB["Right PCB (Slave)"]
        L_PCB <--> |TRRS| R_PCB
        USB[("USB-C Port")] --> L_PCB
    end

    subgraph Components_Left
        L_MCU["MCU"]
        L_RGB["RGB LEDs"]
        L_HOTSWAP["Hot-swap Sockets"]
        L_OLED["OLED (Optional)"]:::optional
        L_ENC["Encoder (Optional)"]:::optional
        L_PCB --> L_MCU
        L_MCU --> L_RGB
        L_MCU --> L_HOTSWAP
        L_MCU -.-> L_OLED
        L_MCU -.-> L_ENC
    end

    subgraph Components_Right
        R_MCU["MCU"]
        R_RGB["RGB LEDs"]
        R_HOTSWAP["Hot-swap Sockets"]
        R_OLED["OLED (Optional)"]:::optional
        R_ENC["Encoder (Optional)"]:::optional
        R_PCB --> R_MCU
        R_MCU --> R_RGB
        R_MCU --> R_HOTSWAP
        R_MCU -.-> R_OLED
        R_MCU -.-> L_ENC
    end

    subgraph Firmware
        BOOT["Bootloader"]:::firmware
        MAIN["Main Firmware"]:::firmware
        LED["LED Control"]:::firmware
        BOOT --> MAIN
        MAIN --> LED
    end

    subgraph Manufacturing
        PLATES["Plates & Cases"]:::manufacturing
        BOM["Bill of Materials"]:::manufacturing
        MODEL["3D Models"]:::manufacturing
    end

    L_MCU --> BOOT
    R_MCU --> BOOT

    classDef optional fill:#90EE90
    classDef firmware fill:#FFE4B5
    classDef manufacturing fill:#B0C4DE

    click L_PCB "https://github.com/TweetyDaBird/Lotus-58-Classic/blob/release/Lotus 58 USB-C/v1.41/Lotus58_Glow_141.kicad_pro"
    click R_PCB "https://github.com/TweetyDaBird/Lotus-58-Classic/blob/release/Lotus 58 Classic/v1.28/Lotus58_Glow_128.kicad_pro"
    click BOOT "https://github.com/TweetyDaBird/Lotus-58-Classic/blob/release/Firmware/bootloader/nanoBoot-bootloader.hex"
    click L_OLED "https://github.com/TweetyDaBird/Lotus-58-Classic/blob/release/Plate/FR4_Top_Plate_OLED.kicad_pcb"
    click L_ENC "https://github.com/TweetyDaBird/Lotus-58-Classic/blob/release/Plate/FR4_Top_Plate_ENC.kicad_pcb"
    click PLATES "https://github.com/TweetyDaBird/Lotus-58-Classic/blob/release/Plate/FR4_Bottom_Plate.kicad_pcb"
    click MODEL "https://github.com/TweetyDaBird/Lotus-58-Classic/blob/release/STEP for 3D modeling/Lotus58_Glow_USBC_140.step"
    click BOM "https://github.com/TweetyDaBird/Lotus-58-Classic/blob/release/Lotus 58 USB-C/v1.33/bom/ibom.html"
```
