aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules6
-rw-r--r--converter/usb_usb/Makefile2
-rw-r--r--converter/usb_usb/README35
-rw-r--r--converter/usb_usb/config.h2
-rw-r--r--converter/usb_usb/main.cpp14
-rw-r--r--protocol/usb_hid.mk1
m---------protocol/usb_hid/USB_Host_Shield_2.00
7 files changed, 52 insertions, 8 deletions
diff --git a/.gitmodules b/.gitmodules
index 17a20decb..e21f44961 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
1[submodule "protocol/usb_hid/USB_Host_Shield_2.0"]
2 path = protocol/usb_hid/USB_Host_Shield_2.0
3 url = git@github.com:tmk/USB_Host_Shield_2.0.git
4[submodule "protocol/lufa/LUFA-git"] 1[submodule "protocol/lufa/LUFA-git"]
5 path = protocol/lufa/LUFA-git 2 path = protocol/lufa/LUFA-git
6 url = https://github.com/abcminiuser/lufa.git 3 url = https://github.com/abcminiuser/lufa.git
4[submodule "protocol/usb_hid/USB_Host_Shield_2.0"]
5 path = protocol/usb_hid/USB_Host_Shield_2.0
6 url = https://github.com/felis/USB_Host_Shield_2.0.git
diff --git a/converter/usb_usb/Makefile b/converter/usb_usb/Makefile
index 13f77ca9b..4f983e7f6 100644
--- a/converter/usb_usb/Makefile
+++ b/converter/usb_usb/Makefile
@@ -120,7 +120,7 @@ VPATH += $(TOP_DIR)
120 120
121 121
122# program Leonardo 122# program Leonardo
123PROGRAM_CMD = avrdude -p$(MCU) -cavr109 -P$(DEV) -b57600 -Uflash:w:$(TARGET).hex 123PROGRAM_CMD = avrdude -p$(MCU) -cavr109 -b57600 -Uflash:w:$(TARGET).hex -P$(DEV)
124 124
125 125
126 126
diff --git a/converter/usb_usb/README b/converter/usb_usb/README
index a48937110..69caabb27 100644
--- a/converter/usb_usb/README
+++ b/converter/usb_usb/README
@@ -19,13 +19,42 @@ Build firmware
19 $ cd converter/usb_usb 19 $ cd converter/usb_usb
20 $ make 20 $ make
21 21
22You will get usb_usb.hex if you are lucky. 22Program converter. Push reset button on Leonardo before run this command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0.
23Program your Leonardo with avrdude(or easy-going Arduino IDE): 23
24 $ DEV=COM17 make program
25 or
26 $ avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:usb_usb.hex -PCOM17
24 27
25 $ avrdude -patmega32u4 -cavr109 -PCOM17 -b57600 -Uflash:w:usb_usb.hex
26 28
27 29
28Limitation 30Limitation
29---------- 31----------
30Only supports 'HID Boot protocol'. 32Only supports 'HID Boot protocol'.
31Not support keyboard LED yet. 33Not support keyboard LED yet.
34
35
36
37Update
38------
392014/12/11 Added Hub support(confirmed with HHKB pro2)
40
41
42
43Resource
44--------
45USB Host Sheild 2.0
46 https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino
47 https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini
48USB Host Sheild 2.0 source
49 https://github.com/felis/USB_Host_Shield_2.0
50Arduino USB Host Shield(with bootst converter)
51 http://arduino.cc/en/Main/ArduinoUSBHostShield
52Arduino source
53 https://github.com/arduino/Arduino/hardware/arduino/{cores,variants}
54Initial release of TMK USB-USB converter
55 https://geekhack.org/index.php?topic=33057.msg653549#msg653549
56 http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html#p74854
57Arduino-based hardware keyboard remapper - Colemak forum
58 http://forum.colemak.com/viewtopic.php?id=1561
59Teensy + Host Shield
60 http://www.pjrc.com/teensy/td_libs_USBHostShield.html
diff --git a/converter/usb_usb/config.h b/converter/usb_usb/config.h
index d614973f7..bdc02868c 100644
--- a/converter/usb_usb/config.h
+++ b/converter/usb_usb/config.h
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20 20
21 21
22#define VENDOR_ID 0xFEED 22#define VENDOR_ID 0xFEED
23#define PRODUCT_ID 0xCAFE 23#define PRODUCT_ID 0x005B
24#define DEVICE_VER 0x0814 24#define DEVICE_VER 0x0814
25#define MANUFACTURER t.m.k. 25#define MANUFACTURER t.m.k.
26#define PRODUCT USB to USB keyboard converter 26#define PRODUCT USB to USB keyboard converter
diff --git a/converter/usb_usb/main.cpp b/converter/usb_usb/main.cpp
index 20b7af66a..30fd3348a 100644
--- a/converter/usb_usb/main.cpp
+++ b/converter/usb_usb/main.cpp
@@ -8,11 +8,13 @@
8#include "hid.h" 8#include "hid.h"
9#include "hidboot.h" 9#include "hidboot.h"
10#include "parser.h" 10#include "parser.h"
11#include "usbhub.h"
11 12
12// LUFA 13// LUFA
13#include "lufa.h" 14#include "lufa.h"
14 15
15#include "timer.h" 16#include "timer.h"
17#include "sendchar.h"
16#include "debug.h" 18#include "debug.h"
17#include "keyboard.h" 19#include "keyboard.h"
18 20
@@ -22,6 +24,15 @@
22static USB usb_host; 24static USB usb_host;
23static HIDBoot<HID_PROTOCOL_KEYBOARD> kbd(&usb_host); 25static HIDBoot<HID_PROTOCOL_KEYBOARD> kbd(&usb_host);
24static KBDReportParser kbd_parser; 26static KBDReportParser kbd_parser;
27static USBHub hub1(&usb_host); // one hub is enough for HHKB pro2
28/* may be needed for other device with more hub
29static USBHub hub2(&usb_host);
30static USBHub hub3(&usb_host);
31static USBHub hub4(&usb_host);
32static USBHub hub5(&usb_host);
33static USBHub hub6(&usb_host);
34static USBHub hub7(&usb_host);
35*/
25 36
26static void LUFA_setup(void) 37static void LUFA_setup(void)
27{ 38{
@@ -39,6 +50,7 @@ static void LUFA_setup(void)
39 50
40 // for Console_Task 51 // for Console_Task
41 USB_Device_EnableSOFEvents(); 52 USB_Device_EnableSOFEvents();
53 print_set_sendchar(sendchar);
42} 54}
43 55
44static void HID_setup() 56static void HID_setup()
@@ -60,9 +72,11 @@ int main(void)
60 LED_TX_ON; 72 LED_TX_ON;
61 73
62 debug_enable = true; 74 debug_enable = true;
75/*
63 debug_matrix = true; 76 debug_matrix = true;
64 debug_keyboard = true; 77 debug_keyboard = true;
65 debug_mouse = true; 78 debug_mouse = true;
79*/
66 80
67 host_set_driver(&lufa_driver); 81 host_set_driver(&lufa_driver);
68 keyboard_init(); 82 keyboard_init();
diff --git a/protocol/usb_hid.mk b/protocol/usb_hid.mk
index 6914dce80..8fda76c2e 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
8USB_HOST_SHIELD_SRC = \ 8USB_HOST_SHIELD_SRC = \
9 $(USB_HOST_SHIELD_DIR)/Usb.cpp \ 9 $(USB_HOST_SHIELD_DIR)/Usb.cpp \
10 $(USB_HOST_SHIELD_DIR)/hid.cpp \ 10 $(USB_HOST_SHIELD_DIR)/hid.cpp \
11 $(USB_HOST_SHIELD_DIR)/usbhub.cpp \
11 $(USB_HOST_SHIELD_DIR)/parsetools.cpp \ 12 $(USB_HOST_SHIELD_DIR)/parsetools.cpp \
12 $(USB_HOST_SHIELD_DIR)/message.cpp 13 $(USB_HOST_SHIELD_DIR)/message.cpp
13 14
diff --git a/protocol/usb_hid/USB_Host_Shield_2.0 b/protocol/usb_hid/USB_Host_Shield_2.0
Subproject 8bb790f83af298b5f3e5516259c9d8ec27efe52 Subproject 2b4a56de3d090686f62d25ea34042759dc4352d