From b36e532b5e0eef219f33075e6e60b68d104484ee Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 4 Jun 2016 00:10:47 -0400 Subject: cleans up folder structure * consolidates docs * deletes converter/ * updates .md references (most) --- converter/ps2_usb/Makefile | 105 -------- converter/ps2_usb/Makefile.mbed | 46 ---- converter/ps2_usb/Makefile.pjrc | 75 ------ converter/ps2_usb/Makefile.tmk_rev1 | 98 -------- converter/ps2_usb/Makefile.tmk_rev2 | 98 -------- converter/ps2_usb/Makefile.vusb | 107 -------- converter/ps2_usb/README.md | 84 ------- converter/ps2_usb/config.h | 173 ------------- converter/ps2_usb/config_mbed.h | 60 ----- converter/ps2_usb/config_tmk_rev1.h | 147 ----------- converter/ps2_usb/config_tmk_rev2.h | 85 ------- converter/ps2_usb/keymap_common.c | 31 --- converter/ps2_usb/keymap_common.h | 173 ------------- converter/ps2_usb/keymap_jis.c | 34 --- converter/ps2_usb/keymap_plain.c | 32 --- converter/ps2_usb/keymap_spacefn.c | 61 ----- converter/ps2_usb/led.c | 33 --- converter/ps2_usb/main.cpp | 46 ---- converter/ps2_usb/matrix.c | 486 ------------------------------------ converter/ps2_usb/usbconfig.h | 377 ---------------------------- 20 files changed, 2351 deletions(-) delete mode 100644 converter/ps2_usb/Makefile delete mode 100644 converter/ps2_usb/Makefile.mbed delete mode 100644 converter/ps2_usb/Makefile.pjrc delete mode 100644 converter/ps2_usb/Makefile.tmk_rev1 delete mode 100644 converter/ps2_usb/Makefile.tmk_rev2 delete mode 100644 converter/ps2_usb/Makefile.vusb delete mode 100644 converter/ps2_usb/README.md delete mode 100644 converter/ps2_usb/config.h delete mode 100644 converter/ps2_usb/config_mbed.h delete mode 100644 converter/ps2_usb/config_tmk_rev1.h delete mode 100644 converter/ps2_usb/config_tmk_rev2.h delete mode 100644 converter/ps2_usb/keymap_common.c delete mode 100644 converter/ps2_usb/keymap_common.h delete mode 100644 converter/ps2_usb/keymap_jis.c delete mode 100644 converter/ps2_usb/keymap_plain.c delete mode 100644 converter/ps2_usb/keymap_spacefn.c delete mode 100644 converter/ps2_usb/led.c delete mode 100644 converter/ps2_usb/main.cpp delete mode 100644 converter/ps2_usb/matrix.c delete mode 100644 converter/ps2_usb/usbconfig.h (limited to 'converter/ps2_usb') 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 -# 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_.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 - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include - -#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< - -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 . -*/ - -#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 - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include - -#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< - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include - -#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)) \ -) - - -//#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< - -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 . -*/ -#include "keymap_common.h" -#include "progmem.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; -} diff --git a/converter/ps2_usb/keymap_common.h b/converter/ps2_usb/keymap_common.h deleted file mode 100644 index d783e01ded..0000000000 --- a/converter/ps2_usb/keymap_common.h +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -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 . -*/ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - - -// 32*8(256) byte array which converts PS/2 code into USB code -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - - -/* All keys */ -#define KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - K61, /* for European ISO */ \ - K51, K13, K6A, K64, K67, /* for Japanese JIS */ \ - K08, K10, K18, K20, K28, K30, K38, K40, K48, K50, K57, K5F, /* F13-24 */ \ - KB7, KBF, KDE, /* System Power, Sleep, Wake */ \ - KA3, KB2, KA1, /* Mute, Volume Up, Volume Down */ \ - KCD, K95, KBB, KB4, KD0, /* Next, Previous, Stop, Pause, Media Select */ \ - KC8, KAB, KC0, /* Mail, Calculator, My Computer */ \ - K90, KBA, KB8, KB0, /* WWW Search, Home, Back, Forward */ \ - KA8, KA0, K98 /* WWW Stop, Refresh, Favorites */ \ -) { \ - { KC_NO, KC_##K01, KC_NO, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_NO }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_NO }, \ - { KC_##K18, KC_NO, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_NO }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_NO }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_NO }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_NO }, \ - { KC_##K38, KC_NO, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_NO }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_NO, KC_##K54, KC_##K55, KC_NO, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_NO, KC_##K5D, KC_NO, KC_##K5F }, \ - { KC_NO, KC_##K61, KC_NO, KC_NO, KC_##K64, KC_NO, KC_##K66, KC_##K67 }, \ - { KC_NO, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_NO, KC_NO, KC_NO }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_##K83, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_##K90, KC_##K91, KC_NO, KC_NO, KC_##K94, KC_##K95, KC_NO, KC_NO }, \ - { KC_##K98, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K9F }, \ - { KC_##KA0, KC_##KA1, KC_NO, KC_##KA3, KC_NO, KC_NO, KC_NO, KC_##KA7 }, \ - { KC_##KA8, KC_NO, KC_NO, KC_##KAB, KC_NO, KC_NO, KC_NO, KC_##KAF }, \ - { KC_##KB0, KC_NO, KC_##KB2, KC_NO, KC_##KB4, KC_NO, KC_NO, KC_##KB7 }, \ - { KC_##KB8, KC_NO, KC_##KBA, KC_##KBB, KC_NO, KC_NO, KC_NO, KC_##KBF }, \ - { KC_##KC0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_##KC8, KC_NO, KC_##KCA, KC_NO, KC_NO, KC_##KCD, KC_NO, KC_NO }, \ - { KC_##KD0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_##KDA, KC_NO, KC_NO, KC_NO, KC_##KDE, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_##KE9, KC_NO, KC_##KEB, KC_##KEC, KC_NO, KC_NO, KC_NO }, \ - { KC_##KF0, KC_##KF1, KC_##KF2, KC_NO, KC_##KF4, KC_##KF5, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_##KFA, KC_NO, KC_##KFC, KC_##KFD, KC_##KFE, KC_NO }, \ -} - -/* US layout */ -#define KEYMAP( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ -) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - NUBS, \ - RO, KANA, JYEN, HENK, MHEN, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ -) - -/* ISO layout */ -#define KEYMAP_ISO( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D,K5A, K6B,K73,K74,K79, \ - K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ -) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - K61, \ - RO, KANA, JYEN, HENK, MHEN, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ -) - -/* JIS layout */ -#define KEYMAP_JIS( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,K51, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K67,K29,K64,K13, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ -) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - NUBS, \ - K51, K13, K6A, K64, K67, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ -) - -#endif diff --git a/converter/ps2_usb/keymap_jis.c b/converter/ps2_usb/keymap_jis.c deleted file mode 100644 index 02585150fb..0000000000 --- a/converter/ps2_usb/keymap_jis.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * JIS layout Japanese keyboard - */ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: JIS LAYOUT - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak| - * `---' `---------------' `---------------' `---------------' `-----------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| JY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret | |Del|End|PgD| | 7| 8| 9| | - * |------------------------------------------------------` | `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| :| \| | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Gui |Alt |MHEN| Space |HENK|KANA|Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP_JIS( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, DEL, END, PGDN, P7, P8, P9, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,BSLS, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RO, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, MHEN,SPC, HENK,KANA, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/converter/ps2_usb/keymap_plain.c b/converter/ps2_usb/keymap_plain.c deleted file mode 100644 index 51b2fddb5b..0000000000 --- a/converter/ps2_usb/keymap_plain.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak| - * `---' `---------------' `---------------' `---------------' `-----------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | - * |-----------------------------------------------------------| `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/converter/ps2_usb/keymap_spacefn.c b/converter/ps2_usb/keymap_spacefn.c deleted file mode 100644 index bffd2bc606..0000000000 --- a/converter/ps2_usb/keymap_spacefn.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SpaceFN layout - * http://geekhack.org/index.php?topic=51069.0 - */ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak| - * `---' `---------------' `---------------' `---------------' `-----------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | - * |-----------------------------------------------------------| `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, FN0, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* 1: SpaceFN - * ,-----------------------------------------------------------. - * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - * |-----------------------------------------------------------| - * | | | |Esc| | | |Hom|Up |End|Psc|Slk|Pau|Ins | - * |-----------------------------------------------------------| - * | | | | | | |PgU|Lef|Dow|Rig| | | | - * |-----------------------------------------------------------| - * | | | | | |Spc|PgD|` |~ | |Men| | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP, END, PSCR,SLCK,PAUS,INS, DEL, END, PGDN, P7, P8, P9, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS, TRNS, P4, P5, P6, PPLS, - TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP, TRNS, UP, P1, P2, P3, - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), - [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde -}; - diff --git a/converter/ps2_usb/led.c b/converter/ps2_usb/led.c deleted file mode 100644 index e448e84ec7..0000000000 --- a/converter/ps2_usb/led.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2011 Jun Wako - -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 . -*/ - -#include "stdint.h" -#include "ps2.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - uint8_t ps2_led = 0; - if (usb_led & (1< - -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 . -*/ - -#include -#include -#include "action.h" -#include "print.h" -#include "util.h" -#include "debug.h" -#include "ps2.h" -#include "matrix.h" - - -static void matrix_make(uint8_t code); -static void matrix_break(uint8_t code); -static void matrix_clear(void); -#ifdef MATRIX_HAS_GHOST -static bool matrix_has_ghost_in_row(uint8_t row); -#endif - - -/* - * Matrix Array usage: - * 'Scan Code Set 2' is assigned into 256(32x8)cell matrix. - * Hmm, it is very sparse and not efficient :( - * - * Notes: - * Both 'Hanguel/English'(F1) and 'Hanja'(F2) collide with 'Delete'(E0 71) and 'Down'(E0 72). - * These two Korean keys need exceptional handling and are not supported for now. Sorry. - * - * 8bit wide - * +---------+ - * 0| | - * :| XX | 00-7F for normal codes(without E0-prefix) - * f|_________| - * 10| | - * :| E0 YY | 80-FF for E0-prefixed codes - * 1f| | (|0x80) is used as matrix position. - * +---------+ - * - * Exceptions: - * 0x83: F7(0x83) This is a normal code but beyond 0x7F. - * 0xFC: PrintScreen - * 0xFE: Pause - */ -static uint8_t matrix[MATRIX_ROWS]; -#define ROW(code) (code>>3) -#define COL(code) (code&0x07) - -// matrix positions for exceptional keys -#define F7 (0x83) -#define PRINT_SCREEN (0xFC) -#define PAUSE (0xFE) - -static bool is_modified = false; - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - ps2_host_init(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - - return; -} - -/* - * PS/2 Scan Code Set 2: Exceptional Handling - * - * There are several keys to be handled exceptionally. - * The scan code for these keys are varied or prefix/postfix'd - * depending on modifier key state. - * - * Keyboard Scan Code Specification: - * http://www.microsoft.com/whdc/archive/scancode.mspx - * http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc - * - * - * 1) Insert, Delete, Home, End, PageUp, PageDown, Up, Down, Right, Left - * a) when Num Lock is off - * modifiers | make | break - * ----------+---------------------------+---------------------- - * Ohter | | - * LShift | E0 F0 12 | E0 12 - * RShift | E0 F0 59 | E0 59 - * L+RShift | E0 F0 12 E0 F0 59 | E0 59 E0 12 - * - * b) when Num Lock is on - * modifiers | make | break - * ----------+---------------------------+---------------------- - * Other | E0 12 | E0 F0 12 - * Shift'd | | - * - * Handling: These prefix/postfix codes are ignored. - * - * - * 2) Keypad / - * modifiers | make | break - * ----------+---------------------------+---------------------- - * Ohter | | - * LShift | E0 F0 12 | E0 12 - * RShift | E0 F0 59 | E0 59 - * L+RShift | E0 F0 12 E0 F0 59 | E0 59 E0 12 - * - * Handling: These prefix/postfix codes are ignored. - * - * - * 3) PrintScreen - * modifiers | make | break - * ----------+--------------+----------------------------------- - * Other | E0 12 E0 7C | E0 F0 7C E0 F0 12 - * Shift'd | E0 7C | E0 F0 7C - * Control'd | E0 7C | E0 F0 7C - * Alt'd | 84 | F0 84 - * - * Handling: These prefix/postfix codes are ignored, and both scan codes - * 'E0 7C' and 84 are seen as PrintScreen. - * - * 4) Pause - * modifiers | make(no break code) - * ----------+-------------------------------------------------- - * Other | E1 14 77 E1 F0 14 F0 77 - * Control'd | E0 7E E0 F0 7E - * - * Handling: Both code sequences are treated as a whole. - * And we need a ad hoc 'pseudo break code' hack to get the key off - * because it has no break code. - * - */ -uint8_t matrix_scan(void) -{ - - // scan code reading states - static enum { - INIT, - F0, - E0, - E0_F0, - // Pause - E1, - E1_14, - E1_14_77, - E1_14_77_E1, - E1_14_77_E1_F0, - E1_14_77_E1_F0_14, - E1_14_77_E1_F0_14_F0, - // Control'd Pause - E0_7E, - E0_7E_E0, - E0_7E_E0_F0, - } state = INIT; - - - is_modified = false; - - // 'pseudo break code' hack - if (matrix_is_on(ROW(PAUSE), COL(PAUSE))) { - matrix_break(PAUSE); - } - - uint8_t code = ps2_host_recv(); - if (code) xprintf("%i\r\n", code); - if (!ps2_error) { - switch (state) { - case INIT: - switch (code) { - case 0xE0: - state = E0; - break; - case 0xF0: - state = F0; - break; - case 0xE1: - state = E1; - break; - case 0x83: // F7 - matrix_make(F7); - state = INIT; - break; - case 0x84: // Alt'd PrintScreen - matrix_make(PRINT_SCREEN); - state = INIT; - break; - case 0x00: // Overrun [3]p.25 - matrix_clear(); - clear_keyboard(); - print("Overrun\n"); - state = INIT; - break; - default: // normal key make - if (code < 0x80) { - matrix_make(code); - } else { - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at INIT: %02X\n", code); - } - state = INIT; - } - break; - case E0: // E0-Prefixed - switch (code) { - case 0x12: // to be ignored - case 0x59: // to be ignored - state = INIT; - break; - case 0x7E: // Control'd Pause - state = E0_7E; - break; - case 0xF0: - state = E0_F0; - break; - default: - if (code < 0x80) { - matrix_make(code|0x80); - } else { - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at E0: %02X\n", code); - } - state = INIT; - } - break; - case F0: // Break code - switch (code) { - case 0x83: // F7 - matrix_break(F7); - state = INIT; - break; - case 0x84: // Alt'd PrintScreen - matrix_break(PRINT_SCREEN); - state = INIT; - break; - case 0xF0: - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at F0: F0(clear and cont.)\n"); - break; - default: - if (code < 0x80) { - matrix_break(code); - } else { - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at F0: %02X\n", code); - } - state = INIT; - } - break; - case E0_F0: // Break code of E0-prefixed - switch (code) { - case 0x12: // to be ignored - case 0x59: // to be ignored - state = INIT; - break; - default: - if (code < 0x80) { - matrix_break(code|0x80); - } else { - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at E0_F0: %02X\n", code); - } - state = INIT; - } - break; - // following are states of Pause - case E1: - switch (code) { - case 0x14: - state = E1_14; - break; - default: - state = INIT; - } - break; - case E1_14: - switch (code) { - case 0x77: - state = E1_14_77; - break; - default: - state = INIT; - } - break; - case E1_14_77: - switch (code) { - case 0xE1: - state = E1_14_77_E1; - break; - default: - state = INIT; - } - break; - case E1_14_77_E1: - switch (code) { - case 0xF0: - state = E1_14_77_E1_F0; - break; - default: - state = INIT; - } - break; - case E1_14_77_E1_F0: - switch (code) { - case 0x14: - state = E1_14_77_E1_F0_14; - break; - default: - state = INIT; - } - break; - case E1_14_77_E1_F0_14: - switch (code) { - case 0xF0: - state = E1_14_77_E1_F0_14_F0; - break; - default: - state = INIT; - } - break; - case E1_14_77_E1_F0_14_F0: - switch (code) { - case 0x77: - matrix_make(PAUSE); - state = INIT; - break; - default: - state = INIT; - } - break; - // Following are states of Control'd Pause - case E0_7E: - if (code == 0xE0) - state = E0_7E_E0; - else - state = INIT; - break; - case E0_7E_E0: - if (code == 0xF0) - state = E0_7E_E0_F0; - else - state = INIT; - break; - case E0_7E_E0_F0: - if (code == 0x7E) - matrix_make(PAUSE); - state = INIT; - break; - default: - state = INIT; - } - } - - // TODO: request RESEND when error occurs? -/* - if (PS2_IS_FAILED(ps2_error)) { - uint8_t ret = ps2_host_send(PS2_RESEND); - xprintf("Resend: %02X\n", ret); - } -*/ - return 1; -} - -bool matrix_is_modified(void) -{ - return is_modified; -} - -inline -bool matrix_has_ghost(void) -{ -#ifdef MATRIX_HAS_GHOST - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - if (matrix_has_ghost_in_row(i)) - return true; - } -#endif - return false; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & (1<> 8) & 0xFF) -/* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you may use one of obdev's free - * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) -/* This is the ID of the product, low byte first. It is interpreted in the - * scope of the vendor ID. If you have registered your own VID with usb.org - * or if you have licensed a PID from somebody else, define it here. Otherwise - * you may use one of obdev's free shared VID/PID pairs. See the file - * USB-IDs-for-free.txt for details! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_VERSION 0x00, 0x01 -/* Version number of the device: Minor number first, then major number. - */ -#define USB_CFG_VENDOR_NAME 't', '.', 'm', '.', 'k', '.' -#define USB_CFG_VENDOR_NAME_LEN 6 -/* These two values define the vendor name returned by the USB device. The name - * must be given as a list of characters under single quotes. The characters - * are interpreted as Unicode (UTF-16) entities. - * If you don't want a vendor name string, undefine these macros. - * ALWAYS define a vendor name containing your Internet domain name if you use - * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for - * details. - */ -#define USB_CFG_DEVICE_NAME 'P', 'S', '/', '2', ' ', 'k', 'e', 'y', 'b', 'o', 'a', 'r', 'd', ' ', 'c', 'o', 'n', 'v', 'e', 'r', 't', 'e', 'r' -#define USB_CFG_DEVICE_NAME_LEN 23 -/* Same as above for the device name. If you don't want a device name, undefine - * the macros. See the file USB-IDs-for-free.txt before you assign a name if - * you use a shared VID/PID. - */ -/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ -/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ -/* Same as above for the serial number. If you don't want a serial number, - * undefine the macros. - * It may be useful to provide the serial number through other means than at - * compile time. See the section about descriptor properties below for how - * to fine tune control over USB descriptors such as the string descriptor - * for the serial number. - */ -#define USB_CFG_DEVICE_CLASS 0 -#define USB_CFG_DEVICE_SUBCLASS 0 -/* See USB specification if you want to conform to an existing device class. - * Class 0xff is "vendor specific". - */ -#define USB_CFG_INTERFACE_CLASS 3 /* HID */ -#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ -#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ -/* See USB specification if you want to conform to an existing device class or - * protocol. The following classes must be set at interface level: - * HID class is 3, no subclass and protocol required (but may be useful!) - * CDC class is 2, use subclass 2 and protocol 1 for ACM - */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 -/* Define this to the length of the HID report descriptor, if you implement - * an HID device. Otherwise don't define it or define it to 0. - * If you use this define, you must add a PROGMEM character array named - * "usbHidReportDescriptor" to your code which contains the report descriptor. - * Don't forget to keep the array and this define in sync! - */ - -/* #define USB_PUBLIC static */ -/* Use the define above if you #include usbdrv.c instead of linking against it. - * This technique saves a couple of bytes in flash memory. - */ - -/* ------------------- Fine Control over USB Descriptors ------------------- */ -/* If you don't want to use the driver's default USB descriptors, you can - * provide our own. These can be provided as (1) fixed length static data in - * flash memory, (2) fixed length static data in RAM or (3) dynamically at - * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more - * information about this function. - * Descriptor handling is configured through the descriptor's properties. If - * no properties are defined or if they are 0, the default descriptor is used. - * Possible properties are: - * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched - * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is - * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if - * you want RAM pointers. - * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found - * in static memory is in RAM, not in flash memory. - * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), - * the driver must know the descriptor's length. The descriptor itself is - * found at the address of a well known identifier (see below). - * List of static descriptor names (must be declared PROGMEM if in flash): - * char usbDescriptorDevice[]; - * char usbDescriptorConfiguration[]; - * char usbDescriptorHidReport[]; - * char usbDescriptorString0[]; - * int usbDescriptorStringVendor[]; - * int usbDescriptorStringDevice[]; - * int usbDescriptorStringSerialNumber[]; - * Other descriptors can't be provided statically, they must be provided - * dynamically at runtime. - * - * Descriptor properties are or-ed or added together, e.g.: - * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) - * - * The following descriptors are defined: - * USB_CFG_DESCR_PROPS_DEVICE - * USB_CFG_DESCR_PROPS_CONFIGURATION - * USB_CFG_DESCR_PROPS_STRINGS - * USB_CFG_DESCR_PROPS_STRING_0 - * USB_CFG_DESCR_PROPS_STRING_VENDOR - * USB_CFG_DESCR_PROPS_STRING_PRODUCT - * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER - * USB_CFG_DESCR_PROPS_HID - * USB_CFG_DESCR_PROPS_HID_REPORT - * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) - * - * Note about string descriptors: String descriptors are not just strings, they - * are Unicode strings prefixed with a 2 byte header. Example: - * int serialNumberDescriptor[] = { - * USB_STRING_DESCRIPTOR_HEADER(6), - * 'S', 'e', 'r', 'i', 'a', 'l' - * }; - */ - -#define USB_CFG_DESCR_PROPS_DEVICE 0 -#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 -#define USB_CFG_DESCR_PROPS_STRINGS 0 -#define USB_CFG_DESCR_PROPS_STRING_0 0 -#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 -#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 -#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 -//#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_HID 0 -#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 -#define USB_CFG_DESCR_PROPS_UNKNOWN 0 - -/* ----------------------- Optional MCU Description ------------------------ */ - -/* The following configurations have working defaults in usbdrv.h. You - * usually don't need to set them explicitly. Only if you want to run - * the driver on a device which is not yet supported or with a compiler - * which is not fully supported (such as IAR C) or if you use a differnt - * interrupt than INT0, you may have to define some of these. - */ -/* #define USB_INTR_CFG MCUCR */ -/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE GIMSK */ -/* #define USB_INTR_ENABLE_BIT INT0 */ -/* #define USB_INTR_PENDING GIFR */ -/* #define USB_INTR_PENDING_BIT INTF0 */ -/* #define USB_INTR_VECTOR INT0_vect */ - -#endif /* __usbconfig_h_included__ */ -- cgit v1.2.3