- Keyboard/Mouse Mode: 7 customizable buttons + dual-knob mouse control
- Gamepad Mode: HID gamepad with dual analog axes
- Key Remapping: Online configuration via web tool (https://keymapper.phdesign.cc/)
- START Button Protection: Configurable protection time (100ms/250ms/500ms) to prevent accidental presses
- Macro Support: Triple-click START to trigger custom macro sequences
- RGB Lighting: Independent RGB control for each button
- Dual Rotary Encoders: High-precision quadrature decoding with PIO
- Button Debouncing: Hardware-level debouncing with multiple modes
- WS2812B RGB: DMA-driven efficient RGB LED control
- USB HID: Multi-interface device (Keyboard + Mouse + Gamepad + Raw HID)
Modify pin assignments in
config.hto match your hardware
-
Install Pico SDK
# Recommended: Use VS Code Raspberry Pi Pico extension # It automatically installs SDK, toolchain, and picotool
-
Clone Repository
git clone https://github.com/ph-design/PHAC_Firmware.git cd PHAC_Firmware
Method 1: VS Code (Recommended)
- Install "Raspberry Pi Pico" extension
- Open project folder
- Press
Ctrl+Shift+P, selectRaspberry Pi Pico: Compile Project - Find
build/PHAC-Firmware.uf2after compilation
Method 1: UF2 Upload (Easiest)
- Hold BOOTSEL button on Pico
- Connect USB cable to PC
- Pico appears as USB storage device
- Drag
PHAC-Firmware.uf2to the device - Automatically reboots when complete
Visit https://keymapper.phdesign.cc/ to configure:
- ✅ Keyboard mode key mapping
- ✅ Gamepad mode button mapping
- ✅ Custom RGB colors
- ✅ START button protection time
- ✅ Macro configuration
- ✅ One-click save to device
Boot-time Mode Selection:
- Hold Button A + plug USB → Keyboard/Mouse mode
- Hold Button B + plug USB → Gamepad mode
- Hold START + plug USB → BOOTSEL (flash mode)
Runtime Switching:
- Use web configuration tool to switch modes online
PHAC_Firmware/
├── main.c # Main program entry
├── config.h # Hardware config & defaults
├── CMakeLists.txt # CMake build config
├── modules/ # Function modules
│ ├── debounce/ # Button debouncing
│ ├── encoder/ # EC11 encoder (PIO)
│ ├── remap/ # Key mapping & config
│ ├── rgb/ # WS2812 RGB control
│ └── usb/ # USB HID descriptors
├── generated/ # PIO generated headers
└── build/ # Build output
- Basic USB HID communication
- Button debouncing
- PIO encoder driver
- WS2812 RGB support
- Key remapping
- Web configuration tool
- START button protection
- Macro support
- Key combination mapping
- More RGB animation modes
- OLED display support
This project is licensed under the MIT License - see LICENSE.TXT
Issues and Pull Requests are welcome!