diff options
Diffstat (limited to 'keyboards/hhkb/jp/config.h')
| -rw-r--r-- | keyboards/hhkb/jp/config.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/keyboards/hhkb/jp/config.h b/keyboards/hhkb/jp/config.h new file mode 100644 index 000000000..01dab6d44 --- /dev/null +++ b/keyboards/hhkb/jp/config.h | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 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. | ||
| 8 | |||
| 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. | ||
| 13 | |||
| 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/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #pragma once | ||
| 19 | |||
| 20 | #include "config_common.h" | ||
| 21 | |||
| 22 | /* USB Device descriptor parameter */ | ||
| 23 | #define VENDOR_ID 0x4848 // HH = happy hacking | ||
| 24 | #define PRODUCT_ID 0x0002 // HHKB JP | ||
| 25 | #define DEVICE_VER 0x0104 | ||
| 26 | #define MANUFACTURER q.m.k | ||
| 27 | #define PRODUCT HHKB mod | ||
| 28 | #define DESCRIPTION q.m.k keyboard firmware for HHKB | ||
| 29 | |||
| 30 | /* key matrix size */ | ||
| 31 | #define MATRIX_ROWS 16 | ||
| 32 | #define MATRIX_COLS 8 | ||
| 33 | |||
| 34 | #define TAPPING_TERM 200 | ||
| 35 | |||
| 36 | /* number of backlight levels */ | ||
| 37 | #define BACKLIGHT_LEVELS 3 | ||
| 38 | |||
| 39 | /* Set 0 if debouncing isn't needed */ | ||
| 40 | #define DEBOUNCE 5 | ||
| 41 | |||
| 42 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 43 | //#define LOCKING_SUPPORT_ENABLE | ||
| 44 | /* Locking resynchronize hack */ | ||
| 45 | //#define LOCKING_RESYNC_ENABLE | ||
| 46 | |||
| 47 | #ifdef HHKB_RN42_ENABLE | ||
| 48 | // rn42 support -- acquired from the tmk repo. This is almost certainly not | ||
| 49 | // integrated with qmk in the correct way. | ||
| 50 | |||
| 51 | #define SUART_OUT_PORT PORTD | ||
| 52 | #define SUART_OUT_BIT 0 | ||
| 53 | #define SUART_IN_PIN PIND | ||
| 54 | #define SUART_IN_BIT 1 | ||
| 55 | |||
| 56 | #ifdef __AVR_ATmega32U4__ | ||
| 57 | /* iom32u4.h has no definition of UCSR1D. copy from iom32u2.h */ | ||
| 58 | #define UCSR1D _SFR_MEM8(0xCB) | ||
| 59 | #define RTSEN 0 | ||
| 60 | #define CTSEN 1 | ||
| 61 | |||
| 62 | #define SERIAL_UART_BAUD 115200 | ||
| 63 | #define SERIAL_UART_DATA UDR1 | ||
| 64 | #define SERIAL_UART_UBRR ((F_CPU/(16.0*SERIAL_UART_BAUD)-1+0.5)) | ||
| 65 | #define SERIAL_UART_RXD_VECT USART1_RX_vect | ||
| 66 | #define SERIAL_UART_TXD_READY (UCSR1A&(1<<UDRE1)) | ||
| 67 | #define SERIAL_UART_INIT() do { \ | ||
| 68 | UBRR1L = (uint8_t) SERIAL_UART_UBRR; /* baud rate */ \ | ||
| 69 | UBRR1H = ((uint16_t)SERIAL_UART_UBRR>>8); /* baud rate */ \ | ||
| 70 | UCSR1B |= (1<<RXCIE1) | (1<<RXEN1); /* RX interrupt, RX: enable */ \ | ||
| 71 | UCSR1B |= (0<<TXCIE1) | (1<<TXEN1); /* TX interrupt, TX: enable */ \ | ||
| 72 | UCSR1C |= (0<<UPM11) | (0<<UPM10); /* parity: none(00), even(01), odd(11) */ \ | ||
| 73 | UCSR1D |= (0<<RTSEN) | (0<<CTSEN); /* RTS, CTS(no flow control by hardware) */ \ | ||
| 74 | DDRD |= (1<<5); PORTD &= ~(1<<5); /* RTS for flow control by firmware */ \ | ||
| 75 | sei(); \ | ||
| 76 | } while(0) | ||
| 77 | #define SERIAL_UART_RTS_LO() do { PORTD &= ~(1<<5); } while (0) | ||
| 78 | #define SERIAL_UART_RTS_HI() do { PORTD |= (1<<5); } while (0) | ||
| 79 | #else | ||
| 80 | #error "USART configuration is needed." | ||
| 81 | #endif | ||
| 82 | |||
| 83 | /* power control of key switch board */ | ||
| 84 | #define HHKB_POWER_SAVING | ||
| 85 | |||
| 86 | #endif | ||
| 87 | |||
| 88 | /* | ||
| 89 | * Feature disable options | ||
| 90 | * These options are also useful to firmware size reduction. | ||
| 91 | */ | ||
| 92 | |||
| 93 | /* disable debug print */ | ||
| 94 | //#define NO_DEBUG | ||
| 95 | |||
| 96 | /* disable print */ | ||
| 97 | //#define NO_PRINT | ||
| 98 | |||
| 99 | /* disable action features */ | ||
| 100 | //#define NO_ACTION_LAYER | ||
| 101 | //#define NO_ACTION_TAPPING | ||
| 102 | //#define NO_ACTION_ONESHOT | ||
| 103 | //#define NO_ACTION_MACRO | ||
| 104 | //#define NO_ACTION_FUNCTION | ||
