X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=converter%2Fpc98_usb%2Fconfig.h;h=d3898d905f0609da50dba3b7856527f21f4f332a;hb=aa5dd8fccfa372caf926aa8ef826380005b47609;hp=6ef2c6ac30b71816379103ceae433b8d5130e4bb;hpb=4a91d182776a956c5442debbaf7a8af047d429c0;p=max%2Ftmk_keyboard.git diff --git a/converter/pc98_usb/config.h b/converter/pc98_usb/config.h index 6ef2c6ac..d3898d90 100644 --- a/converter/pc98_usb/config.h +++ b/converter/pc98_usb/config.h @@ -19,38 +19,37 @@ along with this program. If not, see . #define CONFIG_H #define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x9898 -#define DEVICE_VER 0x0100 +#define PRODUCT_ID 0x9801 +#define DEVICE_VER 0x0101 #define MANUFACTURER t.m.k. #define PRODUCT PC98 keyboard converter #define DESCRIPTION converts PC98 keyboard protocol into USB /* matrix size */ -#define MATRIX_ROWS 16 -#define MATRIX_COLS 8 - +#define MATRIX_ROWS 16 +#define MATRIX_COLS 8 /* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +#define IS_COMMAND() ( \ + keyboard_report->keys[0] == KC_STOP || \ + keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \ ) -/* PC98 Serial(USART) configuration - * asynchronous, positive logic, 19200baud, bit order: LSB first - * 1-start bit, 8-data bit, odd parity, 1-stop bit - */ -#define SERIAL_BAUD 19200 -#define SERIAL_PARITY_ODD -#define SERIAL_BIT_ORDER_LSB +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* Control LED indicatiors, which doesn't work well with locking support */ +#define PC98_LED_CONTROL -/* PC98 Reset Port */ + +/* PC98 Reset Port shared with TXD */ #define PC98_RST_DDR DDRD #define PC98_RST_PORT PORTD -#define PC98_RST_BIT 1 +#define PC98_RST_BIT 3 /* PC98 Ready Port */ #define PC98_RDY_DDR DDRD #define PC98_RDY_PORT PORTD @@ -58,43 +57,81 @@ along with this program. If not, see . /* PC98 Retry Port */ #define PC98_RTY_DDR DDRD #define PC98_RTY_PORT PORTD -#define PC98_RTY_BIT 5 +#define PC98_RTY_BIT 1 + +/* + * PC98 Serial(USART) configuration + * asynchronous, positive logic, 19200baud, bit order: LSB first + * 1-start bit, 8-data bit, odd parity, 1-stop bit + */ +/* + * Software Serial + * Add protocol/serial_soft.c to SRC in Makefile + */ +#define SERIAL_SOFT_BAUD 19200 +#define SERIAL_SOFT_PARITY_ODD +#define SERIAL_SOFT_BIT_ORDER_LSB +#define SERIAL_SOFT_LOGIC_POSITIVE /* RXD Port */ -#define SERIAL_RXD_DDR DDRD -#define SERIAL_RXD_PORT PORTD -#define SERIAL_RXD_PIN PIND -#define SERIAL_RXD_BIT 2 -#define SERIAL_RXD_READ() (SERIAL_RXD_PIN&(1<>8); /* baud rate */ \ + UCSR1B |= (1<