From 4069776c022502f117b83b66c5a71700135acfbc Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 25 Jun 2014 13:57:36 +0900 Subject: Add initial files for RN-42 --- keyboard/hhkb_rn42/config.h | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 keyboard/hhkb_rn42/config.h (limited to 'keyboard/hhkb_rn42/config.h') diff --git a/keyboard/hhkb_rn42/config.h b/keyboard/hhkb_rn42/config.h new file mode 100644 index 0000000000..a8f76ae6b0 --- /dev/null +++ b/keyboard/hhkb_rn42/config.h @@ -0,0 +1,67 @@ +/* +Copyright 2011 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCAFE +#define DEVICE_VER 0x0104 +#define MANUFACTURER t.m.k. +#define PRODUCT HHKB mod +#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod + + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + + +/* period of tapping(ms) */ +#define TAPPING_TERM 300 +/* tap count needed for toggling a feature */ +#define TAPPING_TOGGLE 5 +/* Oneshot timeout(ms) */ +#define ONESHOT_TIMEOUT 300 + +/* Boot Magic salt key: Space */ +#define BOOTMAGIC_KEY_SALT KC_FN6 + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif -- cgit v1.2.3 From 31a298f9d9bc78f504d662e1590ec333c1f37735 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 1 Jul 2014 04:29:45 +0900 Subject: Add RN-42 Bluetooth module support --- keyboard/hhkb_rn42/config.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'keyboard/hhkb_rn42/config.h') diff --git a/keyboard/hhkb_rn42/config.h b/keyboard/hhkb_rn42/config.h index a8f76ae6b0..a0ab878eb8 100644 --- a/keyboard/hhkb_rn42/config.h +++ b/keyboard/hhkb_rn42/config.h @@ -47,6 +47,35 @@ along with this program. If not, see . #define BOOTMAGIC_KEY_SALT KC_FN6 +/* + * Hardware Serial(UART) + * Baud rate are calculated with round off(+0.5). + */ +#ifdef __AVR_ATmega32U4__ + /* iom32u4.h has no definition of UCSR1D. copy from iom32u2.h */ + #define UCSR1D _SFR_MEM8(0xCB) + #define RTSEN 0 + #define CTSEN 1 + + #define SERIAL_UART_BAUD 115200 + #define SERIAL_UART_DATA UDR1 + #define SERIAL_UART_UBRR ((F_CPU/(16.0*SERIAL_UART_BAUD)-1+0.5)) + #define SERIAL_UART_RXD_VECT USART1_RX_vect + #define SERIAL_UART_TXD_READY (UCSR1A&(1<>8); /* baud rate */ \ + UCSR1B |= (1< Date: Mon, 14 Jul 2014 15:20:10 +0900 Subject: Add software UART and battery monitor --- keyboard/hhkb_rn42/config.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'keyboard/hhkb_rn42/config.h') diff --git a/keyboard/hhkb_rn42/config.h b/keyboard/hhkb_rn42/config.h index a0ab878eb8..5e6d7a6436 100644 --- a/keyboard/hhkb_rn42/config.h +++ b/keyboard/hhkb_rn42/config.h @@ -76,6 +76,13 @@ along with this program. If not, see . #endif +/* for debug */ +#define SUART_OUT_PORT PORTD +#define SUART_OUT_BIT 0 +#define SUART_IN_PIN PIND +#define SUART_IN_BIT 1 + + /* * Feature disable options * These options are also useful to firmware size reduction. -- cgit v1.2.3 From b4e4f599dfe1b3ecff69ab248866e7b801c35f1e Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 17 Jul 2014 16:59:22 +0900 Subject: Add rn42_task --- keyboard/hhkb_rn42/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboard/hhkb_rn42/config.h') diff --git a/keyboard/hhkb_rn42/config.h b/keyboard/hhkb_rn42/config.h index 5e6d7a6436..cd8fc176de 100644 --- a/keyboard/hhkb_rn42/config.h +++ b/keyboard/hhkb_rn42/config.h @@ -20,7 +20,7 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xCAFE +#define PRODUCT_ID 0x4242 #define DEVICE_VER 0x0104 #define MANUFACTURER t.m.k. #define PRODUCT HHKB mod -- cgit v1.2.3 From 3e7875455ed392ce5238efa0734e82995e1f8040 Mon Sep 17 00:00:00 2001 From: tmk Date: Sun, 20 Jul 2014 14:42:44 +0900 Subject: Add flow control by firmware to serial_uart --- keyboard/hhkb_rn42/config.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'keyboard/hhkb_rn42/config.h') diff --git a/keyboard/hhkb_rn42/config.h b/keyboard/hhkb_rn42/config.h index cd8fc176de..e641a5a2bb 100644 --- a/keyboard/hhkb_rn42/config.h +++ b/keyboard/hhkb_rn42/config.h @@ -57,20 +57,23 @@ along with this program. If not, see . #define RTSEN 0 #define CTSEN 1 - #define SERIAL_UART_BAUD 115200 - #define SERIAL_UART_DATA UDR1 - #define SERIAL_UART_UBRR ((F_CPU/(16.0*SERIAL_UART_BAUD)-1+0.5)) - #define SERIAL_UART_RXD_VECT USART1_RX_vect - #define SERIAL_UART_TXD_READY (UCSR1A&(1<>8); /* baud rate */ \ UCSR1B |= (1< Date: Wed, 20 Aug 2014 13:36:15 +0900 Subject: Add support for HHKB JP --- keyboard/hhkb_rn42/config.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'keyboard/hhkb_rn42/config.h') diff --git a/keyboard/hhkb_rn42/config.h b/keyboard/hhkb_rn42/config.h index e641a5a2bb..a46c7a8bf0 100644 --- a/keyboard/hhkb_rn42/config.h +++ b/keyboard/hhkb_rn42/config.h @@ -28,7 +28,11 @@ along with this program. If not, see . /* matrix size */ -#define MATRIX_ROWS 8 +#ifdef HHKB_JP +# define MATRIX_ROWS 16 +#else +# define MATRIX_ROWS 8 +#endif #define MATRIX_COLS 8 -- cgit v1.2.3 From 6c06b9031fd09479d552f9750a3b1cfe259678fd Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 2 Oct 2014 09:58:47 +0900 Subject: Add power control of key switch board --- keyboard/hhkb_rn42/config.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'keyboard/hhkb_rn42/config.h') diff --git a/keyboard/hhkb_rn42/config.h b/keyboard/hhkb_rn42/config.h index a46c7a8bf0..21e73f1c53 100644 --- a/keyboard/hhkb_rn42/config.h +++ b/keyboard/hhkb_rn42/config.h @@ -50,6 +50,8 @@ along with this program. If not, see . /* Boot Magic salt key: Space */ #define BOOTMAGIC_KEY_SALT KC_FN6 +/* power control of key switch board */ +#define HHKB_POWER_SAVING /* * Hardware Serial(UART) -- cgit v1.2.3