X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=converter%2Fpc98_usb%2Fconfig.h;h=b8d676e4cfacae5d5435fcedfe93005e94d37b50;hb=338744ba2fdfdcd07824f325a8112e041d6cd0a5;hp=6f9f8fc3cf17d948634cc7730dfaa3e924a62c40;hpb=eb776c1b7918f320b717cedfd8957f55e53c5adf;p=max%2Ftmk_keyboard.git diff --git a/converter/pc98_usb/config.h b/converter/pc98_usb/config.h index 6f9f8fc3..b8d676e4 100644 --- a/converter/pc98_usb/config.h +++ b/converter/pc98_usb/config.h @@ -19,7 +19,7 @@ along with this program. If not, see . #define CONFIG_H #define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x3333 +#define PRODUCT_ID 0x9898 #define DEVICE_VER 0x0100 #define MANUFACTURER t.m.k. #define PRODUCT PC98 keyboard converter @@ -27,71 +27,97 @@ along with this program. If not, see . /* 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() ( \ + host_get_first_key() == KC_CANCEL \ ) -/* PC98 control */ + +/* 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 #define PC98_RDY_BIT 4 +/* PC98 Retry Port */ #define PC98_RTY_DDR DDRD #define PC98_RTY_PORT PORTD #define PC98_RTY_BIT 5 -/* Serial(USART) configuration - * asynchronous, negative logic, 19200baud, no flow control +/* + * 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 - -#define SERIAL_RXD_DDR DDRD -#define SERIAL_RXD_PORT PORTD -#define SERIAL_RXD_PIN PIND -#define SERIAL_RXD_BIT 2 -#define SERIAL_RXD_VECT INT2_vect -#define SERIAL_RXD_INIT() do { \ +/* + * Software Serial + */ +#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_SOFT_RXD_DDR DDRD +#define SERIAL_SOFT_RXD_PORT PORTD +#define SERIAL_SOFT_RXD_PIN PIND +#define SERIAL_SOFT_RXD_BIT 2 +#define SERIAL_SOFT_RXD_READ() (SERIAL_SOFT_RXD_PIN&(1<>8); /* baud rate */ \ + UCSR1B |= (1<