]> git.donarmstrong.com Git - tmk_firmware.git/commitdiff
Merge branch 'usb_usb_hub'
authorJun Wako <wakojun@gmail.com>
Wed, 10 Dec 2014 16:00:32 +0000 (01:00 +0900)
committerJun Wako <wakojun@gmail.com>
Wed, 10 Dec 2014 16:00:32 +0000 (01:00 +0900)
.gitmodules
converter/usb_usb/Makefile
converter/usb_usb/README
converter/usb_usb/config.h
converter/usb_usb/main.cpp
protocol/usb_hid.mk
protocol/usb_hid/USB_Host_Shield_2.0

index 17a20decb7c3787935941ee5a1d63d087c495fda..e21f449613e10537231a0d0e55191ac096b1e9c1 100644 (file)
@@ -1,6 +1,6 @@
-[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
+[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
index 13f77ca9b7db668c9068ba598f2503ecb581f4d0..4f983e7f68cda2037c9fd285b7ab04f7f41c7919 100644 (file)
@@ -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)
 
 
 
index a4893711079b002fb01858b1d925449a988ac626..69caabb27888d49d7a46a9f31b47e62cfc83695a 100644 (file)
@@ -19,13 +19,42 @@ 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.
+
+
+
+Update
+------
+2014/12/11  Added Hub support(confirmed with HHKB pro2)
+
+
+
+Resource
+--------
+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
index d614973f7ebf4a4c3821d6e4e8f3bb2ed5114399..bdc02868c8fbc503941853860a351622950ae0da 100644 (file)
@@ -20,7 +20,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 #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
index 20b7af66a25a56b61f2db2f320a9383e3a872aaf..30fd3348a344b14c948374d41b08881890956a36 100644 (file)
@@ -8,11 +8,13 @@
 #include "hid.h"
 #include "hidboot.h"
 #include "parser.h"
+#include "usbhub.h"
 
 // LUFA
 #include "lufa.h"
 
 #include "timer.h"
+#include "sendchar.h"
 #include "debug.h"
 #include "keyboard.h"
 
 static USB     usb_host;
 static HIDBoot<HID_PROTOCOL_KEYBOARD>    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)
 {
@@ -39,6 +50,7 @@ static void LUFA_setup(void)
 
     // for Console_Task
     USB_Device_EnableSOFEvents();
+    print_set_sendchar(sendchar);
 }
 
 static void HID_setup()
@@ -60,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();
index 6914dce809ed77f4c28088c74198e7a1ca9d1106..8fda76c2e5be959cc2b64ae645fb70807385ae4d 100644 (file)
@@ -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 
 
index 8bb790f83af298b5f3e5516259c9d8ec27efe522..2b4a56de3d090686f62d25ea34042759dc4352d6 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 8bb790f83af298b5f3e5516259c9d8ec27efe522
+Subproject commit 2b4a56de3d090686f62d25ea34042759dc4352d6