]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/config_common.h
Adds support for Planck Rev 6 (#2666)
[qmk_firmware.git] / quantum / config_common.h
1 /* Copyright 2015-2017 Jack Humbert
2  *
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.
7  *
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.
12  *
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/>.
15  */
16
17 #ifndef CONFIG_DEFINITIONS_H
18 #define CONFIG_DEFINITIONS_H
19
20 /* diode directions */
21 #define COL2ROW       0
22 #define ROW2COL       1
23 #define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */
24
25 #ifdef __AVR__
26   /* I/O pins */
27   #ifndef F0
28       #define B0 0x30
29       #define B1 0x31
30       #define B2 0x32
31       #define B3 0x33
32       #define B4 0x34
33       #define B5 0x35
34       #define B6 0x36
35       #define B7 0x37
36       #define C0 0x60
37       #define C1 0x61
38       #define C2 0x62
39       #define C3 0x63
40       #define C4 0x64
41       #define C5 0x65
42       #define C6 0x66
43       #define C7 0x67
44       #define D0 0x90
45       #define D1 0x91
46       #define D2 0x92
47       #define D3 0x93
48       #define D4 0x94
49       #define D5 0x95
50       #define D6 0x96
51       #define D7 0x97
52       #define E0 0xC0
53       #define E1 0xC1
54       #define E2 0xC2
55       #define E3 0xC3
56       #define E4 0xC4
57       #define E5 0xC5
58       #define E6 0xC6
59       #define E7 0xC7
60       #define F0 0xF0
61       #define F1 0xF1
62       #define F2 0xF2
63       #define F3 0xF3
64       #define F4 0xF4
65       #define F5 0xF5
66       #define F6 0xF6
67       #define F7 0xF7
68       #define A0 0x00
69       #define A1 0x01
70       #define A2 0x02
71       #define A3 0x03
72       #define A4 0x04
73       #define A5 0x05
74       #define A6 0x06
75       #define A7 0x07
76   #endif
77 #endif
78
79 /* USART configuration */
80 #ifdef BLUETOOTH_ENABLE
81 #   ifdef __AVR_ATmega32U4__
82 #      define SERIAL_UART_BAUD 9600
83 #      define SERIAL_UART_DATA UDR1
84 #      define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
85 #      define SERIAL_UART_RXD_VECT USART1_RX_vect
86 #      define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
87 #      define SERIAL_UART_INIT() do { \
88             /* baud rate */ \
89             UBRR1L = SERIAL_UART_UBRR; \
90             /* baud rate */ \
91             UBRR1H = SERIAL_UART_UBRR >> 8; \
92             /* enable TX */ \
93             UCSR1B = _BV(TXEN1); \
94             /* 8-bit data */ \
95             UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
96             sei(); \
97         } while(0)
98 #   else
99 #       error "USART configuration is needed."
100 #   endif
101 #endif
102
103 #define API_SYSEX_MAX_SIZE 32
104
105 #include "song_list.h"
106
107 #endif