# oso-cute/makcu-controller-fw architecture

> Architecture diagram of the GitHub repository oso-cute/makcu-controller-fw, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oso-cute/makcu-controller-fw
- Repository: https://github.com/oso-cute/makcu-controller-fw

## Overview

MAKCM is a dual-ESP32-S3 controller passthrough with a Python accessibility control layer. The principal path is a physical controller handled by the Right MCU, forwarded over UART IPC to the Left MCU, and presented to a PC or console as a USB device. Python tools use the Left MCU’s serial command channel for accessibility controls and telemetry. README capabilities are included where their implementation details were not sampled; those links are marked unverified when source evidence is unavailable.

Main entry points: [`accessibility/makcu_access.py`](https://github.com/oso-cute/makcu-controller-fw/blob/main/accessibility/makcu_access.py) (Serial Command API), [`firmware/MAKCM_ESP32s3_Pass_Right/src/ipc.cpp`](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Right/src/ipc.cpp) (Right IPC), [`firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/ipc.c`](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/ipc.c) (Left IPC), [`firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/pass_usb_device.c`](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/pass_usb_device.c) (USB Device Passthrough)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_usb_host["Right MCU Host"]
  node_right_host["USB Host<br/>[PassUsbHost.cpp]"]
  node_right_entry["Right Entry<br/>[main.cpp]"]
end

subgraph group_ipc["UART IPC"]
  node_right_ipc["Right IPC<br/>[ipc.cpp]"]
  node_ipc_protocol["Frame Protocol<br/>[pass_ipc.h]"]
  node_left_ipc["Left IPC<br/>[ipc.c]"]
end

subgraph group_usb_device["Left MCU Device"]
  node_left_entry["Left Entry<br/>[main.c]"]
  node_usb_device["USB Device Passthrough<br/>[pass_usb_device.c]"]
  node_km_inject["Input Processing<br/>[km_inject.c]"]
end

subgraph group_accessibility["Accessibility Tools"]
  node_gui["Control GUI<br/>[makcu_gui.py]"]
  node_serial_api["Serial Command API<br/>[makcu_access.py]"]
  node_monitor["Tremor Monitor<br/>[makcu_monitor.py]"]
  node_button_mapper["Button Mapper<br/>[button_mapper.py]"]
  node_telemetry["Controller Telemetry<br/>[km_inject.c]"]
end

node_controller(("Controller"))
node_target(("PC or Console"))
node_user(("Accessibility User"))

node_controller -->|"connects USB"| node_right_host
node_right_entry -->|"starts host"| node_right_host
node_right_host -.->|"forwards transfers"| node_right_ipc
node_right_entry -->|"dispatches frames"| node_right_ipc
node_right_ipc -->|"encodes frames"| node_ipc_protocol
node_left_ipc -.->|"decodes frames"| node_ipc_protocol
node_right_ipc -->|"sends over UART"| node_left_ipc
node_left_entry -.->|"handles frames"| node_left_ipc
node_left_ipc -.->|"forwards input"| node_usb_device
node_usb_device -->|"enumerates and relays"| node_target
node_left_entry -->|"manages USB lifecycle"| node_usb_device
node_serial_api -.->|"sends control commands"| node_km_inject
node_km_inject -.->|"modifies controller input"| node_usb_device
node_km_inject -.->|"provides telemetry"| node_telemetry
node_user -->|"operates"| node_gui
node_gui -->|"uses command API"| node_serial_api
node_monitor -->|"reads telemetry"| node_serial_api
node_button_mapper -->|"maps button bits"| node_serial_api
node_serial_api -.->|"commands over serial"| node_left_entry

click node_right_host "https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Right/src/PassUsbHost.cpp"
click node_right_entry "https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Right/src/main.cpp"
click node_right_ipc "https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Right/src/ipc.cpp"
click node_ipc_protocol "https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Right/include/pass_ipc.h"
click node_left_ipc "https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/ipc.c"
click node_left_entry "https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/main.c"
click node_usb_device "https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/pass_usb_device.c"
click node_km_inject "https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/km_inject.c"
click node_gui "https://github.com/oso-cute/makcu-controller-fw/blob/main/accessibility/makcu_gui.py"
click node_serial_api "https://github.com/oso-cute/makcu-controller-fw/blob/main/accessibility/makcu_access.py"
click node_monitor "https://github.com/oso-cute/makcu-controller-fw/blob/main/accessibility/makcu_monitor.py"
click node_button_mapper "https://github.com/oso-cute/makcu-controller-fw/blob/main/tools/button_mapper.py"
click node_telemetry "https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/km_inject.c"

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_right_host,node_right_entry,node_user toneBlue
class node_right_ipc,node_ipc_protocol,node_left_ipc toneAmber
class node_left_entry,node_usb_device,node_km_inject toneMint
class node_gui,node_serial_api,node_monitor,node_button_mapper,node_telemetry toneRose
class node_controller,node_target toneIndigo
```

## Components

### Right MCU Host

- [USB Host](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Right/src/PassUsbHost.cpp): `firmware/MAKCM_ESP32s3_Pass_Right/src/PassUsbHost.cpp`
- [Right Entry](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Right/src/main.cpp): `firmware/MAKCM_ESP32s3_Pass_Right/src/main.cpp`

### UART IPC

- [Right IPC](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Right/src/ipc.cpp): `firmware/MAKCM_ESP32s3_Pass_Right/src/ipc.cpp`
- [Frame Protocol](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Right/include/pass_ipc.h): `firmware/MAKCM_ESP32s3_Pass_Right/include/pass_ipc.h`
- [Left IPC](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/ipc.c): `firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/ipc.c`

### Left MCU Device

- [Left Entry](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/main.c): `firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/main.c`
- [USB Device Passthrough](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/pass_usb_device.c): `firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/pass_usb_device.c`
- [Input Processing](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/km_inject.c): `firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/km_inject.c`

### Accessibility Tools

- [Control GUI](https://github.com/oso-cute/makcu-controller-fw/blob/main/accessibility/makcu_gui.py): `accessibility/makcu_gui.py`
- [Serial Command API](https://github.com/oso-cute/makcu-controller-fw/blob/main/accessibility/makcu_access.py): `accessibility/makcu_access.py`
- [Tremor Monitor](https://github.com/oso-cute/makcu-controller-fw/blob/main/accessibility/makcu_monitor.py): `accessibility/makcu_monitor.py`
- [Button Mapper](https://github.com/oso-cute/makcu-controller-fw/blob/main/tools/button_mapper.py): `tools/button_mapper.py`
- [Controller Telemetry](https://github.com/oso-cute/makcu-controller-fw/blob/main/firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/km_inject.c): `firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/km_inject.c`

### Other components

- **Controller**
- **PC or Console**
- **Accessibility User**

## Connections

- Controller → USB Host: connects USB (evidence: `README.md`)
- Right Entry → USB Host: starts host (evidence: `firmware/MAKCM_ESP32s3_Pass_Right/src/main.cpp`)
- USB Host → Right IPC: forwards transfers (evidence: `firmware/MAKCM_ESP32s3_Pass_Right/src/PassUsbHost.cpp`)
- Right Entry → Right IPC: dispatches frames (evidence: `firmware/MAKCM_ESP32s3_Pass_Right/src/main.cpp`)
- Right IPC → Frame Protocol: encodes frames (evidence: `firmware/MAKCM_ESP32s3_Pass_Right/src/ipc.cpp`)
- Left IPC → Frame Protocol: decodes frames (evidence: `firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/ipc.c`)
- Right IPC → Left IPC: sends over UART (evidence: `README.md`)
- Left Entry → Left IPC: handles frames (evidence: `firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/main.c`)
- Left IPC → USB Device Passthrough: forwards input (evidence: `README.md`)
- USB Device Passthrough → PC or Console: enumerates and relays (evidence: `README.md`)
- Left Entry → USB Device Passthrough: manages USB lifecycle (evidence: `firmware/MAKCM_ESP32s3_Pass_Left_IDF/src/main.c`)
- Serial Command API → Input Processing: sends control commands (evidence: `README.md`)
- Input Processing → USB Device Passthrough: modifies controller input (evidence: `README.md`)
- Input Processing → Controller Telemetry: provides telemetry (evidence: `README.md`)
- Accessibility User → Control GUI: operates (evidence: `README.md`)
- Control GUI → Serial Command API: uses command API (evidence: `accessibility/makcu_gui.py`)
- Tremor Monitor → Serial Command API: reads telemetry (evidence: `accessibility/makcu_monitor.py`)
- Button Mapper → Serial Command API: maps button bits (evidence: `tools/button_mapper.py`)
- Serial Command API → Left Entry: commands over serial (evidence: `README.md`)
