Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sun Type 5 to USB HID (RP2040 + Embassy)

Photo of a sun type5 keyboard and mouse Photo of the prototype adapter Photo of the prototype back Schematic of the adapter

Hardware

  • Clone of waveshare RP2040-Zero
  • Bi-Directional Level shifter
  • Female 8-pin mini-din connector
  • Sun Type 5c keyboard
  • Sun Compact 1 mouse
  • Custom PCB designed here

Wiring

  • RP2040 UART0 TX: GPIO0 (keyboard)
  • RP2040 UART0 RX: GPIO1 (keyboard)
  • RP2040 UART1 RX: GPIO5 (mouse)
  • RP2040 GPIO28 (status LED + 220ohm resistor) (breadboard version only)
  • RP2040 GPIO16: Neopixel on board (TODO)
  • Sun keyboard uses inverted TTL; UART inversion is enabled in firmware
  • Sun Compact 1 mouse uses inverted TTL; UART inversion is enabled in firmware
  • Common ground between keyboard, mouse, and RP

Serial settings

  • Keyboard: 1200 baud, 8N1, inverted logic
  • Mouse: 1200 baud, 8N1, inverted logic

Setup

rustup target add thumbv6m-none-eabi
cargo install elf2uf2-rs
cargo install flip-link

Build

cargo build_target

To build without mouse support:

cargo build_target --no-default-features

To run unit tests:

cargo test --package type5-logic

This repository is a workspace with:

  • crates/type5-logic: protocol parsing and key/mouse translation logic
  • crates/type5-firmware: RP2040 Embassy firmware binary (type5-usb)

Flash/Run

Requires picotool and the board to be in bootloader mode:

cargo run_target

TODO

  • Send commands for bell and click
  • Handle brightness keys (shifted volume)

Reference

Prior Art

There are many projects implementing this. These are a couple I found usful as reference:

Further Work

Some ideas I'll probably never get to

  • Custom PCB and 3D printed case.
  • Package the adapter into the keyboard, skipping the cable and mini-din.
  • Fully replace the internal PCB, and perform matrix scanning.
  • Use a bluetooth micro controller and go wireless.
  • Hyper-optimize cost/size/power with the smallest micro possible

AI Disclaimer

AI was used in the creation of the project.

About

Sun type5 keyboard to usb-hid adapter firmware for rp2040.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages