1 /* Copyright 2015-2017 Jack Humbert
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/>.
17 #ifndef CONFIG_DEFINITIONS_H
18 #define CONFIG_DEFINITIONS_H
20 /* diode directions */
23 #define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */
77 #elif defined(PROTOCOL_CHIBIOS)
78 #define A0 PAL_LINE(GPIOA, 0)
79 #define A1 PAL_LINE(GPIOA, 1)
80 #define A2 PAL_LINE(GPIOA, 2)
81 #define A3 PAL_LINE(GPIOA, 3)
82 #define A4 PAL_LINE(GPIOA, 4)
83 #define A5 PAL_LINE(GPIOA, 5)
84 #define A6 PAL_LINE(GPIOA, 6)
85 #define A7 PAL_LINE(GPIOA, 7)
86 #define A8 PAL_LINE(GPIOA, 8)
87 #define A9 PAL_LINE(GPIOA, 9)
88 #define A10 PAL_LINE(GPIOA, 10)
89 #define A11 PAL_LINE(GPIOA, 11)
90 #define A12 PAL_LINE(GPIOA, 12)
91 #define A13 PAL_LINE(GPIOA, 13)
92 #define A14 PAL_LINE(GPIOA, 14)
93 #define A15 PAL_LINE(GPIOA, 15)
94 #define B0 PAL_LINE(GPIOB, 0)
95 #define B1 PAL_LINE(GPIOB, 1)
96 #define B2 PAL_LINE(GPIOB, 2)
97 #define B3 PAL_LINE(GPIOB, 3)
98 #define B4 PAL_LINE(GPIOB, 4)
99 #define B5 PAL_LINE(GPIOB, 5)
100 #define B6 PAL_LINE(GPIOB, 6)
101 #define B7 PAL_LINE(GPIOB, 7)
102 #define B8 PAL_LINE(GPIOB, 8)
103 #define B9 PAL_LINE(GPIOB, 9)
104 #define B10 PAL_LINE(GPIOB, 10)
105 #define B11 PAL_LINE(GPIOB, 11)
106 #define B12 PAL_LINE(GPIOB, 12)
107 #define B13 PAL_LINE(GPIOB, 13)
108 #define B14 PAL_LINE(GPIOB, 14)
109 #define B15 PAL_LINE(GPIOB, 15)
110 #define C0 PAL_LINE(GPIOC, 0)
111 #define C1 PAL_LINE(GPIOC, 1)
112 #define C2 PAL_LINE(GPIOC, 2)
113 #define C3 PAL_LINE(GPIOC, 3)
114 #define C4 PAL_LINE(GPIOC, 4)
115 #define C5 PAL_LINE(GPIOC, 5)
116 #define C6 PAL_LINE(GPIOC, 6)
117 #define C7 PAL_LINE(GPIOC, 7)
118 #define C8 PAL_LINE(GPIOC, 8)
119 #define C9 PAL_LINE(GPIOC, 9)
120 #define C10 PAL_LINE(GPIOC, 10)
121 #define C11 PAL_LINE(GPIOC, 11)
122 #define C12 PAL_LINE(GPIOC, 12)
123 #define C13 PAL_LINE(GPIOC, 13)
124 #define C14 PAL_LINE(GPIOC, 14)
125 #define C15 PAL_LINE(GPIOC, 15)
126 #define D0 PAL_LINE(GPIOD, 0)
127 #define D1 PAL_LINE(GPIOD, 1)
128 #define D2 PAL_LINE(GPIOD, 2)
129 #define D3 PAL_LINE(GPIOD, 3)
130 #define D4 PAL_LINE(GPIOD, 4)
131 #define D5 PAL_LINE(GPIOD, 5)
132 #define D6 PAL_LINE(GPIOD, 6)
133 #define D7 PAL_LINE(GPIOD, 7)
134 #define D8 PAL_LINE(GPIOD, 8)
135 #define D9 PAL_LINE(GPIOD, 9)
136 #define D10 PAL_LINE(GPIOD, 10)
137 #define D11 PAL_LINE(GPIOD, 11)
138 #define D12 PAL_LINE(GPIOD, 12)
139 #define D13 PAL_LINE(GPIOD, 13)
140 #define D14 PAL_LINE(GPIOD, 14)
141 #define D15 PAL_LINE(GPIOD, 15)
142 #define E0 PAL_LINE(GPIOE, 0)
143 #define E1 PAL_LINE(GPIOE, 1)
144 #define E2 PAL_LINE(GPIOE, 2)
145 #define E3 PAL_LINE(GPIOE, 3)
146 #define E4 PAL_LINE(GPIOE, 4)
147 #define E5 PAL_LINE(GPIOE, 5)
148 #define E6 PAL_LINE(GPIOE, 6)
149 #define E7 PAL_LINE(GPIOE, 7)
150 #define E8 PAL_LINE(GPIOE, 8)
151 #define E9 PAL_LINE(GPIOE, 9)
152 #define E10 PAL_LINE(GPIOE, 10)
153 #define E11 PAL_LINE(GPIOE, 11)
154 #define E12 PAL_LINE(GPIOE, 12)
155 #define E13 PAL_LINE(GPIOE, 13)
156 #define E14 PAL_LINE(GPIOE, 14)
157 #define E15 PAL_LINE(GPIOE, 15)
158 #define F0 PAL_LINE(GPIOF, 0)
159 #define F1 PAL_LINE(GPIOF, 1)
160 #define F2 PAL_LINE(GPIOF, 2)
161 #define F3 PAL_LINE(GPIOF, 3)
162 #define F4 PAL_LINE(GPIOF, 4)
163 #define F5 PAL_LINE(GPIOF, 5)
164 #define F6 PAL_LINE(GPIOF, 6)
165 #define F7 PAL_LINE(GPIOF, 7)
166 #define F8 PAL_LINE(GPIOF, 8)
167 #define F9 PAL_LINE(GPIOF, 9)
168 #define F10 PAL_LINE(GPIOF, 10)
169 #define F11 PAL_LINE(GPIOF, 11)
170 #define F12 PAL_LINE(GPIOF, 12)
171 #define F13 PAL_LINE(GPIOF, 13)
172 #define F14 PAL_LINE(GPIOF, 14)
173 #define F15 PAL_LINE(GPIOF, 15)
176 /* USART configuration */
177 #ifdef BLUETOOTH_ENABLE
178 # ifdef __AVR_ATmega32U4__
179 # define SERIAL_UART_BAUD 9600
180 # define SERIAL_UART_DATA UDR1
181 # define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
182 # define SERIAL_UART_RXD_VECT USART1_RX_vect
183 # define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
184 # define SERIAL_UART_INIT() do { \
186 UBRR1L = SERIAL_UART_UBRR; \
188 UBRR1H = SERIAL_UART_UBRR >> 8; \
190 UCSR1B = _BV(TXEN1); \
192 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
196 # error "USART configuration is needed."
200 #define API_SYSEX_MAX_SIZE 32
202 #include "song_list.h"