2025-09-28 18:53:23 +02:00
2025-09-21 21:39:54 +02:00
2025-11-08 19:29:11 +01:00
2025-11-08 19:29:11 +01:00
2025-09-21 21:40:17 +02:00
2023-06-05 11:27:37 +00:00
2025-03-13 22:48:58 +01:00
2023-06-05 11:21:09 +00:00

CMDR Keyboard (swedish layout)

This HW(PCB) was original made for use with the TeensyLC module and is reused by patching it to fit the rp2040-zero module

image

Layout

 Layer 0
 ---------------------------------------      ---------------------------------------
 |  Tab  |  Q  |  W  |  E  |  R  |  T  |      |  Y  |  U  |  I  |  O  |  P  |   Å   |
 | LCtrl |  A  |  S  |  D  |  F  |  G  |      |  H  |  J  |  K  |  L  |  Ö  |   Ä   |
 | Shift |  Z  |  X  |  C  |  V  |  B  |      |  N  |  M  | ,;  | .:  | -_  | Shift |
 --------------------| Alt | Fn  | Spc |      |Enter| Fn  |AG+Fn|--------------------
                     -------------------      -------------------
 Layer 1 (Fn)
 ---------------------------------------      ---------------------------------------
 |  Esc  | F1  | F2  | F3  | F4  | F5  |      | F6  | F7  | F8  | F9  | F10 |  BSpc |
 | LCtrl | 1!  | 2"@ | 3#£ | 4¤$ | 5%  |      | 6&  | 7/{ | 8([ | 9)] | 0=} | Enter |
 | Shift | 6&  | 7/{ | 8([ | 9)] | 0=} |      | <>| | ´`± | '*´ | ¨^~ | +?\ | Shift |
 --------------------| Alt | Fn  | Spc |      | BSpc| Fn  |AG+Fn|--------------------
                     -------------------      -------------------
 Layer 2 (Fn + Fn)
 ---------------------------------------      ---------------------------------------
 |  Esc  | F11 | F12 | F13 | F14 |PrSrc|      |  §  | SLk | Gui | OSLk| CpLk|  BSpc |
 | LCtrl | F15 | F16 | F17 | F18 | F19 |      | Left| Down| Up  |Right| Del | Enter |
 | Shift | F20 | F21 | F22 | F23 | F24 |      | Home| PgD | PgU | End | Ins | Shift |
 --------------------| Alt | Fn  | Spc |      | BSpc| Fn  |AG+Fn|--------------------
                     -------------------      -------------------

Firmware features

  • 42 key split layout (36 finger keys + 6 thumb keys) with a Swedish-centric NKRO HID mapping across three layers.
  • Function layer system with two Fn keys (40/43/44) enabling sticky lock, OS lock and deep modifier combos without ghosting.
  • High-speed matrix scanning (250µs cadence) with scan-based debounce, per-key press spacing protection and idle/suspend rate throttling.
  • Bootloader entry options including Fn+Fn+LCtrl+LShift+RShift runtime chord and power-on detection on button index 0.
  • Status LED heartbeat carried over from the earlier CMDR firmware: startup heartbeat, activity/idle transitions, sticky-state colors, Caps Lock flash, suspend blanking and error signalling.
  • Power-aware USB handling that drops scan frequency 20× during suspend while honouring wake-on-input and immediate resume.

Development workflow

Recurring tasks are defined in the root Justfile:

  • Build-check the embedded target: just check
  • Run host-side tests: just test
  • Remove build artifacts: just clean
  • Build and copy a UF2 to a mounted RP2040: just flash (auto-detects /Volumes/*, /media/*, /run/media/*; override with mount=/path and optional timeout=30 seconds)
  • Build, then transfer a UF2 over SSH: just flash-ssh target=user@host mount=/media/user/RPI-RP2

The flash recipes rely on python3, the bundled rp2040/uf2conv.py, tools/copy_uf2.py, and cargo objcopy (install with rustup component add llvm-tools-preview and cargo install cargo-binutils). For SSH transfers you also need passwordless access or supply a key path, e.g. just flash-ssh target=user@host mount=/media/user/RPI-RP2 key=~/.ssh/id_ed25519.

Build environment rp2040 Zero

Rust embedded, rp2040 HAL

  • Cargo (cargo.toml)
    • rustup target add thumbv6m-none-eabi
    • Use install script to flash device
  • Flashing via rp2040 USB bootloader
    • Pressing reset/boot button on rp2040 Zero board
    • Pressing upper left corner on the keyboard when connecting the usb cable
    • Pressing Fn+Fn+Shift+Shift+Ctrl

Hardware

Schematics
patch instruction


Description
No description provided
Readme GPL-2.0 95 MiB
Languages
Rust 79.2%
Python 17.9%
Just 2.9%