Skip to content

Commit

Permalink
usb_usb: Add unimap
Browse files Browse the repository at this point in the history
  • Loading branch information
tmk committed Sep 2, 2016
1 parent 765d82e commit fef48a3
Show file tree
Hide file tree
Showing 7 changed files with 1,815 additions and 24 deletions.
44 changes: 28 additions & 16 deletions converter/usb_usb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
#----------------------------------------------------------------------------

# Target file name (without extension).
TARGET = usb_usb
TARGET ?= usb_usb

TMK_DIR = ../../tmk_core
TMK_DIR ?= ../../tmk_core

# Directory keyboard dependent files exist
TARGET_DIR = .
TARGET_DIR ?= .

# MCU name
MCU = atmega32u4
MCU ?= atmega32u4


# Processor frequency.
Expand All @@ -61,15 +61,15 @@ MCU = atmega32u4
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
F_CPU ?= 16000000



#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
ARCH ?= AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
Expand All @@ -81,7 +81,7 @@ ARCH = AVR8
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT

Expand All @@ -90,11 +90,11 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Build Options
# comment out to disable the options.
#
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Media control and System control
CONSOLE_ENABLE = yes # Console for debug
#COMMAND_ENABLE = yes # Commands for debug and configuration
#NKRO_ENABLE = yes # USB Nkey Rollover
MOUSEKEY_ENABLE ?= yes # Mouse keys
EXTRAKEY_ENABLE ?= yes # Media control and System control
CONSOLE_ENABLE ?= yes # Console for debug
#COMMAND_ENABLE ?= yes # Commands for debug and configuration
#NKRO_ENABLE ?= yes # USB Nkey Rollover

# Boot Section Size in bytes
# Teensy halfKay 512
Expand All @@ -108,16 +108,28 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
#OPT_DEFS += -DNO_ACTION_LAYER
#OPT_DEFS += -DNO_ACTION_MACRO

SRC = usb_usb.cpp \
SRC ?= usb_usb.cpp \
main.cpp

#
# Keymap file
#
ifeq (yes,$(strip $(UNIMAP_ENABLE)))
KEYMAP_FILE = unimap
else
ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
SRC := keymap.c $(SRC)
SRC := $(KEYMAP_FILE).c $(SRC)
endif

CONFIG_H = config.h
CONFIG_H ?= config.h



Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# build firmware for keymap editor
#
TARGET = usb_usb_editor
KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
KEYMAP = editor
include Makefile
4 changes: 4 additions & 0 deletions converter/usb_usb/Makefile.unimap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TARGET = usb_usb_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
include Makefile
29 changes: 23 additions & 6 deletions converter/usb_usb/README
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
USB to USB keyboard protocol converter
======================================
See for detail and discussion.
https://geekhack.org/index.php?topic=69169.0


Hardware requirement
--------------------
Arduino Leonardo
http://arduino.cc/en/Main/ArduinoBoardLeonardo
There are two options.

### TMK USB-USB Converter
You can buy a fully assembled converter from me here.

Circuit@Home USB Host Shield 2.0
https://geekhack.org/index.php?topic=69169.0

### Arduino Leonardo + Circuit@Home USB Host Shield 2.0
Buying Arduino Leonardo and USB Host Shield 2.0(from Circuit@home) will be better, you won't need even soldering iron.

http://arduino.cc/en/Main/ArduinoBoardLeonardo
https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino-assembled/

Buying Arduino Leonardo and USB Host Shield 2.0(from Circuit@home) will be the easiest way, you won't need even soldering iron.
Arduino's Shield will also work well but I think Sparkfun's needs to be modified.
Other compatible boards like Arduino's Shield will also work well but I think Sparkfun's needs to be modified.

http://arduino.cc/en/Main/ArduinoUSBHostShield
https://www.sparkfun.com/products/9947

Also Pro Micro 3.3V(not Mini) or Teensy with mini host shield will work with some fixes on signal/power routing.

https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini
https://www.sparkfun.com/products/12587
https://www.pjrc.com/teensy/td_libs_USBHostShield.html
Expand All @@ -24,14 +34,21 @@ Also Pro Micro 3.3V(not Mini) or Teensy with mini host shield will work with som

Build firmware
--------------
Build.

$ git clone git://github.com/tmk/tmk_keyboard.git
$ cd tmk_keyboard
$ git submodule init
$ git submodule update
$ cd converter/usb_usb
$ make

Program converter. Push reset button on Leonardo before run this command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0.
And Program converter. Push button on TMK converter and just run this.

$ make dfu


In case of Leonardo push reset button then run command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0.

$ DEV=COM17 make program
or
Expand Down
Loading

0 comments on commit fef48a3

Please sign in to comment.