1 /* Copyright 2017 Mattia Dal Ben
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "config_common.h"
21 /* USB Device descriptor parameter */
23 #define VENDOR_ID 0xFEED
24 #define PRODUCT_ID 0x6060
25 #define DEVICE_VER 0x0001
26 #define MANUFACTURER Mattia Dal Ben
27 #define PRODUCT Redox_wireless
28 #define DESCRIPTION q.m.k. keyboard firmware for Redox-w
32 #define MATRIX_COLS 14
34 /* define if matrix has ghost */
35 //#define MATRIX_HAS_GHOST
37 /* number of backlight levels */
38 //#define BACKLIGHT_LEVELS 3
40 #define ONESHOT_TIMEOUT 500
43 * Feature disable options
44 * These options are also useful to firmware size reduction.
47 /* disable debug print */
53 /* disable action features */
54 //#define NO_ACTION_LAYER
55 //#define NO_ACTION_TAPPING
56 //#define NO_ACTION_ONESHOT
57 //#define NO_ACTION_MACRO
58 //#define NO_ACTION_FUNCTION
60 //UART settings for communication with the RF microcontroller
61 #define SERIAL_UART_BAUD 1000000
62 #define SERIAL_UART_DATA UDR1
63 #define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
64 #define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
65 #define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
66 #define SERIAL_UART_INIT() do { \
68 UBRR1L = SERIAL_UART_UBRR; \
70 UBRR1H = SERIAL_UART_UBRR >> 8; \
71 /* enable TX and RX */ \
72 UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
74 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \