From 5477bf39bfc01468ea8c09f025cf9c5ee3efd1b7 Mon Sep 17 00:00:00 2001 From: Enochen Date: Mon, 9 Jul 2018 21:12:59 -0400 Subject: add hhkb bluetooth functionality (rn42) (#2693) * add hhkb bluetooth functionality (rn42) pretty much straight from tmk some minor changes to make things work * hhkb jp personal keymap * Revert "hhkb jp personal keymap" This reverts commit 886713d8bb98572f03110f285706a8140a083892. --- keyboards/hhkb/config.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'keyboards/hhkb/config.h') diff --git a/keyboards/hhkb/config.h b/keyboards/hhkb/config.h index 3f0528b4b9..af7ecc5e25 100644 --- a/keyboards/hhkb/config.h +++ b/keyboards/hhkb/config.h @@ -54,6 +54,47 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +#ifdef HHKB_RN42_ENABLE +// rn42 support -- acquired from the tmk repo. This is almost certainly not +// integrated with qmk in the correct way. + +#define SUART_OUT_PORT PORTD +#define SUART_OUT_BIT 0 +#define SUART_IN_PIN PIND +#define SUART_IN_BIT 1 + +#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<