From 9de992ba0be93a7fcc539ad0418c8ebfd3cd6281 Mon Sep 17 00:00:00 2001 From: Jun Wako Date: Wed, 10 Dec 2014 14:35:46 +0900 Subject: [PATCH 1/7] Change USB PID --- converter/usb_usb/Makefile | 2 +- converter/usb_usb/README | 15 ++++++++++++--- converter/usb_usb/config.h | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/converter/usb_usb/Makefile b/converter/usb_usb/Makefile index 13f77ca9b7d..4f983e7f68c 100644 --- a/converter/usb_usb/Makefile +++ b/converter/usb_usb/Makefile @@ -120,7 +120,7 @@ VPATH += $(TOP_DIR) # program Leonardo -PROGRAM_CMD = avrdude -p$(MCU) -cavr109 -P$(DEV) -b57600 -Uflash:w:$(TARGET).hex +PROGRAM_CMD = avrdude -p$(MCU) -cavr109 -b57600 -Uflash:w:$(TARGET).hex -P$(DEV) diff --git a/converter/usb_usb/README b/converter/usb_usb/README index a4893711079..985458ed013 100644 --- a/converter/usb_usb/README +++ b/converter/usb_usb/README @@ -19,13 +19,22 @@ Build firmware $ cd converter/usb_usb $ make -You will get usb_usb.hex if you are lucky. -Program your Leonardo with avrdude(or easy-going Arduino IDE): +Program converter. Push reset button on Leonardo before run this command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0. + + $ DEV=COM17 make program + or + $ avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:usb_usb.hex -PCOM17 - $ avrdude -patmega32u4 -cavr109 -PCOM17 -b57600 -Uflash:w:usb_usb.hex Limitation ---------- Only supports 'HID Boot protocol'. Not support keyboard LED yet. + + +Resource +-------- +http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841.html +https://github.com/felis/USB_Host_Shield_2.0 +https://github.com/arduino/Arduino/hardware/arduino/{cores,variants} diff --git a/converter/usb_usb/config.h b/converter/usb_usb/config.h index d614973f7eb..bdc02868c8f 100644 --- a/converter/usb_usb/config.h +++ b/converter/usb_usb/config.h @@ -20,7 +20,7 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xCAFE +#define PRODUCT_ID 0x005B #define DEVICE_VER 0x0814 #define MANUFACTURER t.m.k. #define PRODUCT USB to USB keyboard converter From 0a9d9b8f9c6579a47fbb35973c747e13fb93e4b8 Mon Sep 17 00:00:00 2001 From: Jun Wako Date: Wed, 10 Dec 2014 15:10:25 +0900 Subject: [PATCH 2/7] Fix print init; print_set_sendchar in main --- converter/usb_usb/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/converter/usb_usb/main.cpp b/converter/usb_usb/main.cpp index 20b7af66a25..4e655632e31 100644 --- a/converter/usb_usb/main.cpp +++ b/converter/usb_usb/main.cpp @@ -13,6 +13,7 @@ #include "lufa.h" #include "timer.h" +#include "sendchar.h" #include "debug.h" #include "keyboard.h" @@ -39,6 +40,7 @@ static void LUFA_setup(void) // for Console_Task USB_Device_EnableSOFEvents(); + print_set_sendchar(sendchar); } static void HID_setup() From 4b69ed2280743b8e992232e6c59b46ae23906fb9 Mon Sep 17 00:00:00 2001 From: Jun Wako Date: Wed, 10 Dec 2014 15:20:32 +0900 Subject: [PATCH 3/7] Remove submodule USB_Host_Shield_2.0 --- .gitmodules | 3 --- protocol/usb_hid/USB_Host_Shield_2.0 | 1 - 2 files changed, 4 deletions(-) delete mode 160000 protocol/usb_hid/USB_Host_Shield_2.0 diff --git a/.gitmodules b/.gitmodules index 17a20decb7c..eef19ae0806 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "protocol/usb_hid/USB_Host_Shield_2.0"] - path = protocol/usb_hid/USB_Host_Shield_2.0 - url = git@github.com:tmk/USB_Host_Shield_2.0.git [submodule "protocol/lufa/LUFA-git"] path = protocol/lufa/LUFA-git url = https://github.com/abcminiuser/lufa.git diff --git a/protocol/usb_hid/USB_Host_Shield_2.0 b/protocol/usb_hid/USB_Host_Shield_2.0 deleted file mode 160000 index 8bb790f83af..00000000000 --- a/protocol/usb_hid/USB_Host_Shield_2.0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8bb790f83af298b5f3e5516259c9d8ec27efe522 From 0a181c7eb58b79405ee91e7fca9f827678424872 Mon Sep 17 00:00:00 2001 From: Jun Wako Date: Wed, 10 Dec 2014 15:54:24 +0900 Subject: [PATCH 4/7] Add submodule legitimate USB_Host_Shield_2.0 --- .gitmodules | 3 +++ protocol/usb_hid/USB_Host_Shield_2.0 | 1 + 2 files changed, 4 insertions(+) create mode 160000 protocol/usb_hid/USB_Host_Shield_2.0 diff --git a/.gitmodules b/.gitmodules index eef19ae0806..e21f449613e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "protocol/lufa/LUFA-git"] path = protocol/lufa/LUFA-git url = https://github.com/abcminiuser/lufa.git +[submodule "protocol/usb_hid/USB_Host_Shield_2.0"] + path = protocol/usb_hid/USB_Host_Shield_2.0 + url = https://github.com/felis/USB_Host_Shield_2.0.git diff --git a/protocol/usb_hid/USB_Host_Shield_2.0 b/protocol/usb_hid/USB_Host_Shield_2.0 new file mode 160000 index 00000000000..2b4a56de3d0 --- /dev/null +++ b/protocol/usb_hid/USB_Host_Shield_2.0 @@ -0,0 +1 @@ +Subproject commit 2b4a56de3d090686f62d25ea34042759dc4352d6 From c9674d388d3b018cb1dfc0a34868642be53e913c Mon Sep 17 00:00:00 2001 From: Jun Wako Date: Wed, 10 Dec 2014 23:52:38 +0900 Subject: [PATCH 5/7] Add USB Hub support --- converter/usb_usb/main.cpp | 10 ++++++++++ protocol/usb_hid.mk | 1 + 2 files changed, 11 insertions(+) diff --git a/converter/usb_usb/main.cpp b/converter/usb_usb/main.cpp index 4e655632e31..0b536b05aa8 100644 --- a/converter/usb_usb/main.cpp +++ b/converter/usb_usb/main.cpp @@ -8,6 +8,7 @@ #include "hid.h" #include "hidboot.h" #include "parser.h" +#include "usbhub.h" // LUFA #include "lufa.h" @@ -23,6 +24,15 @@ static USB usb_host; static HIDBoot kbd(&usb_host); static KBDReportParser kbd_parser; +static USBHub hub1(&usb_host); // one hub is enough for HHKB pro2 +/* may be needed for other device with more hub +static USBHub hub2(&usb_host); +static USBHub hub3(&usb_host); +static USBHub hub4(&usb_host); +static USBHub hub5(&usb_host); +static USBHub hub6(&usb_host); +static USBHub hub7(&usb_host); +*/ static void LUFA_setup(void) { diff --git a/protocol/usb_hid.mk b/protocol/usb_hid.mk index 6914dce809e..8fda76c2e5b 100644 --- a/protocol/usb_hid.mk +++ b/protocol/usb_hid.mk @@ -8,6 +8,7 @@ USB_HOST_SHIELD_DIR = $(USB_HID_DIR)/USB_Host_Shield_2.0 USB_HOST_SHIELD_SRC = \ $(USB_HOST_SHIELD_DIR)/Usb.cpp \ $(USB_HOST_SHIELD_DIR)/hid.cpp \ + $(USB_HOST_SHIELD_DIR)/usbhub.cpp \ $(USB_HOST_SHIELD_DIR)/parsetools.cpp \ $(USB_HOST_SHIELD_DIR)/message.cpp From 27795b6b191da88fbcbeefd21dd0f9eddacedcf9 Mon Sep 17 00:00:00 2001 From: Jun Wako Date: Thu, 11 Dec 2014 00:27:37 +0900 Subject: [PATCH 6/7] Change debug print config --- converter/usb_usb/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/converter/usb_usb/main.cpp b/converter/usb_usb/main.cpp index 0b536b05aa8..30fd3348a34 100644 --- a/converter/usb_usb/main.cpp +++ b/converter/usb_usb/main.cpp @@ -72,9 +72,11 @@ int main(void) LED_TX_ON; debug_enable = true; +/* debug_matrix = true; debug_keyboard = true; debug_mouse = true; +*/ host_set_driver(&lufa_driver); keyboard_init(); From 30864ea5e48c15796cc2e3e2ba4a9b50322d82a4 Mon Sep 17 00:00:00 2001 From: Jun Wako Date: Thu, 11 Dec 2014 00:59:08 +0900 Subject: [PATCH 7/7] Update README --- converter/usb_usb/README | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/converter/usb_usb/README b/converter/usb_usb/README index 985458ed013..69caabb2788 100644 --- a/converter/usb_usb/README +++ b/converter/usb_usb/README @@ -33,8 +33,28 @@ Only supports 'HID Boot protocol'. Not support keyboard LED yet. + +Update +------ +2014/12/11 Added Hub support(confirmed with HHKB pro2) + + + Resource -------- -http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841.html -https://github.com/felis/USB_Host_Shield_2.0 -https://github.com/arduino/Arduino/hardware/arduino/{cores,variants} +USB Host Sheild 2.0 + https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino + https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini +USB Host Sheild 2.0 source + https://github.com/felis/USB_Host_Shield_2.0 +Arduino USB Host Shield(with bootst converter) + http://arduino.cc/en/Main/ArduinoUSBHostShield +Arduino source + https://github.com/arduino/Arduino/hardware/arduino/{cores,variants} +Initial release of TMK USB-USB converter + https://geekhack.org/index.php?topic=33057.msg653549#msg653549 + http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html#p74854 +Arduino-based hardware keyboard remapper - Colemak forum + http://forum.colemak.com/viewtopic.php?id=1561 +Teensy + Host Shield + http://www.pjrc.com/teensy/td_libs_USBHostShield.html