# anthonyhfm/launchpad-core-firmware architecture

> Architecture diagram of the GitHub repository anthonyhfm/launchpad-core-firmware, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anthonyhfm/launchpad-core-firmware
- Repository: https://github.com/anthonyhfm/launchpad-core-firmware

## Overview

CoreFW is custom firmware for the Novation Launchpad family. Its principal runtime path is device input through a model-specific driver and the application host, into an active mode that updates LED state and sends MIDI; the driver presents output to the hardware. The README also documents DAW/session control, setup, palette editing, programmer and performance modes, custom palettes, boot animation, and Pro Mk3 Roadrunner support. Several mode and driver relationships are documented or indexed but not fully excerpted, so those links are marked unverified rather than treated as inspected calls.

Main entry points: [`src/app/host.rs`](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/host.rs) (App host), [`src/sys/driver/mod.rs`](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/mod.rs) (Device drivers), [`src/sys/led.rs`](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/led.rs) (LED state), [`src/sys/settings.rs`](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/settings.rs) (Settings storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_host["App host<br/>[host.rs]"]
  node_app_trait["App interface<br/>[apptrait.rs]"]
  node_events["Input events<br/>[events.rs]"]
end

subgraph group_modes["User modes"]
  node_boot["Boot animation<br/>[mod.rs]"]
  node_setup["Setup pages<br/>[mod.rs]"]
  node_daw["DAW mode<br/>[mod.rs]"]
  node_daw_profile["DAW profiles<br/>[profile.rs]"]
  node_daw_protocol["DAW protocol<br/>[protocol.rs]"]
  node_performance["Performance mode<br/>[mod.rs]"]
  node_programmer["Programmer mode<br/>[mod.rs]"]
  node_palette_editor["Palette editor<br/>[mod.rs]"]
end

subgraph group_device["Device I/O"]
  node_drivers["Device drivers<br/>[mod.rs]"]
  node_pro_mk3_runtime["Pro Mk3 runtime<br/>[runtime.rs]"]
  node_pro_runtime["Pro runtime<br/>[runtime.rs]"]
  node_mk2_driver["Mk2 driver<br/>[mod.rs]"]
  node_legacy_driver["S / Mini driver<br/>[mod.rs]"]
  node_usb_midi["USB MIDI<br/>[midi.rs]"]
  node_usb_control["USB control<br/>[control.rs]"]
end

subgraph group_shared["Shared services"]
  node_leds["LED state<br/>[led.rs]"]
  node_settings[("Settings storage<br/>[settings.rs]")]
  node_palette_data["Color palettes<br/>[palette.rs]"]
  node_layout["Grid layout<br/>[layout.rs]"]
  node_device_model["Device model<br/>[device.rs]"]
  node_rotation["Grid rotation<br/>[rotation.rs]"]
end

subgraph group_integrations["Device integrations"]
  node_sysex["SysEx features<br/>[mod.rs]"]
  node_roadrunner["Roadrunner LEDs<br/>[roadrunner.rs]"]
end

node_launchpad(("Launchpad"))

node_launchpad -.->|"sends input"| node_drivers
node_drivers -.->|"dispatches events"| node_host
node_host -.->|"routes input"| node_events
node_host -.->|"dispatches to"| node_app_trait
node_host -->|"selects mode"| node_boot
node_host -->|"selects mode"| node_setup
node_host -->|"selects mode"| node_daw
node_host -->|"selects mode"| node_performance
node_host -->|"selects mode"| node_programmer
node_host -->|"selects mode"| node_palette_editor
node_daw -->|"uses profiles"| node_daw_profile
node_daw -->|"handles protocol"| node_daw_protocol
node_boot -->|"renders animation"| node_leds
node_setup -.->|"updates settings"| node_settings
node_palette_editor -->|"renders controls"| node_leds
node_palette_editor -->|"edits palettes"| node_settings
node_performance -->|"maps grid input"| node_layout
node_performance -->|"sets palette LEDs"| node_leds
node_performance -->|"reads options"| node_settings
node_daw -.->|"renders session"| node_leds
node_daw -.->|"reads settings"| node_settings
node_leds -->|"maps palette colors"| node_palette_data
node_leds -->|"transforms indices"| node_rotation
node_leds -->|"sets hardware LEDs"| node_drivers
node_settings -->|"reads and writes flash"| node_drivers
node_settings -->|"initializes palettes"| node_palette_data
node_drivers -.->|"installs runtime"| node_pro_mk3_runtime
node_drivers -.->|"installs runtime"| node_pro_runtime
node_drivers -.->|"selects model driver"| node_mk2_driver
node_drivers -.->|"selects model driver"| node_legacy_driver
node_pro_mk3_runtime -.->|"uses USB MIDI"| node_usb_midi
node_usb_midi -.->|"exchanges MIDI"| node_launchpad
node_host -.->|"routes SysEx"| node_sysex
node_pro_mk3_runtime -.->|"supports high-speed LEDs"| node_roadrunner

click node_host "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/host.rs"
click node_app_trait "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/apptrait.rs"
click node_events "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/events.rs"
click node_boot "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/boot/mod.rs"
click node_setup "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/setup/mod.rs"
click node_daw "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/daw/mod.rs"
click node_daw_profile "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/daw/profile.rs"
click node_daw_protocol "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/daw/protocol.rs"
click node_performance "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/performance/mod.rs"
click node_programmer "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/programmer/mod.rs"
click node_palette_editor "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/palette_editor/mod.rs"
click node_drivers "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/mod.rs"
click node_pro_mk3_runtime "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/launchpad-pro-mk3/runtime.rs"
click node_pro_runtime "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/launchpad-pro/runtime.rs"
click node_mk2_driver "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/launchpad-mk2/mod.rs"
click node_legacy_driver "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/launchpad-s-and-mini/mod.rs"
click node_usb_midi "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/common/usb/midi.rs"
click node_usb_control "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/common/usb/control.rs"
click node_leds "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/led.rs"
click node_settings "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/settings.rs"
click node_palette_data "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/utils/palette.rs"
click node_layout "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/utils/layout.rs"
click node_device_model "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/utils/device.rs"
click node_rotation "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/rotation.rs"
click node_sysex "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/sysex/mod.rs"
click node_roadrunner "https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/sysex/roadrunner.rs"

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_host,node_app_trait,node_events toneBlue
class node_boot,node_setup,node_daw,node_daw_profile,node_daw_protocol,node_performance,node_programmer,node_palette_editor toneAmber
class node_drivers,node_pro_mk3_runtime,node_pro_runtime,node_mk2_driver,node_legacy_driver,node_usb_midi,node_usb_control toneMint
class node_leds,node_settings,node_palette_data,node_layout,node_device_model,node_rotation toneRose
class node_sysex,node_roadrunner,node_launchpad toneIndigo
```

## Components

### App runtime

- [App host](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/host.rs): `src/app/host.rs`
- [App interface](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/apptrait.rs): `src/app/apptrait.rs`
- [Input events](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/events.rs): `src/app/events.rs`

### User modes

- [Boot animation](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/boot/mod.rs): `src/app/boot/mod.rs`
- [Setup pages](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/setup/mod.rs): `src/app/setup/mod.rs`
- [DAW mode](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/daw/mod.rs): `src/app/daw/mod.rs`
- [DAW profiles](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/daw/profile.rs): `src/app/daw/profile.rs`
- [DAW protocol](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/daw/protocol.rs): `src/app/daw/protocol.rs`
- [Performance mode](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/performance/mod.rs): `src/app/performance/mod.rs`
- [Programmer mode](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/programmer/mod.rs): `src/app/programmer/mod.rs`
- [Palette editor](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/app/palette_editor/mod.rs): `src/app/palette_editor/mod.rs`

### Device I/O

- [Device drivers](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/mod.rs): `src/sys/driver/mod.rs`
- [Pro Mk3 runtime](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/launchpad-pro-mk3/runtime.rs): `src/sys/driver/launchpad-pro-mk3/runtime.rs`
- [Pro runtime](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/launchpad-pro/runtime.rs): `src/sys/driver/launchpad-pro/runtime.rs`
- [Mk2 driver](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/launchpad-mk2/mod.rs): `src/sys/driver/launchpad-mk2/mod.rs`
- [S / Mini driver](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/launchpad-s-and-mini/mod.rs): `src/sys/driver/launchpad-s-and-mini/mod.rs`
- [USB MIDI](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/common/usb/midi.rs): `src/sys/driver/common/usb/midi.rs`
- [USB control](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/driver/common/usb/control.rs): `src/sys/driver/common/usb/control.rs`

### Shared services

- [LED state](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/led.rs): `src/sys/led.rs`
- [Settings storage](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/settings.rs): `src/sys/settings.rs`
- [Color palettes](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/utils/palette.rs): `src/utils/palette.rs`
- [Grid layout](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/utils/layout.rs): `src/utils/layout.rs`
- [Device model](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/utils/device.rs): `src/utils/device.rs`
- [Grid rotation](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/rotation.rs): `src/sys/rotation.rs`

### Device integrations

- [SysEx features](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/sysex/mod.rs): `src/sys/sysex/mod.rs`
- [Roadrunner LEDs](https://github.com/anthonyhfm/launchpad-core-firmware/blob/code/src/sys/sysex/roadrunner.rs): `src/sys/sysex/roadrunner.rs`

### Other components

- **Launchpad**

## Connections

- Launchpad → Device drivers: sends input
- Device drivers → App host: dispatches events
- App host → Input events: routes input (evidence: `src/app/host.rs`)
- App host → App interface: dispatches to (evidence: `src/app/host.rs`)
- App host → Boot animation: selects mode (evidence: `src/app/host.rs`)
- App host → Setup pages: selects mode (evidence: `src/app/host.rs`)
- App host → DAW mode: selects mode (evidence: `src/app/host.rs`)
- App host → Performance mode: selects mode (evidence: `src/app/host.rs`)
- App host → Programmer mode: selects mode (evidence: `src/app/host.rs`)
- App host → Palette editor: selects mode (evidence: `src/app/host.rs`)
- DAW mode → DAW profiles: uses profiles (evidence: `src/app/daw/mod.rs`)
- DAW mode → DAW protocol: handles protocol (evidence: `src/app/daw/mod.rs`)
- Boot animation → LED state: renders animation (evidence: `src/app/boot/mod.rs`)
- Setup pages → Settings storage: updates settings (evidence: `src/app/setup/mod.rs`)
- Palette editor → LED state: renders controls (evidence: `src/app/palette_editor/mod.rs`)
- Palette editor → Settings storage: edits palettes (evidence: `src/app/palette_editor/mod.rs`)
- Performance mode → Grid layout: maps grid input (evidence: `src/app/performance/mod.rs`)
- Performance mode → LED state: sets palette LEDs (evidence: `src/app/performance/mod.rs`)
- Performance mode → Settings storage: reads options (evidence: `src/app/performance/mod.rs`)
- DAW mode → LED state: renders session (evidence: `src/app/daw/mod.rs`)
- DAW mode → Settings storage: reads settings (evidence: `src/app/daw/mod.rs`)
- LED state → Color palettes: maps palette colors (evidence: `src/sys/led.rs`)
- LED state → Grid rotation: transforms indices (evidence: `src/sys/led.rs`)
- LED state → Device drivers: sets hardware LEDs (evidence: `src/sys/led.rs`)
- Settings storage → Device drivers: reads and writes flash (evidence: `src/sys/settings.rs`)
- Settings storage → Color palettes: initializes palettes (evidence: `src/sys/settings.rs`)
- Device drivers → Pro Mk3 runtime: installs runtime (evidence: `src/sys/driver/launchpad-pro-mk3/runtime.rs`)
- Device drivers → Pro runtime: installs runtime (evidence: `src/sys/driver/mod.rs`)
- Device drivers → Mk2 driver: selects model driver (evidence: `src/sys/driver/mod.rs`)
- Device drivers → S / Mini driver: selects model driver (evidence: `src/sys/driver/mod.rs`)
- Pro Mk3 runtime → USB MIDI: uses USB MIDI (evidence: `src/sys/driver/launchpad-pro-mk3/runtime.rs`)
- USB MIDI → Launchpad: exchanges MIDI
- App host → SysEx features: routes SysEx (evidence: `src/app/host.rs`)
- Pro Mk3 runtime → Roadrunner LEDs: supports high-speed LEDs
