This file provides guidance to Claude Code (claude.ai/code) when working with the ProductionDeck repository.
ProductionDeck is an open-source RP2040-based Stream Deck–compatible firmware in Rust (Embassy). Multiple device profiles (Mini, Classic/Mk.2, XL, Neo, +, modules, etc.) share the same codebase; each profile selects USB PID, layout, and Legacy (Mini) vs Main/Expanded HID handling. Physical hardware is often a small key matrix + one ST7735 region unless you build a larger layout.
Current Status: Alpha - Firmware compiles successfully, ready for hardware testing.
# Check compilation without building
cargo check
# Build in debug mode
cargo build
# Build in release mode (recommended for embedded)
cargo build --release
# Format code
cargo fmt
# Run linter
cargo clippy# Clean build artifacts
cargo clean
# Update dependencies (use with caution)
cargo update
# Generate documentation
cargo doc --open- Rust Toolchain - Latest stable Rust (1.75+ recommended)
- thumbv6m-none-eabi target -
rustup target add thumbv6m-none-eabi - elf2uf2-rs -
cargo install elf2uf2-rs(for UF2 conversion) - flip-link -
cargo install flip-link(stack overflow protection)
src/bin/*.rs- One binary per target device (mini,xl,mk2,neo,plus-xl, …)src/lib.rs- Library root (productiondeckcrate)src/config.rs- Hardware configuration constants and pin assignmentssrc/device/mod.rs- USB PID, layout, and protocol family perDevicesrc/protocol/v1.rs/v2.rs/module_6.rs- HID protocol handlerssrc/usb.rs- USB HID class and routing to protocol + channelssrc/display.rs- Display handling and graphics renderingsrc/buttons.rs- Button matrix / direct scanning
Cargo.toml- Rust project manifest and dependencies.cargo/config.toml- Build configuration and target settingsmemory.x- RP2040 memory layout for linkerbuild.rs- Build script for memory layout
README.md- Main project documentationLICENSE- MIT LicenseStreamDeck_Protocol_Reference.md- Protocol documentation (Elgato HID API alignment)
- Target: Raspberry Pi Pico (RP2040 dual-core ARM Cortex-M0+)
- USB Identity: VID
0x0FD9(Elgato); PID depends on selectedDevice(seesrc/device/mod.rs) - Display: Often 1× ST7735; layout/size depend on profile (
display_config) - Buttons: Matrix or direct wiring per
hardware.rs/buttons.rs - Protocol: Legacy Mini family (
v1) or Main/Expanded family (v2) per Elgato HID docs
- Async Embassy framework: Modern Rust async/await for embedded
- Dual-core design: Core 0 handles USB/protocol, Core 1 handles displays/buttons
- USB HID interface: Stream Deck Mini (legacy) or Main protocol (JPEG + feature reports) per build
- Channel communication: Embassy channels for inter-task communication
- Hardware abstraction: Configurable pin assignments via
config.rs
RP2040 Pin Layout:
├── Buttons (Matrix Scan):
│ ├── ROW0: GP2 ┐
│ ├── ROW1: GP3 ├─ Button Matrix (3x2)
│ ├── COL0: GP4 │
│ ├── COL1: GP5 │
│ └── COL2: GP6 ┘
│
├── SPI Display (ST7735):
│ ├── MOSI: GP19 (Data)
│ ├── SCK: GP18 (Clock)
│ ├── DC: GP14 (Data/Command)
│ ├── RST: GP15 (Reset)
│ ├── CS: GP8 (Chip Select)
│ └── BLK: GP17 (Backlight PWM)
│
├── Control:
│ ├── Status LED: GP25 (Built-in)
│ ├── USB LED: GP20 (Connection status)
│ └── Error LED: GP21 (Error indication)
│
└── Debug:
├── UART TX: GP0 (Debug output)
└── UART RX: GP1 (Debug input)
The device implements StreamDeck Mini's exact USB HID protocol:
- Input reports: Button states (6 bytes for 6 keys)
- Output reports: Image data packets (1024 bytes)
- Feature reports: Commands (brightness, reset, version)
- Embassy USB stack with usbd-hid for HID functionality
- VID: 0x0fd9 (Elgato Systems)
- PID: 0x0063 (StreamDeck Mini)
- Class: HID (Human Interface Device)
- Image format: 80x80 pixels, RGB565 color format
embassy-rp- RP2040 hardware abstractionembassy-usb- USB stack implementationembassy-time- Time and timer functionalityembassy-executor- Async executorembassy-sync- Synchronization primitives
embedded-hal/embedded-hal-async- Hardware abstraction layerembedded-hal-bus- Bus abstraction for SPI
st7735-lcd- ST7735 display driverembedded-graphics- Graphics primitives
usbd-hid- USB HID device implementation
heapless- No-alloc data structuresdefmt- Debug formattingdefmt-rtt- RTT transport for debug output
- Target: thumbv6m-none-eabi (Cortex-M0+)
- Linker: flip-link for stack overflow protection
- Debug: RTT (Real-Time Transfer) with defmt logging
- Optimization: Release builds use size optimization (-Os)
Debug output is controlled via the DEFMT_LOG environment variable:
- Set to
debugfor detailed logging - Set to
infofor basic information - Set to
warnfor warnings only - Set to
offto disable logging
- Memory layout defined in
memory.xfor RP2040 - Boot2 section properly configured
- Stack overflow protection enabled
- Version: 0.1.0
- Status: Alpha - Code compiles successfully
- Build: ✅ Compilation working
- Hardware: Manual wiring required (no PCB design yet)
- Testing: Ready for hardware validation
- Check existing code structure in relevant modules
- Follow async/await patterns established in the codebase
- Use Embassy channels for inter-task communication
- Update pin assignments in
config.rsif needed - Test with
cargo checkbefore committing
- Use
defmtlogging for debug output - Check UART output on GP0/GP1 for debug messages
- Verify USB VID/PID match StreamDeck Mini exactly
- Test button matrix wiring and SPI connections
- Update pin assignments in
src/config.rs - Ensure pin conflicts are avoided
- Test with
cargo checkto verify compilation - Update documentation if pin layout changes
All USB descriptors and protocol handling must exactly match StreamDeck Mini for software compatibility. Changes to VID/PID or protocol structure will break compatibility with official StreamDeck software.
- Raspberry Pi Pico (RP2040)
- 1x ST7735 TFT display (80x80 pixels)
- 6x tactile switches
- Basic passive components (resistors, capacitors)
- Optional: Status LEDs, enclosure
This project is not affiliated with Elgato Systems. StreamDeck is a trademark of Elgato Systems. This project implements a compatible device through reverse engineering for educational and interoperability purposes.