-
Notifications
You must be signed in to change notification settings - Fork 270
/
mcu_compat.h
461 lines (405 loc) · 9.84 KB
/
mcu_compat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
/* Copyright (C) 2017-2018 by Jacob Alexander
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
// ----- Defined Guide -----
//
// _kinetis_ - Kinetis MCU
// _kinetis_k_ - Kinetis K-Series MCU
// _kinetis_k2x_ - Kinetis K2x-Series MCU
// _kinetis_k6x_ - Kinetis K6x-Series MCU
// _kinetis_k20_ - Kinetis K20-Series MCU
// _kinetis_k22_ - Kinetis K22-Series MCU
// _kinetis_k64_ - Kinetis K64-Series MCU
// _kinetis_k66_ - Kinetis K66-Series MCU
// _kinetis_fpu_ - Kinetis MCU with FPU
//
// _sam_ - SAM MCU
// _sam4s_ - SAM 4s MCU
// _sam4s2_ - SAM 4s2 MCU
// _sam4s4_ - SAM 4s4 MCU
// _sam4s8_ - SAM 4s8 MCU
// _sam4s16_ - SAM 4s16 MCU
// _sam4sa16_ - SAM 4sa16 MCU
// _sam4sd16_ - SAM 4sd16 MCU
// _sam4sd32_ - SAM 4sd32 MCU
// _sam4s_a_ - SAM 4s 48-pin MCU
// _sam4s_b_ - SAM 4s 64-pin MCU
// _sam4s_c_ - SAM 4s 100-pin MCU
//
// _nrf_ - nRF BLE MCU
// _nrf5_ - nRF5 BLE MCU
// _nrf52_ - nRF52 BLE MCU
// _nrf528_ - nRF528 BLE MCU
// _nrf52810_ - nRF52810 BLE MCU
// _nrf52832_ - nRF52832 BLE MCU
// _nrf52832_a_ - nRF52832 BLE MCU 512 kB
// _nrf52832_b_ - nRF52832 BLE MCU 256 kB
// _nrf52840_ - nRF52840 BLE MCU
//
// _kii_v1_ - Kiibohd Firmware Layout v1 - First Keyboard: Infinity 60%
// _kii_v2_ - Kiibohd Firmware Layout v2 - First Keyboard: Infinity Ergodox
// _kii_v3_ - Kiibohd Firmware Layout v3 - First Keyboard: TBD
//
// _teensy_ - PJRC Teensy
// _teensy_2_ - PJRC Teensy 2 Series
// _teensy_3_ - PJRC Teensy 3 Series
// _teensy_3_0_ - PJRC Teensy 3.0
// _teensy_3_0__3_1 - PJRC Teensy 3.0+3.1 (+3.2)
// _teensy_3_1_ - PJRC Teensy 3.1 (+3.2)
// _teensy_3_5_ - PJRC Teensy 3.5
// _teensy_3_5__3_6_ - PJRC Teensy 3.5+3.6
// _teensy_3_6_ - PJRC Teensy 3.6
//
// _avr_ - Atmel AVR
// _cortex_m0_ - ARM Cortex-M0
// _cortex_m0p_ - ARM Cortex-M0+
// _cortex_m4_ - ARM Cortex-M4
// _cortex_m4f_ - ARM Cortex-M4F (FPU)
// ----- Includes -----
#pragma once
// - Kinetis ARM MCUs -
// mk20dx128vlf5
#if defined(_mk20dx128_) || defined(_mk20dx128vlf5_)
#define _cortex_m4_ 1
#define _kinetis_ 1
#define _kinetis_k_ 1
#define _kinetis_k2x_ 1
#define _kinetis_k20_ 1
#define _kii_v1_ 1
#endif
// mk20dx128vlh7
#if defined(_mk20dx128vlh7_)
#define _cortex_m4_ 1
#define _kinetis_ 1
#define _kinetis_k_ 1
#define _kinetis_k2x_ 1
#define _kinetis_k20_ 1
#define _kii_v2_ 1
#endif
// mk20dx256vlh7
#if defined(_mk20dx256_) || defined(_mk20dx256vlh7_)
#define _cortex_m4_ 1
#define _kinetis_ 1
#define _kinetis_k_ 1
#define _kinetis_k2x_ 1
#define _kinetis_k20_ 1
#define _kii_v2_ 1
#endif
// mk22fx512avlh12
#if defined(_mk22fx512avlh12_)
#define _cortex_m4_ 1
#define _kinetis_ 1
#define _kinetis_k_ 1
#define _kinetis_k2x_ 1
#define _kinetis_k22_ 1
#define _kinetis_fpu_ 1
#define _kii_v2_ 1
#endif
// mk64fx512vmd12
#if defined(_mk64fx512_)
#define _cortex_m4_ 1
#define _cortex_m4f_ 1
#define _kinetis_ 1
#define _kinetis_k_ 1
#define _kinetis_k6x_ 1
#define _kinetis_k64_ 1
#define _kinetis_fpu_ 1
#endif
// mk66fx1m0vmd18
#if defined(_mk66fx1m0_)
#define _cortex_m4_ 1
#define _cortex_m4f_ 1
#define _kinetis_ 1
#define _kinetis_k_ 1
#define _kinetis_k6x_ 1
#define _kinetis_k64_ 1
#define _kinetis_fpu_ 1
#endif
// - SAM ARM MCUs -
// sam4s2a (128 kB) 48-pin
#if defined(_sam4s2a_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_a_ 1
#define _sam4s2_ 1
#define _kii_v3_ 1
#endif
// sam4s2b (128 kB) 64-pin
#if defined(_sam4s2b_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_b_ 1
#define _sam4s2_ 1
#define _kii_v3_ 1
#endif
// sam4s2c (128 kB) 100-pin
#if defined(_sam4s2c_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_c_ 1
#define _sam4s2_ 1
#define _kii_v3_ 1
#endif
// sam4s4a (256 kB) 48-pin
#if defined(_sam4s4a_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_a_ 1
#define _sam4s4_ 1
#define _kii_v3_ 1
#endif
// sam4s4b (256 kB) 64-pin
#if defined(_sam4s4b_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_b_ 1
#define _sam4s4_ 1
#define _kii_v3_ 1
#endif
// sam4s4c (256 kB) 100-pin
#if defined(_sam4s4c_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_c_ 1
#define _sam4s4_ 1
#define _kii_v3_ 1
#endif
// sam4s8b (512 kB) 64-pin
#if defined(_sam4s8b_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_b_ 1
#define _sam4s8_ 1
#define _kii_v3_ 1
#endif
// sam4s8c (512 kB) 100-pin
#if defined(_sam4s8c_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_c_ 1
#define _sam4s8_ 1
#define _kii_v3_ 1
#endif
// sam4s16b (1028 kB) 64-pin
#if defined(_sam4s16b_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_b_ 1
#define _sam4s16_ 1
#define _kii_v3_ 1
#endif
// sam4s16c (1028 kB) 100-pin
#if defined(_sam4s16c_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_c_ 1
#define _sam4s16_ 1
#define _kii_v3_ 1
#endif
// sam4sa16b (sam4s16b /w HCache) (1024 kB) 64-pin
#if defined(_sam4sa16b_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_b_ 1
#define _sam4sa_ 1
#define _sam4sa16_ 1
#define _sam_hcache_ 1
#define _kii_v3_ 1
#endif
// sam4sa16c (sam4s16b /w HCache) (1024 kB) 100-pin
#if defined(_sam4sa16c_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_c_ 1
#define _sam4sa_ 1
#define _sam4sa16_ 1
#define _sam_hcache_ 1
#define _kii_v3_ 1
#endif
// sam4sd16b (HCache) (2 x 512 kB) 64-pin
#if defined(_sam4sd16b_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_b_ 1
#define _sam4sd_ 1
#define _sam4sd16_ 1
#define _sam_hcache_ 1
#define _kii_v3_ 1
#endif
// sam4sd16c (HCache) (2 x 512 kB) 100-pin
#if defined(_sam4sd16c_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_c_ 1
#define _sam4sd_ 1
#define _sam4sd16_ 1
#define _sam_hcache_ 1
#define _kii_v3_ 1
#endif
// sam4sd32b (HCache) (2 x 1024 kB) 64-pin
#if defined(_sam4sd32b_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_b_ 1
#define _sam4sd_ 1
#define _sam4sd32_ 1
#define _sam_hcache_ 1
#define _kii_v3_ 1
#endif
// sam4sd32c (HCache) (2 x 1024 kB) 100-pin
#if defined(_sam4sd32c_)
#define _cortex_m4_ 1
#define _sam_ 1
#define _sam4s_ 1
#define _sam4s_c_ 1
#define _sam4sd_ 1
#define _sam4sd32_ 1
#define _sam_hcache_ 1
#define _kii_v3_ 1
#endif
// - nRF BLE ARM MCUs -
// nRF52810-QCAA (192 kB) 32-pin
#if defined(_nrf52810_qcaa_)
#define _cortex_m4_ 1
#define _cortex_m4f_ 1
#define _nrf_ 1
#define _nrf5_ 1
#define _nrf52_ 1
#define _nrf528_ 1
#define _nrf52810_ 1
#endif
// nRF52810-QFAA (192 kB) 48-pin
#if defined(_nrf52810_qfaa_)
#define _cortex_m4_ 1
#define _cortex_m4f_ 1
#define _nrf_ 1
#define _nrf5_ 1
#define _nrf52_ 1
#define _nrf528_ 1
#define _nrf52810_ 1
#endif
// nRF52832-QFAA (512 kB) 48-pin
#if defined(_nrf52832_qfaa_)
#define _cortex_m4_ 1
#define _cortex_m4f_ 1
#define _nrf_ 1
#define _nrf5_ 1
#define _nrf52_ 1
#define _nrf528_ 1
#define _nrf52832_ 1
#define _nrf52832_a_ 1
#endif
// nRF52832-QFAB (256 kB) 48-pin
#if defined(_nrf52832_qfab_)
#define _cortex_m4_ 1
#define _cortex_m4f_ 1
#define _nrf_ 1
#define _nrf5_ 1
#define _nrf52_ 1
#define _nrf528_ 1
#define _nrf52832_ 1
#define _nrf52832_b_ 1
#endif
// nRF52832-CIAA (512 kB) 50-pin
#if defined(_nrf52832_ciaa_)
#define _cortex_m4_ 1
#define _cortex_m4f_ 1
#define _nrf_ 1
#define _nrf5_ 1
#define _nrf52_ 1
#define _nrf528_ 1
#define _nrf52832_ 1
#define _nrf52832_a_ 1
#endif
// nRF52840-QIAA (1024 kB) 73-pin
#if defined(_nrf52840_qiaa_)
#define _cortex_m4_ 1
#define _cortex_m4f_ 1
#define _nrf_ 1
#define _nrf5_ 1
#define _nrf52_ 1
#define _nrf528_ 1
#define _nrf52840_ 1
#endif
// - AVR MCUs -
// at90usb1286
#if defined(_at90usb1286_)
#define _avr_ 1
#define _avr_at_ 1
#endif
// atmega32u4
#if defined(_atmega32u4_)
#define _avr_ 1
#define _avr_at_ 1
#endif
// - Teensy -
// Teensy 2.0 - atmega32u4
#if defined(_atmega32u4_)
#define _teensy_ 1
#define _teensy_2_ 1
#endif
// Teensy 2.0++ - at90usb1286
#if defined(_at90usb1286_)
#define _teensy_ 1
#define _teensy_2_ 1
#endif
// Teensy 3.0 - mk20dx128vlf5
#if defined(_mk20dx128_)
#define _teensy_ 1
#define _teensy_3_ 1
#define _teensy_3_0_ 1
#define _teensy_3_0__3_1 1
#endif
// Teensy 3.1/3.2 - mk20dx256vlh7
#if defined(_mk20dx256_)
#define _teensy_ 1
#define _teensy_3_ 1
#define _teensy_3_1_ 1
#define _teensy_3_0__3_1 1
#endif
// Teensy 3.5 - mk64fx512vmd12
#if defined(_mk64fx512_)
#define _teensy_ 1
#define _teensy_3_ 1
#define _teensy_3_5_ 1
#define _teensy_3_5__3_6_ 1
#endif
// Teensy 3.6 - mk66fx1m0vmd18
#if defined(_mk66fx1m0_)
#define _teensy_ 1
#define _teensy_3_ 1
#define _teensy_3_6_ 1
#define _teensy_3_5__3_6_ 1
#endif