# sb-ocr/cmdeck architecture

> Architecture diagram of the GitHub repository sb-ocr/cmdeck, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sb-ocr/cmdeck
- Repository: https://github.com/sb-ocr/cmdeck

## Overview

CM Deck is an open-hardware clamshell cyberdeck built around a Raspberry Pi Compute Module 5, with a custom carrier board, low-profile mechanical keyboard, enclosure, and QMK firmware. A builder uses the documented board designs, bills of materials, fabrication files, and enclosure exports to assemble the device; during use, keyboard input is mapped by firmware and sent to the host. The tree shows separate keyboard and main-board design/fabrication assets. Firmware behavior is based on the sampled keymap and configuration; other subsystem connections are not inferred from filenames alone.

Main entry points: [`firmware/qmk/cmdeck/keymaps/default/keymap.c`](https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/cmdeck/keymaps/default/keymap.c) (QMK keymap), [`pcbs/keyboard/src/Keyboard _Board.brd`](https://github.com/sb-ocr/cmdeck/blob/main/pcbs/keyboard/src/Keyboard%20_Board.brd) (Keyboard design), [`pcbs/main board/src/Main Board _Board.brd`](https://github.com/sb-ocr/cmdeck/blob/main/pcbs/main%20board/src/Main%20Board%20_Board.brd) (Main board design), [`firmware/qmk/cmdeck/config.h`](https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/cmdeck/config.h) (QMK configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boards["Circuit boards"]
  node_keyboard_design["Keyboard design"]
  node_keyboard_fab["Keyboard fabrication"]
  node_main_design["Main board design"]
  node_main_fab["Main board fabrication"]
end

subgraph group_firmware["Keyboard firmware"]
  node_keymap["QMK keymap<br/>[keymap.c]"]
  node_qmk_config["QMK configuration<br/>[config.h]"]
  node_mcu_config["MCU SPI config<br/>[mcuconf.h]"]
  node_firmware_docs["QMK board setup<br/>[readme.md]"]
end

subgraph group_mechanical["Enclosure"]
  node_enclosure_stl["Enclosure parts"]
end

subgraph group_build["Build references"]
  node_project_bom["Project bills"]
  node_keyboard_bom["Keyboard BOM<br/>[ibom.html]"]
  node_main_bom["Main board BOM<br/>[ibom.html]"]
end

node_builder(("Builder"))
node_compute["Compute Module 5"]
node_host["Cyberdeck host"]

node_builder -->|"uses to build"| node_keyboard_fab
node_builder -->|"uses to build"| node_main_fab
node_builder -->|"uses to build"| node_enclosure_stl
node_builder -->|"consults"| node_project_bom
node_builder -->|"consults"| node_keyboard_bom
node_builder -->|"consults"| node_main_bom
node_keyboard_design -->|"fabrication data"| node_keyboard_fab
node_main_design -->|"fabrication data"| node_main_fab
node_keyboard_design -->|"keyboard layout"| node_keymap
node_keymap -->|"sends key events"| node_host
node_compute -->|"carrier board design"| node_main_design
node_compute -->|"runs cyberdeck"| node_host
node_firmware_docs -->|"documents setup"| node_keymap
node_qmk_config -->|"configures features"| node_keymap
node_mcu_config -->|"configures SPI"| node_qmk_config

click node_keyboard_design "https://github.com/sb-ocr/cmdeck/blob/main/pcbs/keyboard/src/Keyboard%20_Board.brd"
click node_keyboard_fab "https://github.com/sb-ocr/cmdeck/tree/main/pcbs/keyboard/fab"
click node_main_design "https://github.com/sb-ocr/cmdeck/blob/main/pcbs/main%20board/src/Main%20Board%20_Board.brd"
click node_main_fab "https://github.com/sb-ocr/cmdeck/tree/main/pcbs/main%20board/fab"
click node_keymap "https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/cmdeck/keymaps/default/keymap.c"
click node_qmk_config "https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/cmdeck/config.h"
click node_mcu_config "https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/cmdeck/mcuconf.h"
click node_firmware_docs "https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/readme.md"
click node_enclosure_stl "https://github.com/sb-ocr/cmdeck/tree/main/enclosure/exports/STL"
click node_project_bom "https://github.com/sb-ocr/cmdeck/tree/main/boms"
click node_keyboard_bom "https://github.com/sb-ocr/cmdeck/blob/main/pcbs/keyboard/bom/ibom.html"
click node_main_bom "https://github.com/sb-ocr/cmdeck/blob/main/pcbs/main%20board/bom/ibom.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_keyboard_design,node_keyboard_fab,node_main_design,node_main_fab toneBlue
class node_keymap,node_qmk_config,node_mcu_config,node_firmware_docs toneAmber
class node_enclosure_stl toneMint
class node_project_bom,node_keyboard_bom,node_main_bom toneRose
class node_builder,node_compute,node_host toneIndigo
```

## Components

### Circuit boards

- [Keyboard design](https://github.com/sb-ocr/cmdeck/blob/main/pcbs/keyboard/src/Keyboard%20_Board.brd): `pcbs/keyboard/src/Keyboard _Board.brd`
- [Keyboard fabrication](https://github.com/sb-ocr/cmdeck/tree/main/pcbs/keyboard/fab): `pcbs/keyboard/fab`
- [Main board design](https://github.com/sb-ocr/cmdeck/blob/main/pcbs/main%20board/src/Main%20Board%20_Board.brd): `pcbs/main board/src/Main Board _Board.brd`
- [Main board fabrication](https://github.com/sb-ocr/cmdeck/tree/main/pcbs/main%20board/fab): `pcbs/main board/fab`

### Keyboard firmware

- [QMK keymap](https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/cmdeck/keymaps/default/keymap.c): `firmware/qmk/cmdeck/keymaps/default/keymap.c`
- [QMK configuration](https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/cmdeck/config.h): `firmware/qmk/cmdeck/config.h`
- [MCU SPI config](https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/cmdeck/mcuconf.h): `firmware/qmk/cmdeck/mcuconf.h`
- [QMK board setup](https://github.com/sb-ocr/cmdeck/blob/main/firmware/qmk/readme.md): `firmware/qmk/readme.md`

### Enclosure

- [Enclosure parts](https://github.com/sb-ocr/cmdeck/tree/main/enclosure/exports/STL): `enclosure/exports/STL`

### Build references

- [Project bills](https://github.com/sb-ocr/cmdeck/tree/main/boms): `boms`
- [Keyboard BOM](https://github.com/sb-ocr/cmdeck/blob/main/pcbs/keyboard/bom/ibom.html): `pcbs/keyboard/bom/ibom.html`
- [Main board BOM](https://github.com/sb-ocr/cmdeck/blob/main/pcbs/main%20board/bom/ibom.html): `pcbs/main board/bom/ibom.html`

### Other components

- **Builder**
- **Compute Module 5**
- **Cyberdeck host**

## Connections

- Builder → Keyboard fabrication: uses to build
- Builder → Main board fabrication: uses to build
- Builder → Enclosure parts: uses to build
- Builder → Project bills: consults
- Builder → Keyboard BOM: consults
- Builder → Main board BOM: consults
- Keyboard design → Keyboard fabrication: fabrication data
- Main board design → Main board fabrication: fabrication data
- Keyboard design → QMK keymap: keyboard layout
- QMK keymap → Cyberdeck host: sends key events
- Compute Module 5 → Main board design: carrier board design
- Compute Module 5 → Cyberdeck host: runs cyberdeck
- QMK board setup → QMK keymap: documents setup
- QMK configuration → QMK keymap: configures features
- MCU SPI config → QMK configuration: configures SPI
