
Clavier
lsartory/Clavier
An FPGA-based mechanical keyboard with an integrated USB hub and communication interfaces

H₂H³ | Twin USB Host Switch × Triple USB Hub (with OLED Telemetry)
Twinusb.kicad is an open-source printed circuit board by s-t-e-f-a-n, from the s-t-e-f-a-n/twinusb repository on GitHub. It is a 4-layer board of 63 × 20 mm with 120 parts on 85 nets, routed with 1,630 tracks and 222 vias.
It is built around the STM32G0B1KBU6, GL852G-OHY60 and USBLC6-2P6, with the TPS2553DRVR-1, FSUSB42MUX and TPS2116DRL among its other parts. Its parts include 48 capacitors, 45 resistors, 14 ICs, 7 connectors and 2 diodes. It belongs with the lEDs and displays and interfaces and adapters boards and the STM32 boards of this library.
H₂H³ is a compact, STM32 microcontroller-driven USB 2.0 KVM switch and 3-port hub designed to maintain a clean, clutter-free workspace in modern home offices. It enables two computers to seamlessly share a single set of peripherals—like your keyboard, mouse, and flash drives—while delivering live voltage and current telemetry via an integrated OLED display. Paired with the native Rust host daemon, H₂H³ features seamless automatic host switching as your mouse reaches the screen edge, alongside intuitive configuration directly from your system tray.
[!NOTE] Project Status & Contribution: This project is actively developed. The core KVM switching, screen-edge mouse transition, telemetry functionality, and host daemon communication are fully functional.
To bring this project to a 100% polished release, contributions from the open-source community are highly welcome! Whether you want to optimize edge-case handling in the C++ firmware, expand the Rust host daemon features, or help refine the documentation—feel free to open an issue or submit a Pull Request. Let's build this together!
🖼️ Jump straight to the Photo Gallery.
🏪 Hardware Available: Skip the assembly line and grab a fully functional H₂H³ on Tindie.
H₂H³ represents a personal exploration into modern decentralized manufacturing and open-source engineering. It blends professional design principles with modern open-source software, AI-collaborative programming to refine the C++ firmware, and on-demand fabrication. The fact that an individual engineer can now prototype industrial-grade hardware using low-volume far-east manufacturing is nothing short of incredible.
To give back to the community, the full design files—spanning schematics, mechanics, and source code—are public domain under MIT and CERN Open Hardware licenses. It is intended strictly for educational use, and community-driven remixes are highly encouraged.
The hardware, enclosure, and software for H₂H³ were designed using the following tools:
![]() | ![]() | ![]() |
Located in daemon/, this Rust application runs in the background on connected host PCs:
Located in firmware/, built using STM32CubeMX for hardware abstraction and written in C/C++:
App/).evaluateSwitchRequest) to ensure safe transition rules and prevent bus contention during edge triggers or manual button presses.printf over the STM32 USART2 or USB virtual COM port.twinusb/
├── assets/ # Public media & documentation images
├── firmware/ # Production-ready STM32G0 C/C++ firmware
│ ├── App/ # Core Application Logic (C++)
│ │ ├── Inc/ # Application Managers (Hub, Display, Sensors, UI)
│ │ └── Src/ # Implementation source code
│ ├── Core/ # Hardware peripheral initialization (ADC, I2C, GPIO)
│ ├── cmake/ # Toolchain configuration profiles
│ ├── Libs/ # Embedded drivers & hardware abstraction libraries
│ │ └── oled_waveshare/ # Low-level 0.49" 64x32 OLED display driver components
│ ├── Middlewares/ # STMicroelectronics USB Device Library stack
│ ├── Startup/ # Microcontroller boot vector assembly code
│ └── USB_Device/ # USB CDC Class configuration and descriptor maps
├── daemon/ # Rust host daemon (twinusb-daemon crate)
│ ├── src/ # Rust source code (HID communication, tray app)
│ └── Cargo.toml # Rust dependencies & package config
├── hardware/ # Electronics engineering files (KiCad)
│ ├── src/ # Rust source code (HID communication, tray app)
│ ├── lib_fp/ # Custom PCB footprint libraries (.pretty)
│ └── lib_sch/ # Custom schematic component symbols
└── enclosure/ # Mechanical 3D CAD design (FreeCAD)git clone https://github.com/s-t-e-f-a-n/twinusb.git
cd twinusblibudev-dev (if compiling natively on Linux).cd daemon
# Build for development
cargo build
# Run locally
cargo run
# Build optimized release binary
cargo build --releaseFor Windows cross-compilation from Linux:
cargo build --target x86_64-pc-windows-gnu --releaseThis project supports a dual-development workflow. You can build the firmware using either VS Code (via CMake) or the official STM32CubeIDE. Choose the workflow that best fits your environment. You do not need to use STM32CubeMX to build the project from scratch.
This method uses CMake and Ninja/Make. It requires a local ARM GCC toolchain installed on your system.
Ensure you have the following installed and available in your system's PATH:
arm-none-eabi-gccCMake and Ninja (or Make)firmware directory in VS Code.Ctrl+Shift+P / Cmd+Shift+P), search for CMake: Select a Kit, and select your installed arm-none-eabi compiler.Debug or Release from the CMake status bar at the bottom.CMake: Configure from the Command Palette. This will clean-room generate your local build/ directory with the correct absolute paths for your machine.Build in the status bar or press F7.STM32CubeIDE is an all-in-one Eclipse-based IDE that includes its own compiler toolchain and internal build system out of the box.
File ➔ Open Projects from Filesystem...Directory ➔ Choose twinusb folder and click Select Folder.Index Project: Wait a few moments for the IDE to finish indexing the source files.
Compile: Click the Hammer icon (Build) in the top toolbar, or press Ctrl+B (Cmd+B on macOS).
The core application logic of this project is written in modern C++ and lives inside the App/ directory (App/Src and App/Inc), keeping it cleanly decoupled from the autogenerated ST HAL layer.
If you decide to open the twinusb.stm32.ioc file to modify pinouts or peripherals via STM32CubeMX and click "Generate Code", the tools will reset the project workspace to ST's default pure-C template.
If your IDE loses track of the C++ files after code generation, fix it manually:
In STM32CubeIDE: Right-click the project ➔ Properties ➔ C/C++ General ➔ Paths and Symbols.
Under Includes, re-add the App/Inc directory.
Under Source Location, re-add the App/Src directory.
In VS Code: Simply run CMake: Delete Cache and Reconfigure from the Command Palette to force CMake to re-scan the file structure.
The schematics and PCB layout are located in the /hardware folder, designed in KiCad and optimized for automated assembly (PCBA) via services like JLCPCB.
Print the shell components located in the /enclosure folder. Nylon (SLS/MJF technique) is highly recommended for that professional, textured matte finish and mechanical durability.
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
This project is licensed under different Open Source licenses depending on the component:
All components are copyrighted © 2026 by s-t-e-f-a-n who developed them with ❤️
| Qty | Value | Footprint | References |
|---|---|---|---|
| 24 | 100n | Capacitor_SMD:C_0402_1005Metric | C2, C11, C14, C17, C19, C22, C24, C27, C31, C32, C33, C34, C35, C36, C37, C38 +8 |
| 11 | 100k | Resistor_SMD:R_0402_1005Metric | R12, R14, R15, R20, R29, R30, R34, R35, R38, R39, R40 |
| 10 | 10k | Resistor_SMD:R_0402_1005Metric | R2, R3, R4, R5, R10, R11, R33, R36, R37, R41 |
| 6 | 10n | Capacitor_SMD:C_0402_1005Metric | C3, C4, C5, C6, C44, C46 |
| 6 | 10u | Capacitor_SMD:C_0603_1608Metric | C7, C8, C18, C23, C28, C48 |
| 5 | 4n7 | Capacitor_SMD:C_0603_1608Metric | C1, C13, C15, C20, C25 |
| 5 | USBLC6-2P6 | Package_TO_SOT_SMD:SOT-666 | U4, U6, U8, U10, U14 |
| 4 | 1k | Resistor_SMD:R_0402_1005Metric | R9, R13, R16, R17 |
| 4 | 470R | Resistor_SMD:R_0402_1005Metric | R8, R27, R28, R31 |
| 4 | 4k7 | Resistor_SMD:R_0402_1005Metric | R42, R43, R44, R45 |
| 3 | 100u 6V3 Tantal Polymer | Capacitor_Tantalum_SMD:CP_EIA-3216-18_Kemet-A | C16, C21, C26 |
| 3 | 39m, 1%, 100ppm/K | Resistor_SMD:R_0603_1608Metric | R24, R25, R26 |
| 3 | INA180B2, 50V/V | Package_TO_SOT_SMD:SOT-23-5 | U5, U7, U9 |
| 3 | USB A, Vertical, Receptable | _twinusb:USB_A_Vertical_AMPHENOL_UE27AE54100 | J4, J5, J6 |
| 2 | 10k_DNP | Resistor_SMD:R_0402_1005Metric | R18, R19 |
| 2 | 16k9 | Resistor_SMD:R_0402_1005Metric | R21, R22 |
| 2 | 1M | Resistor_SMD:R_0402_1005Metric | R1, R23 |
| 2 | 1u | Capacitor_SMD:C_0402_1005Metric | C10, C12 |
| 2 | 22p | Capacitor_SMD:C_0402_1005Metric | C29, C30 |
| 2 | 240R | Resistor_SMD:R_0402_1005Metric | R6, R7 |
| 2 | TPS2553DRVR-1 | _twinusb:WSON-6-1EP_2x2mm_P0.65mm_EP1x1.6mm_ThermalVias | U1, U2 |
| 2 | USB A, Horizontal, Plug | _twinusb:USB_A_Horizontal_THT | J1, J7 |
| 1 | 10u, 60 mA | Inductor_SMD:L_0603_1608Metric | L1 |
| 1 | 12M | Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mm | Y1 |
| 1 | 1x4, 0.8mm, Vertical, Receptable | _twinusb:JST_SUR_BM04B-SURS-TF_1x04-1MP_P0.80mm_Vertical | J2 |
| 1 | 1x6, 0.8mm, Vertical, Receptable | _twinusb:JST_SUR_BM06B-SURS-TF_1x06-1MP_P0.80mm_Vertical | J3 |
| 1 | 680R | Resistor_SMD:R_0402_1005Metric | R32 |
| 1 | BAT54LP | _twinusb:Diodes_DFN1006-2 | D2 |
| 1 | DMN62D0LFB | _twinusb:DFN1006-3 | Q1 |
| 1 | FSUSB42MUX | Package_SO:MSOP-10_3x3mm_P0.5mm | U12 |
| 1 | GL852G-OHY60 | _twinusb:QFN-28-1EP_5x5mm_P0.5mm_EP3.75x3.75mm_ThermalVias | U11 |
| 1 | LED_ARBG | _twinusb:LED_RGB_Kingbright_APHF1608LSEEQBDZGKC | D1 |
| 1 | STM32G0B1KBUx | _twinusb:QFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm_ThermalVias | U13 |
| 1 | SW_Push_Shielded | _twinusb:SW_Tactile_SPST_Angled_PTS645Vx58-2LFS | SW1 |
| 1 | TPS2116DRL | Package_TO_SOT_SMD:SOT-583-8 | U3 |

lsartory/Clavier
An FPGA-based mechanical keyboard with an integrated USB hub and communication interfaces


yislennierm/ShellShock
This is the main repo for the mister shell shock console





hmcneill46/house-rules-led-recreation
Software attempt at recreating Rose Finn-Kelcey's House Rules
It measures 63 × 20 mm and has 4 copper layers, 1.58 mm thick.
120 parts, built around the STM32G0B1KBU6, GL852G-OHY60, USBLC6-2P6 and TPS2553DRVR-1. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the s-t-e-f-a-n/twinusb repository on GitHub, at the commit this page was made from: the board is hardware/twinusb.kicad.kicad_pcb and its schematic hardware/documentation.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask s-t-e-f-a-n before reusing the design.