2 Copyright 2012 Jun Wako <wakojun@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #define VENDOR_ID 0xFEED
22 #define PRODUCT_ID 0x3333
23 #define DEVICE_VER 0x0100
24 #define MANUFACTURER t.m.k.
25 #define PRODUCT Sun keyboard converter
26 #define DESCRIPTION converts Sun keyboard protocol into USB
29 #define MATRIX_ROWS 16
32 /* key combination for command */
33 #define IS_COMMAND() ( \
34 keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \
35 keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \
36 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
39 /* legacy keymap support */
40 #define USE_LEGACY_KEYMAP
42 /* Boot Section Size in *BYTEs*
44 * Teensy++ halfKay 1024
45 * Atmel DFU loader 4096
46 * LUFA bootloader 4096
49 #define BOOTLOADER_SIZE 4096
52 /* Serial(USART) configuration
53 * asynchronous, negative logic, 1200baud, no flow control
54 * 1-start bit, 8-data bit, non parity, 1-stop bit
56 #define SERIAL_SOFT_BAUD 1200
57 #define SERIAL_SOFT_PARITY_NONE
58 #define SERIAL_SOFT_BIT_ORDER_LSB
59 #define SERIAL_SOFT_LOGIC_NEGATIVE
61 #define SERIAL_SOFT_RXD_ENABLE
62 #define SERIAL_SOFT_RXD_DDR DDRD
63 #define SERIAL_SOFT_RXD_PORT PORTD
64 #define SERIAL_SOFT_RXD_PIN PIND
65 #define SERIAL_SOFT_RXD_BIT 2
66 #define SERIAL_SOFT_RXD_VECT INT2_vect
68 #define SERIAL_SOFT_RXD_INIT() do { \
69 /* pin configuration: input with pull-up */ \
70 SERIAL_SOFT_RXD_DDR &= ~(1<<SERIAL_SOFT_RXD_BIT); \
71 SERIAL_SOFT_RXD_PORT |= (1<<SERIAL_SOFT_RXD_BIT); \
72 /* enable interrupt: INT2(rising edge) */ \
73 EICRA |= ((1<<ISC21)|(1<<ISC20)); \
77 #define SERIAL_SOFT_RXD_INT_ENTER()
78 #define SERIAL_SOFT_RXD_INT_EXIT() do { \
79 /* clear interrupt flag */ \
82 #define SERIAL_SOFT_RXD_READ() (SERIAL_SOFT_RXD_PIN&(1<<SERIAL_SOFT_RXD_BIT))
84 #define SERIAL_SOFT_TXD_ENABLE
85 #define SERIAL_SOFT_TXD_DDR DDRD
86 #define SERIAL_SOFT_TXD_PORT PORTD
87 #define SERIAL_SOFT_TXD_PIN PIND
88 #define SERIAL_SOFT_TXD_BIT 3
89 #define SERIAL_SOFT_TXD_HI() do { SERIAL_SOFT_TXD_PORT |= (1<<SERIAL_SOFT_TXD_BIT); } while (0)
90 #define SERIAL_SOFT_TXD_LO() do { SERIAL_SOFT_TXD_PORT &= ~(1<<SERIAL_SOFT_TXD_BIT); } while (0)
91 #define SERIAL_SOFT_TXD_INIT() do { \
92 /* pin configuration: output */ \
93 SERIAL_SOFT_TXD_DDR |= (1<<SERIAL_SOFT_TXD_BIT); \
95 SERIAL_SOFT_TXD_ON(); \