diff options
Diffstat (limited to 'converter/ps2_usb')
-rw-r--r-- | converter/ps2_usb/Makefile | 105 | ||||
-rw-r--r-- | converter/ps2_usb/Makefile.mbed | 46 | ||||
-rw-r--r-- | converter/ps2_usb/Makefile.pjrc | 75 | ||||
-rw-r--r-- | converter/ps2_usb/Makefile.tmk_rev1 | 98 | ||||
-rw-r--r-- | converter/ps2_usb/Makefile.tmk_rev2 | 98 | ||||
-rw-r--r-- | converter/ps2_usb/Makefile.vusb | 107 | ||||
-rw-r--r-- | converter/ps2_usb/README.md | 84 | ||||
-rw-r--r-- | converter/ps2_usb/config.h | 173 | ||||
-rw-r--r-- | converter/ps2_usb/config_mbed.h | 60 | ||||
-rw-r--r-- | converter/ps2_usb/config_tmk_rev1.h | 147 | ||||
-rw-r--r-- | converter/ps2_usb/config_tmk_rev2.h | 85 | ||||
-rw-r--r-- | converter/ps2_usb/keymap_common.c | 31 | ||||
-rw-r--r-- | converter/ps2_usb/keymap_common.h | 173 | ||||
-rw-r--r-- | converter/ps2_usb/keymap_jis.c | 34 | ||||
-rw-r--r-- | converter/ps2_usb/keymap_plain.c | 32 | ||||
-rw-r--r-- | converter/ps2_usb/keymap_spacefn.c | 61 | ||||
-rw-r--r-- | converter/ps2_usb/led.c | 33 | ||||
-rw-r--r-- | converter/ps2_usb/main.cpp | 46 | ||||
-rw-r--r-- | converter/ps2_usb/matrix.c | 486 | ||||
-rw-r--r-- | converter/ps2_usb/usbconfig.h | 377 |
20 files changed, 0 insertions, 2351 deletions
diff --git a/converter/ps2_usb/Makefile b/converter/ps2_usb/Makefile deleted file mode 100644 index 51b2225661..0000000000 --- a/converter/ps2_usb/Makefile +++ /dev/null @@ -1,105 +0,0 @@ -# -# Makefile for Teensy -# -# Target file name (without extension). -TARGET = ps2_usb_lufa - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = keymap_common.c \ - matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config.h - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# 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 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -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 -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# 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) - -# Interrupt driven control endpoint task(+60) -#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - - -# PS/2 Options -# -#PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened) -PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin -#PS2_USE_BUSYWAIT = yes # uses primitive reference code - - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/Makefile.mbed b/converter/ps2_usb/Makefile.mbed deleted file mode 100644 index a7ea5bcf24..0000000000 --- a/converter/ps2_usb/Makefile.mbed +++ /dev/null @@ -1,46 +0,0 @@ -PROJECT = ps2_usb - -TMK_DIR = ../../tmk_core -MBED_DIR = $(TMK_DIR)/tool/mbed/mbed-sdk - -#VPATH += $(MBED_DIR):$(TMK_DIR) -vpath %.s .:$(MBED_DIR):$(TMK_DIR) -vpath %.c .:$(MBED_DIR):$(TMK_DIR) -vpath %.cpp .:$(MBED_DIR):$(TMK_DIR) - -OBJDIR = ./build - -OBJECTS = \ - $(OBJDIR)/protocol/ps2_busywait.o \ - $(OBJDIR)/protocol/ps2_io_mbed.o \ - $(OBJDIR)/./keymap_common.o \ - $(OBJDIR)/./matrix.o \ - $(OBJDIR)/./led.o \ - $(OBJDIR)/./main.o - -ifdef KEYMAP - OBJECTS := $(OBJDIR)/keymap_$(KEYMAP).o $(OBJECTS) -else - OBJECTS := $(OBJDIR)/keymap_plain.o $(OBJECTS) -endif - -CONFIG_H = config_mbed.h - -SYS_OBJECTS = - -INCLUDE_PATHS = -I. - -LIBRARY_PATHS = -LIBRARIES = - -# Build Options -# Comment out to disable -#BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes - - -#include $(TMK_DIR)/tool/mbed/mk20d50m.mk -include $(TMK_DIR)/tool/mbed/lpc11u35_501.mk -include $(TMK_DIR)/tool/mbed/mbed.mk -include $(TMK_DIR)/tool/mbed/common.mk -include $(TMK_DIR)/tool/mbed/gcc.mk diff --git a/converter/ps2_usb/Makefile.pjrc b/converter/ps2_usb/Makefile.pjrc deleted file mode 100644 index 64319aca88..0000000000 --- a/converter/ps2_usb/Makefile.pjrc +++ /dev/null @@ -1,75 +0,0 @@ -# Target file name (without extension). -TARGET = ps2_usb_pjrc - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# keyboard dependent files -SRC = keymap_common.c \ - matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config.h - - -# MCU name, you MUST set this to match the board you are using -# type "make clean" after changing this, so all files will be rebuilt -#MCU = at90usb162 # Teensy 1.0 -MCU = atmega32u4 # Teensy 2.0 -#MCU = at90usb646 # Teensy++ 1.0 -#MCU = at90usb1286 # Teensy++ 2.0 - - -# Processor frequency. -# Normally the first thing your program should do is set the clock prescaler, -# so your program will run at the correct speed. You should also set this -# variable to same clock speed. The _delay_ms() macro uses this, and many -# examples use this variable to calculate timings. Do not add a "UL" here. -F_CPU = 16000000 - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# *Comment out* to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # USB Nkey Rollover - - -# PS/2 Options -# -#PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened) -#PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin -PS2_USE_BUSYWAIT = yes # uses primitive reference code - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - - -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/protocol/pjrc.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/Makefile.tmk_rev1 b/converter/ps2_usb/Makefile.tmk_rev1 deleted file mode 100644 index 6aaef49969..0000000000 --- a/converter/ps2_usb/Makefile.tmk_rev1 +++ /dev/null @@ -1,98 +0,0 @@ -# -# Makefile for TMK keyboard converter rev2 -# https://github.com/tmk/keyboard_converter#pcb-rev1 -# -# Target file name (without extension). -TARGET = ps2_usb_tmk_rev1 - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = keymap_common.c \ - matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config_tmk_rev1.h - - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# 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 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -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 -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# 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) - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - - -# PS/2 Options -# -PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened) -#PS2_USE_BUSYWAIT = yes # uses primitive reference code - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/Makefile.tmk_rev2 b/converter/ps2_usb/Makefile.tmk_rev2 deleted file mode 100644 index 5049a22703..0000000000 --- a/converter/ps2_usb/Makefile.tmk_rev2 +++ /dev/null @@ -1,98 +0,0 @@ -# -# Makefile for TMK keyboard converter rev2 -# https://github.com/tmk/keyboard_converter#pcb-rev2 -# -# Target file name (without extension). -TARGET = ps2_usb_tmk_rev2 - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = keymap_common.c \ - matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config_tmk_rev2.h - - -# MCU name -MCU = atmega32u2 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# 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 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -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 -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# 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) - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - - -# PS/2 Options -# -PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin -#PS2_USE_BUSYWAIT = yes # uses primitive reference code - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/Makefile.vusb b/converter/ps2_usb/Makefile.vusb deleted file mode 100644 index d9fa12bcda..0000000000 --- a/converter/ps2_usb/Makefile.vusb +++ /dev/null @@ -1,107 +0,0 @@ -# Target file name (without extension). -TARGET = ps2_usb_vusb - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# keyboard dependent files -SRC = keymap_common.c \ - matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config.h - - -# Use USART for PS/2. With V-USB INT and BUSYWAIT code is not useful. -PS2_USE_USART = yes - - -# V-USB debug level: To use ps2_usart.c level must be 0 -# ps2_usart.c requires USART to receive PS/2 signal. -OPT_DEFS += -DDEBUG_LEVEL=0 - - -# MCU name, you MUST set this to match the board you are using -# type "make clean" after changing this, so all files will be rebuilt -#MCU = at90usb162 # Teensy 1.0 -#MCU = atmega32u4 # Teensy 2.0 -#MCU = at90usb646 # Teensy++ 1.0 -#MCU = at90usb1286 # Teensy++ 2.0 -MCU = atmega168 - - -# Processor frequency. -# Normally the first thing your program should do is set the clock prescaler, -# so your program will run at the correct speed. You should also set this -# variable to same clock speed. The _delay_ms() macro uses this, and many -# examples use this variable to calculate timings. Do not add a "UL" here. -F_CPU = 20000000 - - -# Build Options -# comment out to disable the options. -# -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -#NKRO_ENABLE = yes # USB Nkey Rollover -NO_UART = yes # UART is unavailable - - - -#---------------- Programming Options -------------------------- -AVRDUDE = avrdude -# Type: avrdude -c ? to get a full listing. -AVRDUDE_PROGRAMMER = usbasp -AVRDUDE_PORT = -AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex -#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep - -# Uncomment the following if you want avrdude's erase cycle counter. -# Note that this counter needs to be initialized first using -Yn, -# see avrdude manual. -#AVRDUDE_ERASE_COUNTER = -y - -# Uncomment the following if you do /not/ wish a verification to be -# performed after programming the device. -#AVRDUDE_NO_VERIFY = -V - -# Increase verbosity level. Please use this when submitting bug -# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> -# to submit bug reports. -#AVRDUDE_VERBOSE = -v -v - -#AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS = -p $(MCU) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) -AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) -AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) - -PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) - - -# Boot Section Size in bytes -# Teensy halfKay 512 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBasp 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=2048 - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - - -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/protocol/vusb.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/README.md b/converter/ps2_usb/README.md deleted file mode 100644 index 74464e2640..0000000000 --- a/converter/ps2_usb/README.md +++ /dev/null @@ -1,84 +0,0 @@ -PS/2 to USB keyboard converter -============================== -This firmware converts PS/2 keyboard protocol to USB.(It supports Scan Code Set 2.) - - -Connect Wires -------------- -In case of Teensy2.0(ATMega32U4): - -1. Connect **Vcc** and **GND**. -2. Connect **Clock** and **Data** line. - - **Interrupt**: **Clock** is on `PD1` and **Data** on `PD0`.(Recommended. Soarer's converter compatible) - - **Busywait**: **Clock** is on `PD1` and **Data** on `PD0`. - - **USART**: **Clock** is on `PD5` and **Data** on `PD2`. -3. Optionally you need pull-up resistor. 1K-10K Ohm is OK. - -To change pin configuration edit **config.h** and **Makefile**. - - -Build Firmware --------------- -For **PJRC Teensy** just run `make`: - - $ make clean - $ make - -To select keymap: - - $ make clean - $ make KEYMAP=[plain|jis|spacefn|...] - -After that you will find HEX file `ps2_usb_lufa.hex` in current directory. - - -- For **TMK converter Rev.1** use `make -f Makefile.tmk_rev1` instead of `make` and HEX file is `ps2_usb_tmk_rev1.hex`. - -- For **TMK converter Rev.2** use `make -f Makefile.tmk_rev2` instead of `make` and HEX file is `ps2_usb_tmk_rev2.hex`. - - -Keymap ------- -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_<name>.c` and see keymap document(you can find in README.md of top directory) and existent keymap files. - - -PS/2 signal handling implementations ------------------------------------- -Following three methods can be used to implement PS/2 signal handling. - -### Simple and stupid busy-wait(ps2_busywait.c) - This is expected to implemented with portable C code for reference. -### Interrupt driven(ps2_interrupt.c) - Uses pin interrupt to detect falling edge of clock line. -### USART hardware module(ps2_usart.c) - Uses AVR USART engine to receive PS/2 signal. - -To select method edit Makefile. - - -V-USB Support -------------- -With V-USB you can use this converter on ATmega(168/328) but it doesn't support NKRO at this time. - -Circuit: - - +---+ +---------------+ - USB GND | | ATmega168 | - === C3 | | - 5V <-------+--------+---|Vcc,AVCC | PS/2 - R1 | | ==== - D- <----+--+-----R2-----|INT1 RXD|------->DATA - D+ <----|---+----R3-----|INT0 XCK|------->CLOCK - Z1 Z2 | | ->5V - GND<----+---+--+--+-----|GND | ->GND - | | | | - | C2-+--|XTAL1 | - | X1 | | - +--C3-+--|XTAL2 | - +---------------+ - R1: 1.5K Ohm - R2,R3: 68 Ohm - Z1,Z2: Zenner 3.6V - C1,C2: 22pF - C3: 0.1uF - X1: Crystal 20MHz(16MHz/12MHz) diff --git a/converter/ps2_usb/config.h b/converter/ps2_usb/config.h deleted file mode 100644 index c0a4fab13b..0000000000 --- a/converter/ps2_usb/config.h +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright 2012 Jun Wako <wakojun@gmail.com> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include <avr/interrupt.h> - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6512 -#define DEVICE_VER 0x0001 -#define MANUFACTURER t.m.k. -#define PRODUCT PS/2 keyboard converter -#define DESCRIPTION convert PS/2 keyboard to USB - - -/* matrix size */ -#define MATRIX_ROWS 32 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ -) - - -//#define NO_SUSPEND_POWER_DOWN - - -/* - * PS/2 Busywait - */ -#ifdef PS2_USE_BUSYWAIT -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 1 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 0 -#endif - -/* - * PS/2 Pin interrupt - */ -#ifdef PS2_USE_INT -/* uses INT1 for clock line(ATMega32U4) */ -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 1 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 0 -#define PS2_INT_INIT() do { \ - EICRA |= ((1<<ISC11) | \ - (0<<ISC10)); \ -} while (0) -#define PS2_INT_ON() do { \ - EIMSK |= (1<<INT1); \ -} while (0) -#define PS2_INT_OFF() do { \ - EIMSK &= ~(1<<INT1); \ -} while (0) -#define PS2_INT_VECT INT1_vect -#endif - -/* - * PS/2 USART - */ -#ifdef PS2_USE_USART -#if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) -/* XCK for clock line and RXD for data line */ -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 5 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 2 -/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ -/* set DDR of CLOCK as input to be slave */ -#define PS2_USART_INIT() do { \ - PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \ - PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \ - UCSR1C = ((1 << UMSEL10) | \ - (3 << UPM10) | \ - (0 << USBS1) | \ - (3 << UCSZ10) | \ - (0 << UCPOL1)); \ - UCSR1A = 0; \ - UBRR1H = 0; \ - UBRR1L = 0; \ -} while (0) -#define PS2_USART_RX_INT_ON() do { \ - UCSR1B = ((1 << RXCIE1) | \ - (1 << RXEN1)); \ -} while (0) -#define PS2_USART_RX_POLL_ON() do { \ - UCSR1B = (1 << RXEN1); \ -} while (0) -#define PS2_USART_OFF() do { \ - UCSR1C = 0; \ - UCSR1B &= ~((1 << RXEN1) | \ - (1 << TXEN1)); \ -} while (0) -#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1)) -#define PS2_USART_RX_DATA UDR1 -#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1))) -#define PS2_USART_RX_VECT USART1_RX_vect -#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__) -/* XCK for clock line and RXD for data line */ -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 4 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 0 -/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ -/* set DDR of CLOCK as input to be slave */ -#define PS2_USART_INIT() do { \ - PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \ - PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \ - UCSR0C = ((1 << UMSEL00) | \ - (3 << UPM00) | \ - (0 << USBS0) | \ - (3 << UCSZ00) | \ - (0 << UCPOL0)); \ - UCSR0A = 0; \ - UBRR0H = 0; \ - UBRR0L = 0; \ -} while (0) -#define PS2_USART_RX_INT_ON() do { \ - UCSR0B = ((1 << RXCIE0) | \ - (1 << RXEN0)); \ -} while (0) -#define PS2_USART_RX_POLL_ON() do { \ - UCSR0B = (1 << RXEN0); \ -} while (0) -#define PS2_USART_OFF() do { \ - UCSR0C = 0; \ - UCSR0B &= ~((1 << RXEN0) | \ - (1 << TXEN0)); \ -} while (0) -#define PS2_USART_RX_READY (UCSR0A & (1<<RXC0)) -#define PS2_USART_RX_DATA UDR0 -#define PS2_USART_ERROR (UCSR0A & ((1<<FE0) | (1<<DOR0) | (1<<UPE0))) -#define PS2_USART_RX_VECT USART_RX_vect -#endif -#endif - -#endif diff --git a/converter/ps2_usb/config_mbed.h b/converter/ps2_usb/config_mbed.h deleted file mode 100644 index 5819763e65..0000000000 --- a/converter/ps2_usb/config_mbed.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2012 Jun Wako <wakojun@gmail.com> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef CONFIG_MBED_H -#define CONFIG_MBED_H - - -#if 0 -// duplicated name against mbed USBDeivce -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6512 -#endif -#define DEVICE_VER 0x0001 -#define MANUFACTURER t.m.k. -#define PRODUCT PS/2 keyboard converter -#define DESCRIPTION convert PS/2 keyboard to USB - - -/* matrix size */ -#define MATRIX_ROWS 32 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ -) - - -/* - * PS/2 Busywait - */ -#ifdef PS2_USE_BUSYWAIT -# define PS2_CLOCK_PORT PORTD -# define PS2_CLOCK_PIN PIND -# define PS2_CLOCK_DDR DDRD -# define PS2_CLOCK_BIT 5 -# define PS2_DATA_PORT PORTD -# define PS2_DATA_PIN PIND -# define PS2_DATA_DDR DDRD -# define PS2_DATA_BIT 2 -#endif - - -#endif diff --git a/converter/ps2_usb/config_tmk_rev1.h b/converter/ps2_usb/config_tmk_rev1.h deleted file mode 100644 index 75dc97df38..0000000000 --- a/converter/ps2_usb/config_tmk_rev1.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2012 Jun Wako <wakojun@gmail.com> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include <avr/interrupt.h> - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6512 -#define DEVICE_VER 0x0001 -#define MANUFACTURER t.m.k. -#define PRODUCT PS/2 keyboard converter -#define DESCRIPTION convert PS/2 keyboard to USB - - -/* matrix size */ -#define MATRIX_ROWS 32 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ -) - - -//#define NO_SUSPEND_POWER_DOWN - - -/* - * PS/2 Busywait - */ -#ifdef PS2_USE_BUSYWAIT -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 5 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 2 -#endif - -/* - * PS/2 USART - */ -#ifdef PS2_USE_USART -#if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) -/* XCK for clock line and RXD for data line */ -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 5 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 2 -/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ -/* set DDR of CLOCK as input to be slave */ -#define PS2_USART_INIT() do { \ - PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \ - PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \ - UCSR1C = ((1 << UMSEL10) | \ - (3 << UPM10) | \ - (0 << USBS1) |