Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Integration of PRK Firmware and R2P2

Avatar for hachi (Hayao Kimura) hachi (Hayao Kimura)
April 23, 2026
53

Integration of PRK Firmware and R2P2

RubyKaigi 2026

Avatar for hachi (Hayao Kimura)

hachi (Hayao Kimura)

April 23, 2026

More Decks by hachi (Hayao Kimura)

Transcript

  1. • Hayao Kimura / hachi • Working at freee K.K.

    • Came from Osaka (Kyobashi.rb) • My first son was born in March!
  2. • Hayao Kimura / hachi • Working at freee K.K.

    • Came from Osaka (Kyobashi.rb) • My first son was born in March!
  3. • Hayao Kimura / hachi • Working at freee K.K.

    • Came from Osaka (Kyobashi.rb) • My first son was born in March!
  4. Nemuro recommendations • For conveyor-belt sushi, I'm a Nemuro Hanamaru

    fan, not Kantaro. (source: Hanamaru official) • For seafood, try overnight-dried komai (source: Hokkaido Gyoren) ◦ Pairs endlessly with sake • Please try them before you head home
  5. Today's agenda • Background & problems • What's needed to

    run R2P2 as a keyboard • Implementation and results • Wrap-up & next steps
  6. PRK Firmware and R2P2 PRK Firmware R2P2 Concept Keyboard firmware

    Electronics platform First release 2021/11/10 2022/11/11 Can do Keymap config Split keyboards LED control Mouse VIA All sorts of electronics projects Can't do Gems unrelated to keyboards This is today's topic
  7. What's needed to run R2P2 as a keyboard • USB

    HID support • ws2812 (LED) integration • Split-keyboard communication • Storage reduction
  8. Problem 1: USB HID support • R2P2 didn't support USB

    HID at the time • Should be easy since it already uses TinyUSB • Personally, I want an option to disable HID
  9. hachi: When HID isn't used, I don't want the PC

    to recognize it as a keyboard — what do you think?
  10. hasumikin> You mean toggling HID on/off at runtime? Sounds pretty

    hard, and even if we pulled it off I probably wouldn't want to merge it (feels unstable) lol
  11. So I shelved the PR for now. Well, at least

    I got what I wanted for myself
  12. Any plans for the LED implementation in picoruby-keyboard? PIO is

    already on master and the idea is to use that. PicoRuby won't ship an easy "just light it up" feature — people who can code will do it themselves. ESP needs a different mechanism anyway.
  13. Wait, picoruby-pio already exists... • hasumi-san had built a way

    to drive PIO from Ruby • On top of that, chobishiba-san implemented a ws2812 gem ◦ ksbmyk/picoruby-ws2812 • → No need for me to do it
  14. Break 2 Tips: At Raymon House Motomachi, a sausage shop

    by Carl Raymon in Hakodate, you can find a sausage called Thüringer that is exclusive to that location. It's absolutely delicious and highly recommended.
  15. My proposal vs. reality Problem My proposal Reality USB HID

    Toggle via boot.rb Always enabled ws2812 Build picoruby-ws2812 Roll your own with picoruby-pio Split-keyboard communication Propose a half-duplex picogem bitbang uart Storage reduction Place runtime_gems via rake Web-based one-click install
  16. Why did this happen? • I should've opened an issue

    at the same time as my proposal • Too much overlap with what hasumi-san was doing
  17. Conclusion • You can now write keyboard firmware with R2P2

    • Lots of exciting implementations have been added — USB HID, PIO, BLE::UART, and more — so please give them a try • Time spent chasing your own curiosity is never wasted • What I learned (USB HID, runtime switching, PIO) stays with me • I'll keep contributing to PicoRuby however I can, starting tomorrow
  18. What's next • Keyboard debugging & samples • Expanding RuntimeGems

    • BLE keyboards, split keyboards • More activities that make hasumi-san jealous While I'm off improving the ecosystem and trying to fix tiny bugs in the language (doesn't mean I actually fixed them), everyone else is happily building fun PicoRuby apps — isn't that a bit unfair?