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