ibmpc_usb: Support secondary IF and mouse by default

This commit is contained in:
tmk 2021-08-17 18:03:07 +09:00
parent b72a600d59
commit 4d6e7f35bc
4 changed files with 36 additions and 38 deletions

View file

@ -8,8 +8,10 @@ TMK_DIR ?= ../../tmk_core
TARGET_DIR ?= .
# project specific files
SRC ?= protocol/ibmpc.c \
ibmpc_usb.c
#SRC ?= protocol/ibmpc.c \
# ibmpc_usb.c
SRC ?= protocol/ibmpc.cpp \
ibmpc_usb.cpp
CONFIG_H ?= config.h
@ -68,19 +70,19 @@ OPT_DEFS += -DSUSPEND_MODE_STANDBY
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE ?= no # 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
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1150)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+2200)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+400)
CONSOLE_ENABLE ?= yes # Console for debug(+4150)
COMMAND_ENABLE ?= no # Commands for debug and configuration(+3600)
NKRO_ENABLE ?= yes # USB Nkey Rollover(+350)
KEYMAP_SECTION_ENABLE ?= yes
UNIMAP_ENABLE ?= yes
# IBMPC Options
IBMPC_SECONDARY ?= no # enable secondary interface
IBMPC_MOUSE_ENABLE ?= no # enable mouse support
IBMPC_SECONDARY ?= yes # enable secondary interface(+800)
IBMPC_MOUSE_ENABLE ?= yes # enable mouse support(+2000)
# Optimize size but this may cause error "relocation truncated to fit"

View file

@ -1,12 +0,0 @@
# With two interfaces on PS/2 connector
TARGET ?= ibmpc_usb_x2
MCU = atmega32u2
SRC ?= protocol/ibmpc.cpp \
ibmpc_usb.cpp
COMMAND_ENABLE ?= no # Commands for debug and configuration
IBMPC_SECONDARY ?= yes # enable secondary interface
IBMPC_MOUSE_ENABLE ?= yes # enable mouse support
include Makefile

View file

@ -51,6 +51,8 @@ Firmware
### Build Options
Secondary interface and PS/2 mouses can be supported.
In Makefiile:
# IBMPC Options
@ -88,21 +90,22 @@ Pull up resistors of 1-4.7K Ohm on both Data and Clock line are recommended, wit
- Data PD0
- Clock PD1
- Reset PB6 or PB7 (For some of XT keyboards. Not needed for AT, PS/2 and Terminal)
- Reset PB6 or PB7
For optional secondary interface use these pins.
- Data PD2
- Clock PD3
For optional secondary interface use these pins. See PS/2 connector pinouts below.
- Data2 PD2
- Clock2 PD3
### Reset
Old Type-1 IBM XT keyboard and some of XT clones need Reset pin to starup its controller.
Connect Reset pin to pin3 of DIN-5(180-degree) connector. This should not harm keyboards which don't require reset,
it is safe and recommended to have Reset pin on AT/XT converter.
Use pin3 of DIN-5(180-degree) connector for Reset.
Zenith Z-150 XT and Leading Edge DC-2014 are also known to need this.
Reset should not harm keyboards even if they don't require it. It is safe and recommended to have Reset pin on AT/XT converter.
See this for IBM XT Type-1 vs Type-2: https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol#type-1-vs-type-2
Old Type-1 IBM XT keyboard and some of XT clones including Zenith Z-150 XT and Leading Edge DC-2014 are known to need Reset pin. AT, PS/2 and Terminal keyboards don't need it.
See this for details: https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol#keyboard-hard-reset
### Connector pinouts
@ -124,6 +127,15 @@ See this for IBM XT Type-1 vs Type-2: https://github.com/tmk/tmk_keyboard/wiki/I
#### PS/2 - Mini-DIN-6
- https://pinouts.ru/InputCables/KeyboardPC6_pinout.shtml
PS/2 female socket from the front:
,--_--. 1: Data
/ o6 5o \ 2: Data2
| o4 3o | 3: GND
- 2o o1 - 4: VCC
`-___-' 5: Clock
6: Clock2
For secondary interface use pin2 and pin6 for data and clock respectively.
You can use PS/2 Y-splitter cable to access secondary interface.

View file

@ -21,11 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <avr/interrupt.h>
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x1bee
#define DEVICE_VER 0x0001
#define MANUFACTURER t.m.k.
#define PRODUCT_ID 0x1BEE
#define DEVICE_VER 0x0201
#define MANUFACTURER TMK
#define PRODUCT IBM PC keyboard converter
#define DESCRIPTION convert IBM PC keyboard to USB
/* matrix size */
@ -42,9 +41,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// G80-2551 terminal keyboard support
#define G80_2551_SUPPORT
// PS/2 Mouse support
//#define IBMPC_MOUSE_ENABLE
// Mouse Extended Report
//#define MOUSE_EXT_REPORT