# hailee0710/zmk-ergo-s-1-oled architecture

> Architecture diagram of the GitHub repository hailee0710/zmk-ergo-s-1-oled, 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/hailee0710/zmk-ergo-s-1-oled
- Repository: https://github.com/hailee0710/zmk-ergo-s-1-oled

## Overview

##### Main Components

a. Hardware Components:
- Central Dongle Module
- Central Left Module
- Peripheral Left Module
- Peripheral Right Module
- OLED Display Components

b. Firmware Components:
- ZMK Core Framework
- Shield Configuration
- Keymap Definitions
- Device Tree Overlays
- Kconfig System

##### Connection and Data Flow

- Wireless communication between modules (BLE)
- Configuration flow from device tree to hardware
- Keymap implementation flow
- OLED display data path

##### Specific Implementation Details

a. Configuration Hierarchy:
**ZMK Core**
- Board Shields
- Base Configuration (ergos1.dtsi)
- Central Dongle Config
- Central Left Config
- Peripheral Configs (Left/Right)

b. Communication Architecture:
- BLE connections between modules
- Master/slave relationships
- Data flow for OLED updates

##### Important Elements to Highlight

- Shield Configuration System
- Overlay Structure
- Common Configuration Snippets
- Build System Integration
- GitHub Actions CI/CD Pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef hardware fill:#D3D3D3,stroke:#333
    classDef firmware fill:#B3D9FF,stroke:#333
    classDef config fill:#90EE90,stroke:#333
    classDef communication fill:#FFB3B3,stroke:#333
    classDef oled fill:#FFE5B4,stroke:#333
    classDef build fill:#E6E6FA,stroke:#333

    subgraph Physical
        CDM["Central Dongle Module"]:::hardware
        CLM["Central Left Module"]:::hardware
        PLM["Peripheral Left Module"]:::hardware
        PRM["Peripheral Right Module"]:::hardware
        OLED["OLED Display"]:::oled
    end

    subgraph Firmware
        ZMK["ZMK Core Framework"]:::firmware
        ZRTOS["Zephyr RTOS"]:::firmware
        BLE["Bluetooth Stack"]:::firmware
    end

    subgraph Configuration
        SC["Shield Configuration"]:::config
        KD["Keymap Definitions"]:::config
        DTO["Device Tree Overlays"]:::config
        KC["Kconfig System"]:::config
        CC["Common Configurations"]:::config
    end

    subgraph Build
        BS["Build System"]:::build
        CICD["CI/CD Pipeline"]:::build
        ZMC["ZMK Module Config"]:::build
        SM["Shield Metadata"]:::build
    end

    %% Relationships
    ZMK --> ZRTOS
    ZRTOS --> BLE
    BLE --> CDM
    BLE --> CLM
    BLE --> PLM
    BLE --> PRM
    
    SC --> CDM
    SC --> CLM
    SC --> PLM
    SC --> PRM
    
    KD --> ZMK
    DTO --> SC
    KC --> ZMK
    CC --> ZMK
    
    BS --> CICD
    ZMC --> BS
    SM --> BS

    OLED --> CLM

    %% Click Events
    click CDM "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/config/boards/shields/ergos1/ergos1_central_dongle.overlay"
    click CLM "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/config/boards/shields/ergos1/ergos1_central_left.overlay"
    click PLM "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/config/boards/shields/ergos1/ergos1_peripheral_left.overlay"
    click PRM "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/config/boards/shields/ergos1/ergos1_peripheral_right.overlay"
    click SC "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/config/boards/shields/ergos1/ergos1.dtsi"
    click KD "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/config/ergos1.keymap"
    click KC "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/config/boards/shields/ergos1/Kconfig.shield"
    click CC "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/snippets/common-config/common-config.conf"
    click BS "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/build.yaml"
    click CICD "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/.github/workflows/build.yml"
    click ZMC "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/zephyr/module.yml"
    click SM "https://github.com/hailee0710/zmk-ergo-s-1-oled/blob/main/config/boards/shields/ergos1/ergos1.zmk.yml"

    %% Legend
    classDef legend fill:#FFF,stroke:#333
    subgraph Legend
        H["Hardware Components"]:::hardware
        F["Firmware Components"]:::firmware
        C["Configuration Files"]:::config
        COM["Communication"]:::communication
        O["OLED Components"]:::oled
        B["Build System"]:::build
    end
```
