Enforce definition of `DIODE_DIRECTION` for non-custom matrix boards (#7915)
[jackhill/qmk/firmware.git] / quantum / mcu_selection.mk
CommitLineData
3cf179be 1ifneq ($(findstring STM32F303, $(MCU)),)
250a99ff
JC
2 # Cortex version
3 MCU = cortex-m4
4
5 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
6 ARMV = 7
7
3cf179be
JH
8 ## chip/board settings
9 # - the next two should match the directories in
10 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
250a99ff
JC
11 MCU_FAMILY = STM32
12 MCU_SERIES = STM32F3xx
3cf179be
JH
13
14 # Linker script to use
15 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
f98750de 16 # or <keyboard_dir>/ld/
3cf179be
JH
17 MCU_LDSCRIPT ?= STM32F303xC
18
19 # Startup code to use
20 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
21 MCU_STARTUP ?= stm32f3xx
22
f98750de 23 # Board: it should exist either in <chibios>/os/hal/boards/,
24 # <keyboard_dir>/boards/, or drivers/boards/
3cf179be
JH
25 BOARD ?= GENERIC_STM32_F303XC
26
250a99ff
JC
27 USE_FPU ?= yes
28
29 # Options to pass to dfu-util when flashing
30 DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
31 DFU_SUFFIX_ARGS ?= -v 0483 -p df11
32endif
33
34ifneq ($(findstring STM32F072, $(MCU)),)
3cf179be 35 # Cortex version
250a99ff
JC
36 MCU = cortex-m0
37
38 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
39 ARMV = 6
40
41 ## chip/board settings
42 # - the next two should match the directories in
43 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
44 MCU_FAMILY = STM32
45 MCU_SERIES = STM32F0xx
46
47 # Linker script to use
48 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
49 # or <keyboard_dir>/ld/
50 MCU_LDSCRIPT ?= STM32F072xB
51
52 # Startup code to use
53 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
54 MCU_STARTUP ?= stm32f0xx
55
56 # Board: it should exist either in <chibios>/os/hal/boards/,
57 # <keyboard_dir>/boards/, or drivers/boards/
58 BOARD ?= ST_STM32F072B_DISCOVERY
59
60 USE_FPU ?= no
61
62 # Options to pass to dfu-util when flashing
63 DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
64 DFU_SUFFIX_ARGS ?= -v 0483 -p df11
65endif
66
67ifneq ($(findstring STM32F042, $(MCU)),)
68 # Cortex version
69 MCU = cortex-m0
70
71 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
72 ARMV = 6
73
74 ## chip/board settings
75 # - the next two should match the directories in
76 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
77 MCU_FAMILY = STM32
78 MCU_SERIES = STM32F0xx
79
80 # Linker script to use
81 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
82 # or <keyboard_dir>/ld/
83 MCU_LDSCRIPT ?= STM32F042x6
84
85 # Startup code to use
86 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
87 MCU_STARTUP ?= stm32f0xx
88
89 # Board: it should exist either in <chibios>/os/hal/boards/,
90 # <keyboard_dir>/boards/, or drivers/boards/
91 BOARD ?= GENERIC_STM32_F042X6
92
93 USE_FPU ?= no
94
95 # Options to pass to dfu-util when flashing
96 DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
97 DFU_SUFFIX_ARGS ?= -v 0483 -p df11
98endif
99
100ifneq ($(findstring STM32F103, $(MCU)),)
101 # Cortex version
102 MCU = cortex-m3
3cf179be
JH
103
104 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
250a99ff 105 ARMV = 7
3cf179be 106
250a99ff
JC
107 ## chip/board settings
108 # - the next two should match the directories in
109 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
110 MCU_FAMILY = STM32
111 MCU_SERIES = STM32F1xx
112
113 # Linker script to use
114 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
115 # or <keyboard_dir>/ld/
116 MCU_LDSCRIPT ?= STM32F103x8
117
118 # Startup code to use
119 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
120 MCU_STARTUP ?= stm32f1xx
121
122 # Board: it should exist either in <chibios>/os/hal/boards/,
123 # <keyboard_dir>/boards/, or drivers/boards/
124 BOARD ?= GENERIC_STM32_F103
3cf179be 125
250a99ff 126 USE_FPU ?= no
3cf179be
JH
127
128 # Options to pass to dfu-util when flashing
129 DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
250a99ff 130 DFU_SUFFIX_ARGS ?= -v 0483 -p df11
3cf179be
JH
131endif
132
98599173 133ifneq (,$(filter $(MCU),atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb1286))
3cf179be
JH
134 # Processor frequency.
135 # This will define a symbol, F_CPU, in all source code files equal to the
136 # processor frequency in Hz. You can then use this symbol in your source code to
137 # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
138 # automatically to create a 32-bit value in your source code.
139 #
140 # This will be an integer division of F_USB below, as it is sourced by
141 # F_USB after it has run through any CPU prescalers. Note that this value
142 # does not *change* the processor frequency - it should merely be updated to
143 # reflect the processor speed set externally so that the code can use accurate
144 # software delays.
145 F_CPU ?= 16000000
146
147 # LUFA specific
148 #
149 # Target architecture (see library "Board Types" documentation).
405dea01 150 ARCH = AVR8
3cf179be
JH
151
152 # Input clock frequency.
153 # This will define a symbol, F_USB, in all source code files equal to the
154 # input clock frequency (before any prescaling is performed) in Hz. This value may
155 # differ from F_CPU if prescaling is used on the latter, and is required as the
156 # raw input clock is fed directly to the PLL sections of the AVR for high speed
157 # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
158 # at the end, this will be done automatically to create a 32-bit value in your
159 # source code.
160 #
161 # If no clock division is performed on the input clock inside the AVR (via the
162 # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
163 F_USB ?= $(F_CPU)
405dea01 164
165 # Interrupt driven control endpoint task
166 ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes))
167 OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
168 endif
169endif
170
171ifneq (,$(filter $(MCU),atmega32a))
c74295de 172 # MCU name for avrdude
173 AVRDUDE_MCU = m32
174
405dea01 175 PROTOCOL = VUSB
176
177 # Processor frequency.
178 # This will define a symbol, F_CPU, in all source code files equal to the
179 # processor frequency in Hz. You can then use this symbol in your source code to
180 # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
181 # automatically to create a 32-bit value in your source code.
182 F_CPU ?= 12000000
183
184 # unsupported features for now
185 NO_UART ?= yes
186 NO_SUSPEND_POWER_DOWN ?= yes
3cf179be 187endif
490a13a0 188
189ifneq (,$(filter $(MCU),atmega328p))
c74295de 190 # MCU name for avrdude
191 AVRDUDE_MCU = m328p
192
490a13a0 193 PROTOCOL = VUSB
194
195 # Processor frequency.
196 # This will define a symbol, F_CPU, in all source code files equal to the
197 # processor frequency in Hz. You can then use this symbol in your source code to
198 # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
199 # automatically to create a 32-bit value in your source code.
200 F_CPU ?= 16000000
201
202 # unsupported features for now
203 NO_UART ?= yes
204 NO_SUSPEND_POWER_DOWN ?= yes
205endif